From bd8a9769f808acb27aaea842366c74f9194347a7 Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Tue, 14 Jul 2020 03:29:16 +0000 Subject: [PATCH] change the option name to fsync from fsyncPeriod --- src/common/src/tglobal.c | 2 +- src/inc/taosdef.h | 2 +- src/kit/taosmigrate/taosmigrateVnodeCfg.c | 4 ++-- src/vnode/src/vnodeMain.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 00e43ac219..f2324e786a 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -716,7 +716,7 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "fsyncPeriod"; + cfg.option = "fsync"; cfg.ptr = &tsFsyncPeriod; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 5ad409e87e..7696c91bdf 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -334,7 +334,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_MIN_FSYNC_PERIOD 0 #define TSDB_MAX_FSYNC_PERIOD 180000 // millisecond -#define TSDB_DEFAULT_FSYNC_PERIOD 1000 // one second +#define TSDB_DEFAULT_FSYNC_PERIOD 3000 // three second #define TSDB_MIN_DB_REPLICA_OPTION 1 #define TSDB_MAX_DB_REPLICA_OPTION 3 diff --git a/src/kit/taosmigrate/taosmigrateVnodeCfg.c b/src/kit/taosmigrate/taosmigrateVnodeCfg.c index 1a1087aa9d..e830ef78f5 100644 --- a/src/kit/taosmigrate/taosmigrateVnodeCfg.c +++ b/src/kit/taosmigrate/taosmigrateVnodeCfg.c @@ -48,7 +48,7 @@ static int32_t saveVnodeCfg(SVnodeObj *pVnode, char* cfgFile) len += snprintf(content + len, maxLen - len, " \"precision\": %d,\n", pVnode->tsdbCfg.precision); len += snprintf(content + len, maxLen - len, " \"compression\": %d,\n", pVnode->tsdbCfg.compression); len += snprintf(content + len, maxLen - len, " \"walLevel\": %d,\n", pVnode->walCfg.walLevel); - len += snprintf(content + len, maxLen - len, " \"fsyncPeriod\": %d,\n", pVnode->walCfg.fsyncPeriod); + len += snprintf(content + len, maxLen - len, " \"fsync\": %d,\n", pVnode->walCfg.fsyncPeriod); len += snprintf(content + len, maxLen - len, " \"replica\": %d,\n", pVnode->syncCfg.replica); len += snprintf(content + len, maxLen - len, " \"wals\": %d,\n", pVnode->walCfg.wals); len += snprintf(content + len, maxLen - len, " \"quorum\": %d,\n", pVnode->syncCfg.quorum); @@ -213,7 +213,7 @@ static int32_t readVnodeCfg(SVnodeObj *pVnode, char* cfgFile) } pVnode->walCfg.walLevel = (int8_t) walLevel->valueint; - cJSON *fsyncPeriod = cJSON_GetObjectItem(root, "fsyncPeriod"); + cJSON *fsyncPeriod = cJSON_GetObjectItem(root, "fsync"); if (!fsyncPeriod || fsyncPeriod->type != cJSON_Number) { printf("vgId:%d, failed to read vnode cfg, fsyncPeriod not found\n", pVnode->vgId); goto PARSE_OVER; diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 71e7ce438c..49f648b74d 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -619,7 +619,7 @@ static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { len += snprintf(content + len, maxLen - len, " \"precision\": %d,\n", pVnodeCfg->cfg.precision); len += snprintf(content + len, maxLen - len, " \"compression\": %d,\n", pVnodeCfg->cfg.compression); len += snprintf(content + len, maxLen - len, " \"walLevel\": %d,\n", pVnodeCfg->cfg.walLevel); - len += snprintf(content + len, maxLen - len, " \"fsyncPeriod\": %d,\n", pVnodeCfg->cfg.fsyncPeriod); + len += snprintf(content + len, maxLen - len, " \"fsync\": %d,\n", pVnodeCfg->cfg.fsyncPeriod); len += snprintf(content + len, maxLen - len, " \"replica\": %d,\n", pVnodeCfg->cfg.replications); len += snprintf(content + len, maxLen - len, " \"wals\": %d,\n", pVnodeCfg->cfg.wals); len += snprintf(content + len, maxLen - len, " \"quorum\": %d,\n", pVnodeCfg->cfg.quorum); @@ -784,7 +784,7 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { } pVnode->walCfg.walLevel = (int8_t) walLevel->valueint; - cJSON *fsyncPeriod = cJSON_GetObjectItem(root, "fsyncPeriod"); + cJSON *fsyncPeriod = cJSON_GetObjectItem(root, "fsync"); if (!walLevel || walLevel->type != cJSON_Number) { vError("vgId:%d, failed to read vnode cfg, fsyncPeriod not found", pVnode->vgId); goto PARSE_OVER; -- GitLab