diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 268173e7955c5580c584c68d3d37ba94f1932d0c..27f4eeedb2aa5e98c59755c07f388198681e7e22 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -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); return ready; }