From 514e6ca49f82fbc431a3eba492dfa1edb9198f38 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 19 Jan 2021 06:43:01 +0000 Subject: [PATCH] fix a little bug --- src/tsdb/src/tsdbSync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tsdb/src/tsdbSync.c b/src/tsdb/src/tsdbSync.c index dac0e31e40..953b7ca7b1 100644 --- a/src/tsdb/src/tsdbSync.c +++ b/src/tsdb/src/tsdbSync.c @@ -49,7 +49,7 @@ int tsdbSyncSend(STsdbRepo *pRepo, int socketFd) { tsdbInitSyncH(&synch, pRepo, socketFd); // Disable TSDB commit - sem_post(&(pRepo->readyToCommit)); + sem_wait(&(pRepo->readyToCommit)); if (tsdbSyncSendMeta(&synch) < 0) { tsdbError("vgId:%d failed to send meta file since %s", REPO_ID(pRepo), tstrerror(terrno)); @@ -62,12 +62,12 @@ int tsdbSyncSend(STsdbRepo *pRepo, int socketFd) { } // Enable TSDB commit - sem_wait(&(pRepo->readyToCommit)); + sem_post(&(pRepo->readyToCommit)); tsdbDestroySyncH(&synch); return 0; _err: - sem_wait(&(pRepo->readyToCommit)); + sem_post(&(pRepo->readyToCommit)); tsdbDestroySyncH(&synch); return -1; }