Commit 86bb9be1 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4018 set modify time to create time when creating a fractal tree refs[t:4018]

git-svn-id: file:///svn/toku/tokudb@35682 c7de825b-a66e-492c-adef-691d508d4ae1
parent 85982144
......@@ -4193,7 +4193,6 @@ brt_init_header (BRT t, TOKUTXN txn) {
static int
brt_alloc_init_header(BRT t, TOKUTXN txn) {
int r;
uint64_t now = (uint64_t) time(NULL);
r = brtheader_alloc(&t->h);
if (r != 0) {
......@@ -4208,9 +4207,10 @@ brt_alloc_init_header(BRT t, TOKUTXN txn) {
t->h->build_id = BUILD_ID;
t->h->build_id_original = BUILD_ID;
uint64_t now = (uint64_t) time(NULL);
t->h->time_of_creation = now;
t->h->time_of_last_modification = 0;
t->h->time_of_last_modification = now;
memset(&t->h->descriptor, 0, sizeof(t->h->descriptor));
......@@ -5006,7 +5006,9 @@ toku_brtheader_checkpoint (CACHEFILE cf, int fd, void *header_v)
r = toku_logger_fsync_if_lsn_not_fsynced(logger, ch->checkpoint_lsn);
if (r!=0) goto handle_error;
}
h->time_of_last_modification = ch->time_of_last_modification = time(NULL); // 4018
uint64_t now = (uint64_t) time(NULL); // 4018;
h->time_of_last_modification = now;
ch->time_of_last_modification = now;
ch->checkpoint_count++;
// write translation and header to disk (or at least to OS internal buffer)
r = toku_serialize_brt_header_to(fd, ch);
......
......@@ -2863,7 +2863,9 @@ write_header (struct dbout *out, long long translation_location_on_disk, long lo
h.layout_version_original = BRT_LAYOUT_VERSION;
h.build_id = BUILD_ID;
h.build_id_original = BUILD_ID;
h.time_of_creation = (uint64_t) time(NULL);
uint64_t now = (uint64_t) time(NULL);
h.time_of_creation = now;
h.time_of_last_modification = now;
h.checkpoint_count = 1;
h.checkpoint_lsn = load_lsn;
h.nodesize = target_nodesize;
......
......@@ -37,8 +37,7 @@ test_stat64_create_time (uint64_t n) {
r = db->stat64(db, txn, &s0); assert(r == 0);
printf("initial stat create %lu\n", s0.bt_create_time_sec);
assert(s0.bt_create_time_sec != 0);
printf("initial stat modify %lu\n", s0.bt_modify_time_sec);
assert(s0.bt_modify_time_sec == 0);
assert(s0.bt_modify_time_sec == s0.bt_create_time_sec);
r = txn->commit(txn, 0); assert(r == 0);
// stats after create is committed
......
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