implement TD-2059

This commit is contained in:
Hongze Cheng 2020-11-11 18:16:53 +08:00
parent 13856ea98c
commit bd5f2641a8
2 changed files with 9 additions and 0 deletions

View File

@ -323,6 +323,7 @@ void tsdbReportStat(void *repo, int64_t *totalPoints, int64_t *totalStorage, int
int tsdbInitCommitQueue(int nthreads);
void tsdbDestroyCommitQueue();
int tsdbSyncCommit(TSDB_REPO_T *repo);
#ifdef __cplusplus
}

View File

@ -278,6 +278,14 @@ int tsdbAsyncCommit(STsdbRepo *pRepo) {
return 0;
}
int tsdbSyncCommit(TSDB_REPO_T *repo) {
STsdbRepo *pRepo = (STsdbRepo *)repo;
tsdbAsyncCommit(pRepo);
sem_wait(&(pRepo->readyToCommit));
sem_post(&(pRepo->readyToCommit));
return 0;
}
/**
* This is an important function to load data or try to load data from memory skiplist iterator.
*