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

set layout_version to 1 (for 0.4.0). Addresses #118. Fixes #248.

git-svn-id: file:///svn/tokudb@1536 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2686065f
......@@ -26,7 +26,7 @@ static void test_serialize(void) {
sn.thisnodename = sn.nodesize*20;
sn.disk_lsn.lsn = 789;
sn.log_lsn.lsn = 123456;
sn.layout_version = 0;
sn.layout_version = 1;
sn.height = 1;
sn.rand4fingerprint = randval;
sn.local_fingerprint = 0;
......@@ -60,7 +60,7 @@ static void test_serialize(void) {
assert(dn->thisnodename==nodesize*20);
assert(dn->disk_lsn.lsn==123456);
assert(dn->layout_version ==0);
assert(dn->layout_version ==1);
assert(dn->height == 1);
assert(dn->rand4fingerprint==randval);
assert(dn->u.n.n_children==2);
......
......@@ -258,7 +258,7 @@ int toku_deserialize_brtnode_from (int fd, DISKOFF off, BRTNODE *brtnode, int fl
}
}
result->layout_version = rbuf_int(&rc);
if (result->layout_version!=0) {
if (result->layout_version!=1) {
r=DB_BADFORMAT;
goto died1;
}
......
......@@ -303,7 +303,7 @@ static void initialize_brtnode (BRT t, BRTNODE n, DISKOFF nodename, int height)
n->thisnodename = nodename;
n->disk_lsn.lsn = 0; // a new one can always be 0.
n->log_lsn = n->disk_lsn;
n->layout_version = 0;
n->layout_version = 1;
n->height = height;
n->rand4fingerprint = random();
n->local_fingerprint = 0;
......
......@@ -112,7 +112,7 @@ static void toku_recover_newbrtnode (struct logtype_newbrtnode *c) {
n->nodesize = c->nodesize;
n->thisnodename = c->diskoff;
n->log_lsn = n->disk_lsn = c->lsn; printf("%s:%d %p->disk_lsn=%"PRId64"\n", __FILE__, __LINE__, n, n->disk_lsn.lsn);
n->layout_version = 0;
n->layout_version = 1;
n->parent_brtnode = 0;
n->height = c->height;
n->rand4fingerprint = c->rand4fingerprint;
......@@ -185,6 +185,7 @@ static void toku_recover_insertinleaf (struct logtype_insertinleaf *c) {
toku_free(c->data.data);
}
// a newbrtnode should have been done before this
static void toku_recover_resizepma (struct logtype_resizepma *c) {
struct cf_pair *pair;
int r = find_cachefile(c->filenum, &pair);
......
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