Commit aba273b6 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Work on recovery bug. Addresses #27.

git-svn-id: file:///svn/tokudb@1461 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5fcadb28
......@@ -199,11 +199,16 @@ void toku_brtnode_flush_callback (CACHEFILE cachefile, DISKOFF nodename, void *b
int toku_brtnode_fetch_callback (CACHEFILE cachefile, DISKOFF nodename, void **brtnode_pv, long *sizep, void*extraargs, LSN *written_lsn) {
BRT t =(BRT)extraargs;
BRTNODE *result=(BRTNODE*)brtnode_pv;
printf("result=%p written_lsn=%p\n", result, written_lsn);
int r = toku_deserialize_brtnode_from(toku_cachefile_fd(cachefile), nodename, result, t->flags, t->nodesize,
t->compare_fun, t->dup_compare, t->db, toku_cachefile_filenum(t->cf));
if (r == 0)
*sizep = brtnode_size(*result);
printf("result=%p written_lsn=%p\n", result, written_lsn);
printf("disk_lsn=%lld\n", (*result)->disk_lsn.lsn);
printf("ok\n");
*written_lsn = (*result)->disk_lsn;
printf("ok\n");
//(*result)->parent_brtnode = 0; /* Don't know it right now. */
//printf("%s:%d installed %p (offset=%lld)\n", __FILE__, __LINE__, *result, nodename);
return r;
......@@ -327,7 +332,7 @@ static void initialize_brtnode (BRT t, BRTNODE n, DISKOFF nodename, int height)
} else {
int r = toku_pma_create(&n->u.l.buffer, t->compare_fun, t->db, toku_cachefile_filenum(t->cf), n->nodesize);
assert(r==0);
toku_pma_set_dup_mode(n->u.l.buffer, t->flags & (TOKU_DB_DUP+TOKU_DB_DUPSORT));
toku_pma_set_dup_mode(n->u.l.buffer, t->flags & (TOKU_DB_DUP|TOKU_DB_DUPSORT));
toku_pma_set_dup_compare(n->u.l.buffer, t->dup_compare);
static int rcount=0;
//printf("%s:%d n PMA= %p (rcount=%d)\n", __FILE__, __LINE__, n->u.l.buffer, rcount);
......
......@@ -110,7 +110,7 @@ static void toku_recover_newbrtnode (struct logtype_newbrtnode *c) {
TAGMALLOC(BRTNODE, n);
n->nodesize = c->nodesize;
n->thisnodename = c->diskoff;
n->log_lsn = n->disk_lsn = c->lsn;
n->log_lsn = n->disk_lsn = c->lsn; printf("%s:%d %p->disk_lsn=%lld\n", __FILE__, __LINE__, n, n->disk_lsn.lsn);
n->layout_version = 0;
n->parent_brtnode = 0;
n->height = c->height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment