enh: propagate code of vnodeSnapRead as terrno upwards
This commit is contained in:
parent
adbf2b5907
commit
d2f8410586
|
@ -285,10 +285,11 @@ static int32_t snapshotSend(SSyncSnapshotSender *pSender) {
|
||||||
pBlk->seq = pSender->seq;
|
pBlk->seq = pSender->seq;
|
||||||
|
|
||||||
// read data
|
// read data
|
||||||
int32_t ret = pSender->pSyncNode->pFsm->FpSnapshotDoRead(pSender->pSyncNode->pFsm, pSender->pReader,
|
code = pSender->pSyncNode->pFsm->FpSnapshotDoRead(pSender->pSyncNode->pFsm, pSender->pReader, &pBlk->pBlock,
|
||||||
&pBlk->pBlock, &pBlk->blockLen);
|
&pBlk->blockLen);
|
||||||
if (ret != 0) {
|
if (code != 0) {
|
||||||
sSError(pSender, "snapshot sender read failed since %s", terrstr());
|
terrno = code;
|
||||||
|
sSError(pSender, "snapshot sender read failed since %s", tstrerror(code));
|
||||||
goto _OUT;
|
goto _OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +358,7 @@ int32_t snapshotReSend(SSyncSnapshotSender *pSender) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSender->seq != SYNC_SNAPSHOT_SEQ_END && pSndBuf->end <= pSndBuf->start) {
|
if (pSender->seq != SYNC_SNAPSHOT_SEQ_END && pSndBuf->end <= pSndBuf->start) {
|
||||||
if (snapshotSend(pSender) != 0) {
|
if ((code = snapshotSend(pSender)) != 0) {
|
||||||
goto _out;
|
goto _out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1188,15 +1189,13 @@ static int32_t syncSnapBufferSend(SSyncSnapshotSender *pSender, SyncSnapshotRsp
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pSender->seq != SYNC_SNAPSHOT_SEQ_END && pSender->seq - pSndBuf->start < tsSnapReplMaxWaitN) {
|
while (pSender->seq != SYNC_SNAPSHOT_SEQ_END && pSender->seq - pSndBuf->start < tsSnapReplMaxWaitN) {
|
||||||
if (snapshotSend(pSender) != 0) {
|
if ((code = snapshotSend(pSender)) != 0) {
|
||||||
code = terrno;
|
|
||||||
goto _out;
|
goto _out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSender->seq == SYNC_SNAPSHOT_SEQ_END && pSndBuf->end <= pSndBuf->start) {
|
if (pSender->seq == SYNC_SNAPSHOT_SEQ_END && pSndBuf->end <= pSndBuf->start) {
|
||||||
if (snapshotSend(pSender) != 0) {
|
if ((code = snapshotSend(pSender)) != 0) {
|
||||||
code = terrno;
|
|
||||||
goto _out;
|
goto _out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1225,7 +1224,7 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, SRpcMsg *pRpcMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!snapshotSenderIsStart(pSender)) {
|
if (!snapshotSenderIsStart(pSender)) {
|
||||||
sSError(pSender, "snapshot sender not started yet. sender startTime:%" PRId64 ", msg startTime:%" PRId64,
|
sSError(pSender, "snapshot sender stopped. sender startTime:%" PRId64 ", msg startTime:%" PRId64,
|
||||||
pSender->startTime, pMsg->startTime);
|
pSender->startTime, pMsg->startTime);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue