Hi,
I lightly modify the db-bench.c file to reflect my need, then do a test. It crash around 6 millions of inserted records. I redo the test, it crash again. I redo, but now the DB was broken.
I have enabled the log, so I'm really surprised that DB was dead.
Regards,
Laurent
note: I put the diff, then after I paste the console logs.
-#define TOLOG (0)
+#define TOLOG (1)
#define KSIZE 16
-#define VSIZE 80
-#define BUFFERPOOL (1024_1024_1024)
+#define VSIZE 24
+#define BUFFERPOOL ((size_t)3_1024_1024*1024)
@@ -113,13 +113,17 @@ void _write_test(long int count)
sk.len = KSIZE;
sk.data = key;
-
-
sv.len = VSIZE;
sv.data = val;
-
-
fprintf(stderr,"random write finished %d ops%30s\r", i, "");
-
-
if ((i % 1000000) == 0) {
-
-
fprintf(stderr,"%d;%d \n", i, (int)(t2 - start));
}
lch@hyperstream:/DT/local/nessDB$ ./db-bench write 10000000
Keys: 16 bytes each
Values: 24 bytes each
Entries: 10000000
IndexSize: 238.4 MB (estimated)
DataSize: 267.0 MB (estimated)
nessDB: version 1.8(LSM-Tree storage engine)
Date: Sat Apr 7 21:44:39 2012
CPU: 8 * Intel(R) Xeon(R) CPU E31245 @ 3.30GHz
CPUCache: 8192 KB
[18835] 07 Apr 09:44:39 . Load sst,all entries count:<0>
0;0
1000000;4
2000000;9
3000000;15
4000000;20
5000000;26
6000000;32
Segmentation fault
lch@hyperstream:/DT/local/nessDB$ ./db-bench write 10000000
Keys: 16 bytes each
Values: 24 bytes each
Entries: 10000000
IndexSize: 238.4 MB (estimated)
DataSize: 267.0 MB (estimated)
nessDB: version 1.8(LSM-Tree storage engine)
Date: Sat Apr 7 21:46:17 2012
CPU: 8 * Intel(R) Xeon(R) CPU E31245 @ 3.30GHz
CPUCache: 8192 KB
[18997] 07 Apr 09:46:20 . Load sst,all entries count:<6000000>
[18997] 07 Apr 09:46:20 . prepare to recovery from new log#/DT/local/nessDB/ndbs/1.log
[18997] 07 Apr 09:46:20 . recovery count ADD#173367, DEL#0
[18997] 07 Apr 09:46:20 . prepare to merge logs, merge count #173367....
[18997] 07 Apr 09:46:20 . adding log items to bloomfilter
0;0
1000000;4
2000000;9
3000000;15
4000000;20
5000000;26
6000000;33
Bus error
Keys: 16 bytes each
Values: 24 bytes each
Entries: 10000000
IndexSize: 238.4 MB (estimated)
DataSize: 267.0 MB (estimated)
nessDB: version 1.8(LSM-Tree storage engine)
Date: Sat Apr 7 21:48:17 2012
CPU: 8 * Intel(R) Xeon(R) CPU E31245 @ 3.30GHz
CPUCache: 8192 KB
[19196] 07 Apr 09:48:18 # read footer error, error:Invalid argument engine/sst.c:98
lch@hyperstream:/DT/local/nessDB$ rm ndbs/*
lch@hyperstream:/DT/local/nessDB$ gdb db-bench
(gdb) run write 10000000
Keys: 16 bytes each
Values: 24 bytes each
Entries: 10000000
IndexSize: 238.4 MB (estimated)
DataSize: 267.0 MB (estimated)
nessDB: version 1.8(LSM-Tree storage engine)
Date: Sat Apr 7 21:51:14 2012
CPU: 8 * Intel(R) Xeon(R) CPU E31245 @ 3.30GHz
CPUCache: 8192 KB
[19565] 07 Apr 09:51:14 . Load sst,all entries count:<0>
0;0
1000000;5
2000000;10
3000000;15
4000000;21
5000000;27
[New Thread 0x7fffec1a9700 (LWP 19670)]
6000000;33
[Thread 0x7fffec1a9700 (LWP 19670) exited]
Program received signal SIGSEGV, Segmentation fault.
0x00000000004081e3 in skiplist_lookup (list=0x60e460, data=0x7fffffffe940 "jdilkloimdkobnkn")
at engine/skiplist.c:162
162 while (x->forward[i] != NIL
(gdb) l
157 {
158 int i;
159 struct skipnode *x = list->hdr;
160
161 for (i = list->level; i >= 0; i--) {
162 while (x->forward[i] != NIL
163 && cmp_lt(x->forward[i]->key, data))
164 x = x->forward[i];
165 }
166 x = x->forward[0];
(gdb) p i
$1 = 758396511
(gdb) p x->foward[0]
There is no member named foward.
(gdb) p x->forward[0]
Cannot access memory at address 0x28
(gdb) p x
$2 = (struct skipnode *) 0x0
(gdb) info local
i = 758396511
x = 0x0
(gdb) where
#0 0x00000000004081e3 in skiplist_lookup (list=0x60e460, data=0x7fffffffe940 "jdilkloimdkobnkn")
#1 0x0000000000406e92 in index_get (idx=0x60da30, sk=0x7fffffffe8d0, sv=0x7fffffffe8c0) at engine/index.c:260
#2 0x000000000040298f in db_get (db=0x60c110, sk=0x7fffffffe8d0, sv=0x7fffffffe8c0) at engine/db.c:65
#3 0x0000000000401f0f in _write_test (count=10000000) at bench/db-bench.c:117
#4 0x00000000004023c8 in main (argc=3, argv=0x7fffffffea88) at bench/db-bench.c:218
(gdb) up
#1 0x0000000000406e92 in index_get (idx=0x60da30, sk=0x7fffffffe8d0, sv=0x7fffffffe8c0) at engine/index.c:260
260 node = skiplist_lookup(merge_list, sk->data);
(gdb)
#2 0x000000000040298f in db_get (db=0x60c110, sk=0x7fffffffe8d0, sv=0x7fffffffe8c0) at engine/db.c:65
65 ret = index_get(db->idx, sk, sv);
(gdb) p *sk
$4 = {data = 0x7fffffffe940 "jdilkloimdkobnkn", len = 16}
(gdb) p *sv
$5 = {data = 0x7fffffffe920 "val:6176209", len = 24}
(gdb)