fix: refuse to write when applying progress lagging behind on restored only
This commit is contained in:
parent
66631229eb
commit
8139b725d2
|
@ -54,7 +54,7 @@ int32_t syncLogBufferAppend(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncIndex appliedIndex = pNode->pFsm->FpAppliedIndexCb(pNode->pFsm);
|
SyncIndex appliedIndex = pNode->pFsm->FpAppliedIndexCb(pNode->pFsm);
|
||||||
if (index - appliedIndex >= pBuf->size) {
|
if (pNode->restoreFinish && pBuf->commitIndex - appliedIndex >= pBuf->size) {
|
||||||
terrno = TSDB_CODE_SYN_WRITE_STALL;
|
terrno = TSDB_CODE_SYN_WRITE_STALL;
|
||||||
sError("vgId:%d, failed to append since %s. index:%" PRId64 ", commit-index:%" PRId64 ", applied-index:%" PRId64,
|
sError("vgId:%d, failed to append since %s. index:%" PRId64 ", commit-index:%" PRId64 ", applied-index:%" PRId64,
|
||||||
pNode->vgId, terrstr(), index, pBuf->commitIndex, appliedIndex);
|
pNode->vgId, terrstr(), index, pBuf->commitIndex, appliedIndex);
|
||||||
|
|
Loading…
Reference in New Issue