refactor(sync): add syncIsReadyForRead, set error code
This commit is contained in:
parent
a4b54c4f0e
commit
0838afaa18
|
@ -466,6 +466,14 @@ bool syncIsReadyForRead(int64_t rid) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ready) {
|
||||||
|
if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) {
|
||||||
|
terrno = TSDB_CODE_SYN_NOT_LEADER;
|
||||||
|
} else {
|
||||||
|
terrno = TSDB_CODE_APP_NOT_READY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
syncNodeRelease(pSyncNode);
|
syncNodeRelease(pSyncNode);
|
||||||
return ready;
|
return ready;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue