Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
96434756
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
96434756
编写于
6月 20, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: save sdb file on needed
上级
3155a228
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
28 deletion
+12
-28
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-1
source/dnode/mnode/impl/src/mndSync.c
source/dnode/mnode/impl/src/mndSync.c
+2
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+3
-3
source/dnode/mnode/sdb/inc/sdb.h
source/dnode/mnode/sdb/inc/sdb.h
+1
-1
source/dnode/mnode/sdb/src/sdb.c
source/dnode/mnode/sdb/src/sdb.c
+5
-1
tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim
...ipt/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim
+0
-21
未找到文件。
source/common/src/tglobal.c
浏览文件 @
96434756
...
...
@@ -185,7 +185,7 @@ char tsCompressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPR
bool
tsStartUdfd
=
true
;
// internal
int32_t
tsTransPullupInterval
=
6
;
int32_t
tsTransPullupInterval
=
2
;
int32_t
tsMqRebalanceInterval
=
2
;
void
taosAddDataDir
(
int32_t
index
,
char
*
v1
,
int32_t
level
,
int32_t
primary
)
{
...
...
source/dnode/mnode/impl/src/mndSync.c
浏览文件 @
96434756
...
...
@@ -68,8 +68,9 @@ void mndSyncCommitMsg(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cbM
mndTransExecute
(
pMnode
,
pTrans
);
mndReleaseTrans
(
pMnode
,
pTrans
);
}
#if 0
sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
#endif
}
}
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
96434756
...
...
@@ -804,7 +804,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
sendRsp
=
true
;
}
}
else
{
if
(
pTrans
->
stage
==
TRN_STAGE_REDO_ACTION
&&
pTrans
->
failedTimes
>
2
)
{
if
(
pTrans
->
stage
==
TRN_STAGE_REDO_ACTION
&&
pTrans
->
failedTimes
>
3
)
{
if
(
code
==
0
)
code
=
TSDB_CODE_MND_TRANS_UNKNOW_ERROR
;
sendRsp
=
true
;
}
...
...
@@ -1127,6 +1127,7 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
}
if
(
code
==
0
)
{
pTrans
->
failedTimes
=
0
;
pTrans
->
lastAction
=
action
;
pTrans
->
lastMsgType
=
0
;
pTrans
->
lastErrorNo
=
0
;
...
...
@@ -1430,8 +1431,7 @@ void mndTransPullup(SMnode *pMnode) {
mndReleaseTrans
(
pMnode
,
pTrans
);
}
// todo, set to SDB_WRITE_DELTA
sdbWriteFile
(
pMnode
->
pSdb
,
0
);
sdbWriteFile
(
pMnode
->
pSdb
,
SDB_WRITE_DELTA
);
taosArrayDestroy
(
pArray
);
}
...
...
source/dnode/mnode/sdb/inc/sdb.h
浏览文件 @
96434756
...
...
@@ -37,7 +37,7 @@ extern "C" {
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
// clang-format on
#define SDB_WRITE_DELTA
10
0
#define SDB_WRITE_DELTA
2
0
#define SDB_GET_VAL(pData, dataPos, val, pos, func, type) \
{ \
...
...
source/dnode/mnode/sdb/src/sdb.c
浏览文件 @
96434756
...
...
@@ -161,9 +161,11 @@ static int32_t sdbCreateDir(SSdb *pSdb) {
}
void
sdbSetApplyInfo
(
SSdb
*
pSdb
,
int64_t
index
,
int64_t
term
,
int64_t
config
)
{
mTrace
(
"mnode apply info changed, from index:%"
PRId64
" term:%"
PRId64
" config:%"
PRId64
", to index:%"
PRId64
#if 1
mTrace
(
"mnode apply info changed from index:%"
PRId64
" term:%"
PRId64
" config:%"
PRId64
" to index:%"
PRId64
" term:%"
PRId64
" config:%"
PRId64
,
pSdb
->
applyIndex
,
pSdb
->
applyTerm
,
pSdb
->
applyConfig
,
index
,
term
,
config
);
#endif
pSdb
->
applyIndex
=
index
;
pSdb
->
applyTerm
=
term
;
pSdb
->
applyConfig
=
config
;
...
...
@@ -173,7 +175,9 @@ void sdbGetCommitInfo(SSdb *pSdb, int64_t *index, int64_t *term, int64_t *config
*
index
=
pSdb
->
commitIndex
;
*
term
=
pSdb
->
commitTerm
;
*
config
=
pSdb
->
commitConfig
;
#if 0
mTrace("mnode current info, apply index:%" PRId64 " term:%" PRId64 " config:%" PRId64 ", commit index:%" PRId64
" term:%" PRId64 " config:%" PRId64,
pSdb->applyIndex, pSdb->applyTerm, pSdb->applyConfig, *index, *term, *config);
#endif
}
tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim
浏览文件 @
96434756
...
...
@@ -53,31 +53,10 @@ endi
if $data(4)[4] != ready then
goto step1
endi
#if $data(5)[4] != ready then
# goto step1
#endi
print =============== step2: create db
sql create database d1 vgroups 1 replica 3
# dnode not exist
sql_error redistribute vgroup 3 dnode 6 dnode 3 dnode 4
# vgroup not exist
sql_error redistribute vgroup 3 dnode 5 dnode 3 dnode 4
# un changed
sql_error redistribute vgroup 2 dnode 2 dnode 3 dnode 4
# no enought vnodes
sql_error redistribute vgroup 2 dnode 1 dnode 3 dnode 4
# offline vnodes
sql_error redistribute vgroup 2 dnode 5 dnode 3 dnode 4
# Invalid replica
sql_error redistribute vgroup 2 dnode 5
sql_error redistribute vgroup 2 dnode 5 dnode 3
sql_error redistribute vgroup 2 dnode 2 dnode 3
sql_error redistribute vgroup 2 dnode 2 dnode 2
sql_error redistribute vgroup 3 dnode 2 dnode 2
sql_error redistribute vgroup 2 dnode 2 dnode 2 dnode 3
system sh/exec.sh -n dnode5 -s start
$x = 0
step2:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录