提交 a2459fae 编写于 作者: C Cary Xu

add walFlushSize

上级 9ef3fce1
......@@ -110,6 +110,7 @@ extern int8_t tsCacheLastRow;
//tsdb
extern bool tsdbForceKeepFile;
extern int32_t tsdbWalFlushSize;
// balance
extern int8_t tsEnableBalance;
......
......@@ -156,6 +156,7 @@ int32_t tsTsdbMetaCompactRatio = TSDB_META_COMPACT_RATIO;
// tsdb config
// For backward compatibility
bool tsdbForceKeepFile = false;
int32_t tsdbWalFlushSize = TSDB_DEFAULT_WAL_FLUSH_SIZE; // [0,10000000] MB
// balance
int8_t tsEnableBalance = 1;
......@@ -1651,6 +1652,17 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
// flush vnode wal file if walSize >= walFlushSize and walSize >= cache*blocks*0.5
cfg.option = "walFlushSize";
cfg.ptr = &tsdbWalFlushSize;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = TSDB_MIN_WAL_FLUSH_SIZE;
cfg.maxValue = TSDB_MAX_WAL_FLUSH_SIZE;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_MB;
taosInitConfigOption(cfg);
#ifdef TD_TSZ
// lossy compress
cfg.option = "lossyColumns";
......
......@@ -278,6 +278,10 @@ do { \
#define TSDB_MAX_TOTAL_BLOCKS 10000
#define TSDB_DEFAULT_TOTAL_BLOCKS 6
#define TSDB_MIN_WAL_FLUSH_SIZE 0
#define TSDB_MAX_WAL_FLUSH_SIZE 10000000
#define TSDB_DEFAULT_WAL_FLUSH_SIZE 1024 // 1024MB
#define TSDB_MIN_TABLES 4
#define TSDB_MAX_TABLES 10000000
#define TSDB_DEFAULT_TABLES 1000000
......
......@@ -20,7 +20,7 @@
extern "C" {
#endif
#define TSDB_CFG_MAX_NUM 124
#define TSDB_CFG_MAX_NUM 125
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册