vnode.json
This commit is contained in:
parent
18ef0f7d82
commit
de5aedd8f3
|
@ -272,6 +272,8 @@ SSyncState syncGetState(int64_t rid);
|
||||||
void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet);
|
void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet);
|
||||||
const char* syncStr(ESyncState state);
|
const char* syncStr(ESyncState state);
|
||||||
|
|
||||||
|
SSyncCfg syncNodeGetConfig(int64_t rid);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "vnd.h"
|
#include "vnd.h"
|
||||||
#include "vnodeInt.h"
|
#include "vnodeInt.h"
|
||||||
|
#include "sync.h"
|
||||||
|
|
||||||
extern int32_t tsdbPreCommit(STsdb *pTsdb);
|
extern int32_t tsdbPreCommit(STsdb *pTsdb);
|
||||||
extern int32_t tsdbCommitBegin(STsdb *pTsdb, SCommitInfo *pInfo);
|
extern int32_t tsdbCommitBegin(STsdb *pTsdb, SCommitInfo *pInfo);
|
||||||
|
@ -287,6 +288,8 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) {
|
||||||
|
|
||||||
tsem_wait(&pVnode->canCommit);
|
tsem_wait(&pVnode->canCommit);
|
||||||
|
|
||||||
|
pVnode->config.syncCfg = syncNodeGetConfig(pVnode->sync);
|
||||||
|
|
||||||
pVnode->state.commitTerm = pVnode->state.applyTerm;
|
pVnode->state.commitTerm = pVnode->state.applyTerm;
|
||||||
|
|
||||||
pInfo->info.config = pVnode->config;
|
pInfo->info.config = pVnode->config;
|
||||||
|
|
|
@ -106,6 +106,22 @@ _err:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSyncCfg syncNodeGetConfig(int64_t rid){
|
||||||
|
SSyncNode* pSyncNode = syncNodeAcquire(rid);
|
||||||
|
|
||||||
|
SSyncCfg cfg = {0};
|
||||||
|
if (pSyncNode == NULL) {
|
||||||
|
sError("failed to acquire rid:%" PRId64 " of tsNodeReftId for pSyncNode", rid);
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg = pSyncNode->raftCfg.cfg;
|
||||||
|
|
||||||
|
syncNodeRelease(pSyncNode);
|
||||||
|
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
void syncStop(int64_t rid) {
|
void syncStop(int64_t rid) {
|
||||||
SSyncNode* pSyncNode = syncNodeAcquire(rid);
|
SSyncNode* pSyncNode = syncNodeAcquire(rid);
|
||||||
if (pSyncNode != NULL) {
|
if (pSyncNode != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue