enh: rsma support async commit

This commit is contained in:
Cary Xu 2022-07-14 18:51:34 +08:00
parent 865eb8eff1
commit edfd4b5175
2 changed files with 22 additions and 0 deletions

View File

@ -167,6 +167,7 @@ int32_t smaBegin(SSma* pSma);
int32_t smaPreCommit(SSma* pSma);
int32_t smaCommit(SSma* pSma);
int32_t smaPostCommit(SSma* pSma);
int32_t smaAsyncCommit(SSma* pSma);
int32_t tdProcessTSmaCreate(SSma* pSma, int64_t version, const char* msg);
int32_t tdProcessTSmaInsert(SSma* pSma, int64_t indexUid, const char* msg);

View File

@ -18,6 +18,7 @@
static int32_t tdProcessRSmaPreCommitImpl(SSma *pSma);
static int32_t tdProcessRSmaCommitImpl(SSma *pSma);
static int32_t tdProcessRSmaPostCommitImpl(SSma *pSma);
static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma);
/**
* @brief Only applicable to Rollup SMA
@ -43,6 +44,14 @@ int32_t smaCommit(SSma *pSma) { return tdProcessRSmaCommitImpl(pSma); }
*/
int32_t smaPostCommit(SSma *pSma) { return tdProcessRSmaPostCommitImpl(pSma); }
/**
* @brief Only applicable to Rollup SMA
*
* @param pSma
* @return int32_t
*/
int32_t smaAsyncCommit(SSma *pSma) { return tdProcessRSmaAsyncCommitImpl(pSma); }
/**
* @brief set rsma trigger stat active
*
@ -224,3 +233,15 @@ static int32_t tdProcessRSmaPostCommitImpl(SSma *pSma) {
regfree(&regex);
return TSDB_CODE_SUCCESS;
}
/**
* @brief Rsma async commit implementation
* 1) Wait all running fetch task finish to fetch and put submitMsg into level 2/3 wQueue(blocking level 1 write)
*
* @param pSma
* @return int32_t
*/
static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma) {
// TODO
return TSDB_CODE_SUCCESS;
}