From 812f0f97a770a7a14c34bd455f3cf9fa1d8c7ccd Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 15 Dec 2023 10:09:18 +0800 Subject: [PATCH] fix:rollback size to old logic --- source/dnode/vnode/src/tq/tqOffset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tq/tqOffset.c b/source/dnode/vnode/src/tq/tqOffset.c index 21faf19805..f8bf61d4e7 100644 --- a/source/dnode/vnode/src/tq/tqOffset.c +++ b/source/dnode/vnode/src/tq/tqOffset.c @@ -47,6 +47,7 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) { } } + size = htonl(size); void* pMemBuf = taosMemoryCalloc(1, size); if (pMemBuf == NULL) { tqError("vgId:%d failed to restore offset from file, since out of memory, malloc size:%d", vgId, size); @@ -177,7 +178,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) { void* buf = taosMemoryCalloc(1, totLen); void* abuf = POINTER_SHIFT(buf, INT_BYTES); - *(int32_t*)buf = bodyLen; + *(int32_t*)buf = htonl(bodyLen); SEncoder encoder; tEncoderInit(&encoder, abuf, bodyLen); tEncodeSTqOffset(&encoder, pOffset);