未验证 提交 68f0f2f9 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #8941 from taosdata/hotfix/TS-784-D

[TS-784]<fix>: make sure keep1<=keep2<=keep in tsdb
......@@ -512,6 +512,7 @@ static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg) {
}
// Check keep
#if 0 // already checked and set in mnodeSetDefaultDbCfg
if (pCfg->keep == -1) {
pCfg->keep = TSDB_DEFAULT_KEEP;
} else {
......@@ -532,7 +533,25 @@ static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg) {
if (pCfg->keep2 == 0) {
pCfg->keep2 = pCfg->keep;
}
#endif
int32_t keepMin = pCfg->keep1;
int32_t keepMid = pCfg->keep2;
int32_t keepMax = pCfg->keep;
if (keepMin > keepMid) {
SWAP(keepMin, keepMid, int32_t);
}
if (keepMin > keepMax) {
SWAP(keepMin, keepMax, int32_t);
}
if (keepMid > keepMax) {
SWAP(keepMid, keepMax, int32_t);
}
pCfg->keep = keepMax;
pCfg->keep1 = keepMin;
pCfg->keep2 = keepMid;
// update check
if (pCfg->update < TD_ROW_DISCARD_UPDATE || pCfg->update > TD_ROW_PARTIAL_UPDATE)
pCfg->update = TD_ROW_DISCARD_UPDATE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册