From 8336bbcf27a42f10718e37b595f537729dff2ab8 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sun, 21 Jun 2020 04:11:08 +0000 Subject: [PATCH] fix commit assert error --- src/tsdb/src/tsdbMemTable.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index e928cdc385..2989daad49 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -222,11 +222,12 @@ int tsdbAsyncCommit(STsdbRepo *pRepo) { terrno = TAOS_SYSTEM_ERROR(errno); return -1; } + pRepo->commit = 0; } ASSERT(pRepo->commit == 0); - if (pRepo->appH.notifyStatus) pRepo->appH.notifyStatus(pRepo->appH.appH, TSDB_STATUS_COMMIT_START); if (pRepo->mem != NULL) { + if (pRepo->appH.notifyStatus) pRepo->appH.notifyStatus(pRepo->appH.appH, TSDB_STATUS_COMMIT_START); if (tsdbLockRepo(pRepo) < 0) return -1; pRepo->imem = pRepo->mem; pRepo->mem = NULL; @@ -468,9 +469,6 @@ _err: static void tsdbEndCommit(STsdbRepo *pRepo) { ASSERT(pRepo->commit == 1); - tsdbLockRepo(pRepo); - pRepo->commit = 0; - tsdbUnlockRepo(pRepo); if (pRepo->appH.notifyStatus) pRepo->appH.notifyStatus(pRepo->appH.appH, TSDB_STATUS_COMMIT_OVER); } -- GitLab