Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
4f012910
T
TDengine
项目概览
~笨蛋陪你哭
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f012910
编写于
12月 23, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2513
上级
833d65f6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
123 addition
and
7 deletion
+123
-7
src/balance/src/bnMain.c
src/balance/src/bnMain.c
+1
-0
src/balance/src/bnThread.c
src/balance/src/bnThread.c
+2
-1
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+5
-5
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
tests/script/jenkins/unique.txt
tests/script/jenkins/unique.txt
+2
-0
tests/script/unique/dnode/offline3.sim
tests/script/unique/dnode/offline3.sim
+111
-0
未找到文件。
src/balance/src/bnMain.c
浏览文件 @
4f012910
...
...
@@ -489,6 +489,7 @@ void bnCheckStatus() {
mInfo
(
"dnode:%d, set to offline state, access seq:%d last seq:%d laststat:%d"
,
pDnode
->
dnodeId
,
tsAccessSquence
,
pDnode
->
lastAccess
,
pDnode
->
status
);
bnSetVgroupOffline
(
pDnode
);
bnStartTimer
(
3000
);
}
}
mnodeDecDnodeRef
(
pDnode
);
...
...
src/balance/src/bnThread.c
浏览文件 @
4f012910
...
...
@@ -104,8 +104,8 @@ static void bnProcessTimer(void *handle, void *tmrId) {
tsBnThread
.
timer
=
NULL
;
tsAccessSquence
++
;
bnCheckStatus
();
bnStartTimer
(
-
1
);
bnCheckStatus
();
if
(
handle
==
NULL
)
{
if
(
tsAccessSquence
%
tsBalanceInterval
==
0
)
{
...
...
@@ -124,6 +124,7 @@ void bnStartTimer(int64_t mseconds) {
bool
updateSoon
=
(
mseconds
!=
-
1
);
if
(
updateSoon
)
{
mTrace
(
"balance function will be called after %"
PRId64
" ms"
,
mseconds
);
taosTmrReset
(
bnProcessTimer
,
mseconds
,
(
void
*
)
mseconds
,
tsMnodeTmr
,
&
tsBnThread
.
timer
);
}
else
{
taosTmrReset
(
bnProcessTimer
,
tsStatusInterval
*
1000
,
NULL
,
tsMnodeTmr
,
&
tsBnThread
.
timer
);
...
...
src/common/src/tglobal.c
浏览文件 @
4f012910
...
...
@@ -543,7 +543,7 @@ static void doInitGlobalConfig(void) {
cfg
.
ptr
=
&
tsOfflineThreshold
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
5
;
cfg
.
minValue
=
3
;
cfg
.
maxValue
=
7200000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_SECOND
;
...
...
src/sync/src/syncMain.c
浏览文件 @
4f012910
...
...
@@ -480,7 +480,7 @@ static void syncFreeNode(void *param) {
SSyncNode
*
pNode
=
param
;
int32_t
refCount
=
atomic_sub_fetch_32
(
&
pNode
->
refCount
,
1
);
sDebug
(
"vgId:%d, snode is freed, refCount:%d"
,
pNode
->
vgId
,
refCount
);
sDebug
(
"vgId:%d, s
ync
node is freed, refCount:%d"
,
pNode
->
vgId
,
refCount
);
pthread_mutex_destroy
(
&
pNode
->
mutex
);
tfree
(
pNode
->
pRecv
);
...
...
@@ -491,10 +491,10 @@ static void syncFreeNode(void *param) {
SSyncNode
*
syncAcquireNode
(
int64_t
rid
)
{
SSyncNode
*
pNode
=
taosAcquireRef
(
tsNodeRefId
,
rid
);
if
(
pNode
==
NULL
)
{
sDebug
(
"failed to acquire snode from refId:%"
PRId64
,
rid
);
sDebug
(
"failed to acquire s
ync
node from refId:%"
PRId64
,
rid
);
}
else
{
int32_t
refCount
=
atomic_add_fetch_32
(
&
pNode
->
refCount
,
1
);
sTrace
(
"vgId:%d, acquire snode refId:%"
PRId64
", refCount:%d"
,
pNode
->
vgId
,
rid
,
refCount
);
sTrace
(
"vgId:%d, acquire s
ync
node refId:%"
PRId64
", refCount:%d"
,
pNode
->
vgId
,
rid
,
refCount
);
}
return
pNode
;
...
...
@@ -502,7 +502,7 @@ SSyncNode *syncAcquireNode(int64_t rid) {
void
syncReleaseNode
(
SSyncNode
*
pNode
)
{
int32_t
refCount
=
atomic_sub_fetch_32
(
&
pNode
->
refCount
,
1
);
sTrace
(
"vgId:%d, dec snode refId:%"
PRId64
" refCount:%d"
,
pNode
->
vgId
,
pNode
->
rid
,
refCount
);
sTrace
(
"vgId:%d, dec s
ync
node refId:%"
PRId64
" refCount:%d"
,
pNode
->
vgId
,
pNode
->
rid
,
refCount
);
taosReleaseRef
(
tsNodeRefId
,
pNode
->
rid
);
}
...
...
@@ -716,8 +716,8 @@ static SSyncPeer *syncCheckMaster(SSyncNode *pNode) {
if
(
onlineNum
<=
replica
*
0
.
5
)
{
if
(
nodeRole
!=
TAOS_SYNC_ROLE_UNSYNCED
)
{
nodeRole
=
TAOS_SYNC_ROLE_UNSYNCED
;
(
*
pNode
->
notifyRole
)(
pNode
->
vgId
,
nodeRole
);
sInfo
(
"vgId:%d, self change to unsynced state, online:%d replica:%d"
,
pNode
->
vgId
,
onlineNum
,
replica
);
(
*
pNode
->
notifyRole
)(
pNode
->
vgId
,
nodeRole
);
}
}
else
{
for
(
int32_t
index
=
0
;
index
<
pNode
->
replica
;
++
index
)
{
...
...
tests/script/jenkins/basic.txt
浏览文件 @
4f012910
...
...
@@ -288,6 +288,7 @@ cd ../../../debug; make
./test.sh -f unique/dnode/data1.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
...
...
tests/script/jenkins/unique.txt
浏览文件 @
4f012910
...
...
@@ -31,6 +31,8 @@ cd ../../../debug; make
./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
...
...
tests/script/unique/dnode/offline3.sim
0 → 100644
浏览文件 @
4f012910
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode1 -c balanceInterval -v 300
system sh/cfg.sh -n dnode2 -c balanceInterval -v 300
system sh/cfg.sh -n dnode3 -c balanceInterval -v 300
system sh/cfg.sh -n dnode4 -c balanceInterval -v 300
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
if $data4_4 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
if $data2_1 != master then
goto step1
endi
print ========== step2
sql create database db replica 3
sql use db
sql create table tb (ts timestamp, value int)
sql insert into tb values (now, 1)
sql insert into tb values (now, 2)
sql show vgroups;
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ========== step2
system sh/exec.sh -n dnode4 -s stop -x SIGINT
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
sql show vgroups;
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data4_1 != ready then
goto step2
endi
if $data4_2 != ready then
goto step2
endi
if $data4_3 != ready then
goto step2
endi
if $data4_4 != null then
goto step2
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录