Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bbe7e12e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bbe7e12e
编写于
10月 17, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: supports online alter DB parameter minRows
上级
e13e611d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
1977 addition
and
1582 deletion
+1977
-1582
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+2
-2
src/query/inc/sql.y
src/query/inc/sql.y
+1
-0
src/query/src/sql.c
src/query/src/sql.c
+1958
-1571
src/tsdb/src/tsdbCommitQueue.c
src/tsdb/src/tsdbCommitQueue.c
+7
-4
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+9
-5
未找到文件。
src/mnode/src/mnodeDb.c
浏览文件 @
bbe7e12e
...
...
@@ -1014,8 +1014,8 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) {
}
if
(
minRows
>
0
&&
minRows
!=
pDb
->
cfg
.
minRowsPerFileBlock
)
{
m
Error
(
"db:%s, can't alter minRows option"
,
pDb
->
name
);
terrno
=
TSDB_CODE_MND_INVALID_DB_OPTION
;
m
Debug
(
"db:%s, minRows:%d change to %d"
,
pDb
->
name
,
pDb
->
cfg
.
minRowsPerFileBlock
,
minRows
);
newCfg
.
minRowsPerFileBlock
=
minRows
;
}
if
(
maxRows
>
0
&&
maxRows
!=
pDb
->
cfg
.
maxRowsPerFileBlock
)
{
...
...
src/query/inc/sql.y
浏览文件 @
bbe7e12e
...
...
@@ -311,6 +311,7 @@ alter_db_optr(Y) ::= alter_db_optr(Z) blocks(X). { Y = Z; Y.numOfBlocks = s
alter_db_optr(Y) ::= alter_db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) update(X). { Y = Z; Y.update = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) cachelast(X). { Y = Z; Y.cachelast = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) minrows(X). { Y = Z; Y.minRowsPerBlock = strtol(X.z, NULL, 10); }
// dynamically update the following two parameters are not allowed.
//alter_db_optr(Y) ::= alter_db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z, NULL, 10); }
...
...
src/query/src/sql.c
浏览文件 @
bbe7e12e
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/tsdb/src/tsdbCommitQueue.c
浏览文件 @
bbe7e12e
...
...
@@ -132,13 +132,16 @@ static void tsdbApplyRepoConfig(STsdbRepo *pRepo) {
pRepo
->
config
.
keep2
=
pRepo
->
save_config
.
keep2
;
pRepo
->
config
.
cacheLastRow
=
pRepo
->
save_config
.
cacheLastRow
;
pRepo
->
config
.
totalBlocks
=
pRepo
->
save_config
.
totalBlocks
;
pRepo
->
config
.
minRowsPerFileBlock
=
pRepo
->
save_config
.
minRowsPerFileBlock
;
pthread_mutex_unlock
(
&
pRepo
->
save_mutex
);
tsdbInfo
(
"vgId:%d apply new config: compression(%d), keep(%d,%d,%d), totalBlocks(%d), cacheLastRow(%d->%d),totalBlocks(%d->%d)"
,
REPO_ID
(
pRepo
),
pSaveCfg
->
compression
,
pSaveCfg
->
keep
,
pSaveCfg
->
keep1
,
pSaveCfg
->
keep2
,
pSaveCfg
->
totalBlocks
,
oldCfg
.
cacheLastRow
,
pSaveCfg
->
cacheLastRow
,
oldTotalBlocks
,
pSaveCfg
->
totalBlocks
);
tsdbInfo
(
"vgId:%d apply new config: "
"compression(%d),keep(%d,%d,%d),totalBlocks(%d),cacheLastRow(%d->%d),totalBlocks(%d->%d),minRows(%d->%d)"
,
REPO_ID
(
pRepo
),
pSaveCfg
->
compression
,
pSaveCfg
->
keep
,
pSaveCfg
->
keep1
,
pSaveCfg
->
keep2
,
pSaveCfg
->
totalBlocks
,
oldCfg
.
cacheLastRow
,
pSaveCfg
->
cacheLastRow
,
oldTotalBlocks
,
pSaveCfg
->
totalBlocks
,
oldCfg
.
minRowsPerFileBlock
,
pSaveCfg
->
minRowsPerFileBlock
);
int
err
=
tsdbExpandPool
(
pRepo
,
oldTotalBlocks
);
if
(
!
TAOS_SUCCEEDED
(
err
))
{
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
bbe7e12e
...
...
@@ -233,7 +233,7 @@ int32_t tsdbConfigRepo(STsdbRepo *repo, STsdbCfg *pCfg) {
ASSERT
(
pRCfg
->
tsdbId
==
pCfg
->
tsdbId
);
ASSERT
(
pRCfg
->
cacheBlockSize
==
pCfg
->
cacheBlockSize
);
ASSERT
(
pRCfg
->
daysPerFile
==
pCfg
->
daysPerFile
);
ASSERT
(
pRCfg
->
minRowsPerFileBlock
==
pCfg
->
minRowsPerFileBlock
);
//
ASSERT(pRCfg->minRowsPerFileBlock == pCfg->minRowsPerFileBlock);
ASSERT
(
pRCfg
->
maxRowsPerFileBlock
==
pCfg
->
maxRowsPerFileBlock
);
ASSERT
(
pRCfg
->
precision
==
pCfg
->
precision
);
...
...
@@ -256,6 +256,9 @@ int32_t tsdbConfigRepo(STsdbRepo *repo, STsdbCfg *pCfg) {
if
(
pRCfg
->
totalBlocks
!=
pCfg
->
totalBlocks
)
{
configChanged
=
true
;
}
if
(
pRCfg
->
minRowsPerFileBlock
!=
pCfg
->
minRowsPerFileBlock
)
{
configChanged
=
true
;
}
if
(
!
configChanged
)
{
tsdbError
(
"vgId:%d no config changed"
,
REPO_ID
(
repo
));
...
...
@@ -277,15 +280,16 @@ int32_t tsdbConfigRepo(STsdbRepo *repo, STsdbCfg *pCfg) {
pSaveCfg
->
keep2
=
pCfg
->
keep2
;
pSaveCfg
->
cacheLastRow
=
pCfg
->
cacheLastRow
;
pSaveCfg
->
totalBlocks
=
pCfg
->
totalBlocks
;
pSaveCfg
->
minRowsPerFileBlock
=
pCfg
->
minRowsPerFileBlock
;
tsdbInfo
(
"vgId:%d old config: compression(%d),
keep(%d,%d,%d), cacheLastRow(%d),totalBlock
s(%d)"
,
tsdbInfo
(
"vgId:%d old config: compression(%d),
keep(%d,%d,%d),cacheLastRow(%d),totalBlocks(%d),minRow
s(%d)"
,
REPO_ID
(
repo
),
pRCfg
->
compression
,
pRCfg
->
keep
,
pRCfg
->
keep1
,
pRCfg
->
keep2
,
pRCfg
->
cacheLastRow
,
pRCfg
->
totalBlocks
);
tsdbInfo
(
"vgId:%d new config: compression(%d),
keep(%d,%d,%d), cacheLastRow(%d),totalBlock
s(%d)"
,
pRCfg
->
cacheLastRow
,
pRCfg
->
totalBlocks
,
pRCfg
->
minRowsPerFileBlock
);
tsdbInfo
(
"vgId:%d new config: compression(%d),
keep(%d,%d,%d),cacheLastRow(%d),totalBlocks(%d),minRow
s(%d)"
,
REPO_ID
(
repo
),
pSaveCfg
->
compression
,
pSaveCfg
->
keep
,
pSaveCfg
->
keep1
,
pSaveCfg
->
keep2
,
pSaveCfg
->
cacheLastRow
,
pSaveCfg
->
totalBlocks
);
pSaveCfg
->
cacheLastRow
,
pSaveCfg
->
totalBlocks
,
pSaveCfg
->
minRowsPerFileBlock
);
repo
->
config_changed
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录