diff --git a/source/dnode/vnode/src/inc/sma.h b/source/dnode/vnode/src/inc/sma.h index a4233e1ac4..1489b02492 100644 --- a/source/dnode/vnode/src/inc/sma.h +++ b/source/dnode/vnode/src/inc/sma.h @@ -179,8 +179,9 @@ typedef struct STFile STFile; struct STFInfo { uint32_t magic; + uint32_t ftype; uint32_t fver; - uint64_t size; + uint64_t fsize; }; struct STFile { diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 8576c9ca43..3c2f710fa7 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -708,5 +708,5 @@ static void tdRSmaPersistTrigger(void *param, void *tmrId) { taosGetSelfPthreadId()); } - taosTmrReset(tdRSmaPersistTrigger, 5000, pRSmaStat, pRSmaStat->tmrHandle, &pRSmaStat->tmrId); + taosTmrReset(tdRSmaPersistTrigger, 3600000, pRSmaStat, pRSmaStat->tmrHandle, &pRSmaStat->tmrId); } \ No newline at end of file diff --git a/source/dnode/vnode/src/sma/smaUtil.c b/source/dnode/vnode/src/sma/smaUtil.c index 77e85d3227..76690a3bde 100644 --- a/source/dnode/vnode/src/sma/smaUtil.c +++ b/source/dnode/vnode/src/sma/smaUtil.c @@ -30,16 +30,18 @@ static int32_t tdEncodeTFInfo(void **buf, STFInfo *pInfo) { int32_t tlen = 0; tlen += taosEncodeFixedU32(buf, pInfo->magic); + tlen += taosEncodeFixedU32(buf, pInfo->ftype); tlen += taosEncodeFixedU32(buf, pInfo->fver); - tlen += taosEncodeFixedU64(buf, pInfo->size); + tlen += taosEncodeFixedU64(buf, pInfo->fsize); return tlen; } static void *tdDecodeTFInfo(void *buf, STFInfo *pInfo) { buf = taosDecodeFixedU32(buf, &(pInfo->magic)); + buf = taosDecodeFixedU32(buf, &(pInfo->ftype)); buf = taosDecodeFixedU32(buf, &(pInfo->fver)); - buf = taosDecodeFixedU64(buf, &(pInfo->size)); + buf = taosDecodeFixedU64(buf, &(pInfo->fsize)); return buf; } @@ -134,7 +136,7 @@ int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset) return -1; } - ASSERT(pTFile->info.size == toffset); + ASSERT(pTFile->info.fsize == toffset); if (offset) { *offset = toffset; @@ -144,7 +146,7 @@ int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset) return -1; } - pTFile->info.size += nbyte; + pTFile->info.fsize += nbyte; return nbyte; } @@ -193,7 +195,7 @@ int32_t tdInitTFile(STFile *pTFile, STfs *pTfs, const char *fname) { } int32_t tdCreateTFile(STFile *pTFile, STfs *pTfs, bool updateHeader, int8_t fType) { - ASSERT(pTFile->info.size == 0 && pTFile->info.magic == TD_FILE_INIT_MAGIC); + ASSERT(pTFile->info.fsize == 0 && pTFile->info.magic == TD_FILE_INIT_MAGIC); pTFile->pFile = taosOpenFile(TD_FILE_FULL_NAME(pTFile), TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (pTFile->pFile == NULL) { @@ -221,7 +223,7 @@ int32_t tdCreateTFile(STFile *pTFile, STfs *pTfs, bool updateHeader, int8_t fTyp return 0; } - pTFile->info.size += TD_FILE_HEAD_SIZE; + pTFile->info.fsize += TD_FILE_HEAD_SIZE; pTFile->info.fver = 0; if (tdUpdateTFileHeader(pTFile) < 0) {