From 5f70d7b241908fc6e4fd9ffda468c955c111d47c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 4 Jan 2022 01:39:48 -0800 Subject: [PATCH] minor changes --- source/dnode/mnode/impl/test/trans/trans.cpp | 18 +++++++++--------- source/dnode/mnode/sdb/src/sdb.c | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/dnode/mnode/impl/test/trans/trans.cpp b/source/dnode/mnode/impl/test/trans/trans.cpp index 1400ad897f..1be38b3289 100644 --- a/source/dnode/mnode/impl/test/trans/trans.cpp +++ b/source/dnode/mnode/impl/test/trans/trans.cpp @@ -1,5 +1,5 @@ /** - * @file user.cpp + * @file trans.cpp * @author slguan (slguan@taosdata.com) * @brief MNODE module trans tests * @version 1.0 @@ -75,12 +75,12 @@ TEST_F(DndTestTrans, 01_CreateUser_Crash) { test.SendShowRetrieveMsg(); EXPECT_EQ(test.GetShowRows(), 2); - // CheckBinary("root", TSDB_USER_LEN); - // CheckBinary("u2", TSDB_USER_LEN); - // CheckBinary("super", 10); - // CheckBinary("normal", 10); - // CheckTimestamp(); - // CheckTimestamp(); - // CheckBinary("root", TSDB_USER_LEN); - // CheckBinary("root", TSDB_USER_LEN); + CheckBinary("root", TSDB_USER_LEN); + CheckBinary("u2", TSDB_USER_LEN); + CheckBinary("super", 10); + CheckBinary("normal", 10); + CheckTimestamp(); + CheckTimestamp(); + CheckBinary("root", TSDB_USER_LEN); + CheckBinary("root", TSDB_USER_LEN); } \ No newline at end of file diff --git a/source/dnode/mnode/sdb/src/sdb.c b/source/dnode/mnode/sdb/src/sdb.c index ef5bb6f16f..39b5bb4d5b 100644 --- a/source/dnode/mnode/sdb/src/sdb.c +++ b/source/dnode/mnode/sdb/src/sdb.c @@ -64,8 +64,9 @@ SSdb *sdbInit(SSdbOpt *pOption) { void sdbCleanup(SSdb *pSdb) { mDebug("start to cleanup sdb"); - if (pSdb->curVer != pSdb->lastCommitVer) { - mDebug("write sdb file for current ver:%" PRId64 " != last commit ver:%" PRId64, pSdb->curVer, pSdb->lastCommitVer); + if (pSdb->curVer > pSdb->lastCommitVer) { + mDebug("write sdb file for current ver:%" PRId64 " larger than last commit ver:%" PRId64, pSdb->curVer, + pSdb->lastCommitVer); sdbWriteFile(pSdb); } -- GitLab