need to restore magic number when kvstore open

This commit is contained in:
Hongze Cheng 2020-07-21 18:08:46 +08:00
parent e41a6f4bca
commit 5e8b11415a
1 changed files with 1 additions and 0 deletions

View File

@ -141,6 +141,7 @@ SKVStore *tdOpenKVStore(char *fname, iterFunc iFunc, afterFunc aFunc, void *appH
if (tdLoadKVStoreHeader(pStore->fd, pStore->fname, &info) < 0) goto _err; if (tdLoadKVStoreHeader(pStore->fd, pStore->fname, &info) < 0) goto _err;
pStore->info.size = TD_KVSTORE_HEADER_SIZE; pStore->info.size = TD_KVSTORE_HEADER_SIZE;
pStore->info.magic = info.magic;
if (tdRestoreKVStore(pStore) < 0) goto _err; if (tdRestoreKVStore(pStore) < 0) goto _err;