Skip to content

Commit 50819c4

Browse files
authored
Merge pull request #19852 from taosdata/FIX/TD-22184-main
enh: return error on unexpected snapshot msg
2 parents b7549bd + 9b522ce commit 50819c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/dnode/vnode/src/vnd/vnodeSnapshot.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,13 @@ int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData) {
426426
SVnode *pVnode = pWriter->pVnode;
427427

428428
ASSERT(pHdr->size + sizeof(SSnapDataHdr) == nData);
429-
ASSERT(pHdr->index == pWriter->index + 1);
429+
430+
if (pHdr->index != pWriter->index + 1) {
431+
vError("vgId:%d, unexpected vnode snapshot msg. index:%" PRId64 ", expected index:%" PRId64, TD_VID(pVnode),
432+
pHdr->index, pWriter->index + 1);
433+
return -1;
434+
}
435+
430436
pWriter->index = pHdr->index;
431437

432438
vDebug("vgId:%d, vnode snapshot write data, index:%" PRId64 " type:%d blockLen:%d", TD_VID(pVnode), pHdr->index,

0 commit comments

Comments
 (0)