From c4898bffd8d9c4f718bf2aa798bfe9474c042dd6 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 7 Sep 2023 15:23:00 +0800 Subject: [PATCH 1/2] fix:[TS-3922] make SStreamObj->->currentTick aligned by 8 --- source/dnode/mnode/impl/inc/mndDef.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 1bf13c8fb5..60f5683488 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -664,9 +664,15 @@ typedef struct SStreamConf { } SStreamConf; typedef struct { - char name[TSDB_STREAM_FNAME_LEN]; // ctl SRWLatch lock; + + // 3.0.20 + int64_t checkpointFreq; // ms + int64_t currentTick; // do not serialize + int64_t deleteMark; + int8_t igCheckUpdate; + // create info int64_t createTime; int64_t updateTime; @@ -701,11 +707,7 @@ typedef struct { SSchemaWrapper outputSchema; SSchemaWrapper tagSchema; - // 3.0.20 - int64_t checkpointFreq; // ms - int64_t currentTick; // do not serialize - int64_t deleteMark; - int8_t igCheckUpdate; + char name[TSDB_STREAM_FNAME_LEN]; // 3.0.5. int64_t checkpointId; From 842bb5742a95a3ca3c3a74696a113f16f137c334 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 7 Sep 2023 19:26:33 +0800 Subject: [PATCH 2/2] fix:[TS-3922]rollback because cases failed & avoid atomic_store_64 core if parameters not aligned by 8 --- source/dnode/mnode/impl/inc/mndDef.h | 13 ++++++------- source/dnode/mnode/impl/src/mndStream.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 60f5683488..0aff654f36 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -664,15 +664,10 @@ typedef struct SStreamConf { } SStreamConf; typedef struct { + char name[TSDB_STREAM_FNAME_LEN]; // ctl SRWLatch lock; - // 3.0.20 - int64_t checkpointFreq; // ms - int64_t currentTick; // do not serialize - int64_t deleteMark; - int8_t igCheckUpdate; - // create info int64_t createTime; int64_t updateTime; @@ -707,7 +702,11 @@ typedef struct { SSchemaWrapper outputSchema; SSchemaWrapper tagSchema; - char name[TSDB_STREAM_FNAME_LEN]; + // 3.0.20 + int64_t checkpointFreq; // ms + int64_t currentTick; // do not serialize + int64_t deleteMark; + int8_t igCheckUpdate; // 3.0.5. int64_t checkpointId; diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 66acbcc05b..1c36f898c5 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -1111,7 +1111,7 @@ static int32_t mndAddStreamCheckpointToTrans(STrans *pTrans, SStreamObj *pStream pStream->checkpointId = checkpointId; pStream->checkpointFreq = taosGetTimestampMs(); - atomic_store_64(&pStream->currentTick, 0); + pStream->currentTick = 0; // 3. commit log: stream checkpoint info pStream->version = pStream->version + 1;