the starting version of wal is 0

This commit is contained in:
Shengliang Guan 2022-01-03 18:19:30 +08:00
parent ab93662155
commit 0e8c226085
5 changed files with 15 additions and 13 deletions

View File

@ -1,11 +1,11 @@
aux_source_directory(. ACCT_SRC)
add_executable(dnode_test_acct ${ACCT_SRC})
add_executable(mnode_test_acct ${ACCT_SRC})
target_link_libraries(
dnode_test_acct
mnode_test_acct
PUBLIC sut
)
add_test(
NAME dnode_test_acct
COMMAND dnode_test_acct
NAME mnode_test_acct
COMMAND mnode_test_acct
)

View File

@ -1,7 +1,7 @@
/**
* @file acct.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module acct-msg tests
* @brief MNODE module acct-msg tests
* @version 0.1
* @date 2021-12-15
*
@ -13,7 +13,7 @@
class DndTestAcct : public ::testing::Test {
protected:
static void SetUpTestSuite() { test.Init("/tmp/dnode_test_acct", 9012); }
static void SetUpTestSuite() { test.Init("/tmp/mnode_test_acct", 9012); }
static void TearDownTestSuite() { test.Cleanup(); }
static Testbase test;

View File

@ -1,11 +1,11 @@
aux_source_directory(. USER_SRC)
add_executable(dnode_test_user ${USER_SRC})
add_executable(mnode_test_user ${USER_SRC})
target_link_libraries(
dnode_test_user
mnode_test_user
PUBLIC sut
)
add_test(
NAME dnode_test_user
COMMAND dnode_test_user
NAME mnode_test_user
COMMAND mnode_test_user
)

View File

@ -1,7 +1,7 @@
/**
* @file user.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module user-msg tests
* @brief MNODE module user-msg tests
* @version 0.1
* @date 2021-12-15
*
@ -13,7 +13,7 @@
class DndTestUser : public ::testing::Test {
protected:
static void SetUpTestSuite() { test.Init("/tmp/dnode_test_user", 9140); }
static void SetUpTestSuite() { test.Init("/tmp/mnode_test_user", 9140); }
static void TearDownTestSuite() { test.Cleanup(); }
static Testbase test;

View File

@ -51,6 +51,8 @@ SSdb *sdbInit(SSdbOpt *pOption) {
taosInitRWLatch(&pSdb->locks[i]);
}
pSdb->curVer = -1;
pSdb->lastCommitVer = -1;
pSdb->pMnode = pOption->pMnode;
mDebug("sdb init successfully");
return pSdb;
@ -162,5 +164,5 @@ static int32_t sdbCreateDir(SSdb *pSdb) {
int64_t sdbUpdateVer(SSdb *pSdb, int32_t val) {
pSdb->curVer += val;
return val;
return pSdb->curVer;
}