fix: add ref log to sync

This commit is contained in:
Shengliang Guan 2022-07-05 11:36:41 +08:00
parent f3bf757282
commit 2daef4ba58
1 changed files with 7 additions and 3 deletions

View File

@ -65,6 +65,7 @@ int32_t syncInit() {
syncCleanUp(); syncCleanUp();
ret = -1; ret = -1;
} else { } else {
sDebug("sync rsetId:%" PRId64 " is open", tsNodeRefId);
ret = syncEnvStart(); ret = syncEnvStart();
} }
} }
@ -77,6 +78,7 @@ void syncCleanUp() {
ASSERT(ret == 0); ASSERT(ret == 0);
if (tsNodeRefId != -1) { if (tsNodeRefId != -1) {
sDebug("sync rsetId:%" PRId64 " is closed", tsNodeRefId);
taosCloseRef(tsNodeRefId); taosCloseRef(tsNodeRefId);
tsNodeRefId = -1; tsNodeRefId = -1;
} }
@ -96,6 +98,7 @@ int64_t syncOpen(const SSyncInfo* pSyncInfo) {
return -1; return -1;
} }
sDebug("vgId:%d, rid:%" PRId64 " is added to rsetId:%" PRId64, pSyncInfo->vgId, pSyncNode->rid, tsNodeRefId);
return pSyncNode->rid; return pSyncNode->rid;
} }
@ -136,13 +139,14 @@ void syncStartStandBy(int64_t rid) {
void syncStop(int64_t rid) { void syncStop(int64_t rid) {
SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid); SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid);
if (pSyncNode == NULL) { if (pSyncNode == NULL) return;
return;
} int32_t vgId = pSyncNode->vgId;
syncNodeClose(pSyncNode); syncNodeClose(pSyncNode);
taosReleaseRef(tsNodeRefId, pSyncNode->rid); taosReleaseRef(tsNodeRefId, pSyncNode->rid);
taosRemoveRef(tsNodeRefId, rid); taosRemoveRef(tsNodeRefId, rid);
sDebug("vgId:%d, rid:%" PRId64 " is removed from rsetId:%" PRId64, vgId, rid, tsNodeRefId);
} }
int32_t syncSetStandby(int64_t rid) { int32_t syncSetStandby(int64_t rid) {