enh(sync) add syncIsRestoreFinish
This commit is contained in:
parent
43f2a51e4b
commit
c7691590be
|
@ -146,6 +146,7 @@ int32_t syncGetVgId(int64_t rid);
|
||||||
int32_t syncPropose(int64_t rid, const SRpcMsg* pMsg, bool isWeak);
|
int32_t syncPropose(int64_t rid, const SRpcMsg* pMsg, bool isWeak);
|
||||||
bool syncEnvIsStart();
|
bool syncEnvIsStart();
|
||||||
const char* syncStr(ESyncState state);
|
const char* syncStr(ESyncState state);
|
||||||
|
bool syncIsRestoreFinish(int64_t rid);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,18 @@ ESyncState syncGetMyRole(int64_t rid) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool syncIsRestoreFinish(int64_t rid) {
|
||||||
|
SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid);
|
||||||
|
if (pSyncNode == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
assert(rid == pSyncNode->rid);
|
||||||
|
bool b = pSyncNode->restoreFinish;
|
||||||
|
|
||||||
|
taosReleaseRef(tsNodeRefId, pSyncNode->rid);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
const char* syncGetMyRoleStr(int64_t rid) {
|
const char* syncGetMyRoleStr(int64_t rid) {
|
||||||
const char* s = syncUtilState2String(syncGetMyRole(rid));
|
const char* s = syncUtilState2String(syncGetMyRole(rid));
|
||||||
return s;
|
return s;
|
||||||
|
|
Loading…
Reference in New Issue