提交 6f2dbd41 编写于 作者: S Shengliang Guan

fix(cluster): crash while create rollup sma

上级 37c8ebc2
......@@ -285,6 +285,7 @@ typedef struct {
int32_t vgVersion;
int8_t hashMethod; // default is 1
SDbCfg cfg;
SRWLatch lock;
} SDbObj;
typedef struct {
......
......@@ -219,10 +219,14 @@ static int32_t mndDbActionDelete(SSdb *pSdb, SDbObj *pDb) {
static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) {
mTrace("db:%s, perform update action, old row:%p new row:%p", pOld->name, pOld, pNew);
taosWLockLatch(&pOld->lock);
SArray *pOldRetensions = pOld->cfg.pRetensions;
pOld->updateTime = pNew->updateTime;
pOld->cfgVersion = pNew->cfgVersion;
pOld->vgVersion = pNew->vgVersion;
memcpy(&pOld->cfg, &pNew->cfg, sizeof(SDbCfg));
pNew->cfg.pRetensions = pOldRetensions;
taosWUnLockLatch(&pOld->lock);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册