Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
codyshao
TDengine
提交
6ff5f373
T
TDengine
项目概览
codyshao
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
Star
0
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,发现更多精彩内容 >>
提交
6ff5f373
编写于
5月 02, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some log for sdb
上级
249f54b1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
13 deletion
+18
-13
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+14
-9
tests/script/unique/mnode/mgmt33.sim
tests/script/unique/mnode/mgmt33.sim
+4
-4
未找到文件。
src/mnode/src/mgmtSdb.c
浏览文件 @
6ff5f373
...
...
@@ -212,15 +212,16 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
static
void
sdbConfirmForward
(
void
*
ahandle
,
void
*
param
,
int32_t
code
)
{
tsSdbObj
.
code
=
code
;
sdbTrace
(
"sdb forward request confirmed, result:%s"
,
tstrerror
(
code
));
sem_post
(
&
tsSdbObj
.
sem
);
sdbTrace
(
"forward request confirmed, version:%"
PRIu64
", result:%s"
,
(
int64_t
)
param
,
tstrerror
(
code
));
}
static
int32_t
sdbForwardToPeer
(
voi
d
*
pHead
)
{
static
int32_t
sdbForwardToPeer
(
SWalHea
d
*
pHead
)
{
if
(
tsSdbObj
.
sync
==
NULL
)
return
TSDB_CODE_SUCCESS
;
int32_t
code
=
syncForwardToPeer
(
tsSdbObj
.
sync
,
pHead
,
NULL
);
int32_t
code
=
syncForwardToPeer
(
tsSdbObj
.
sync
,
pHead
,
(
void
*
)
pHead
->
version
);
if
(
code
>
0
)
{
sdbTrace
(
"forward request is sent, version:%"
PRIu64
", result:%s"
,
pHead
->
version
,
tstrerror
(
code
));
sem_wait
(
&
tsSdbObj
.
sem
);
return
tsSdbObj
.
code
;
}
...
...
@@ -332,7 +333,7 @@ void sdbIncRef(void *handle, void *pRow) {
SSdbTable
*
pTable
=
handle
;
int32_t
*
pRefCount
=
(
int32_t
*
)(
pRow
+
pTable
->
refCountPos
);
atomic_add_fetch_32
(
pRefCount
,
1
);
if
(
0
&&
pTable
->
tableId
==
SDB_TABLE_CTABLE
)
{
if
(
0
&&
(
pTable
->
tableId
==
SDB_TABLE_MNODE
||
pTable
->
tableId
==
SDB_TABLE_DNODE
)
)
{
sdbTrace
(
"table:%s, add ref to record:%s:%s:%d"
,
pTable
->
tableName
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pRow
),
*
pRefCount
);
}
...
...
@@ -344,7 +345,7 @@ void sdbDecRef(void *handle, void *pRow) {
SSdbTable
*
pTable
=
handle
;
int32_t
*
pRefCount
=
(
int32_t
*
)(
pRow
+
pTable
->
refCountPos
);
int32_t
refCount
=
atomic_sub_fetch_32
(
pRefCount
,
1
);
if
(
0
&&
pTable
->
tableId
==
SDB_TABLE_CTABLE
)
{
if
(
0
&&
(
pTable
->
tableId
==
SDB_TABLE_MNODE
||
pTable
->
tableId
==
SDB_TABLE_DNODE
)
)
{
sdbTrace
(
"table:%s, def ref of record:%s:%s:%d"
,
pTable
->
tableName
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pRow
),
*
pRefCount
);
}
...
...
@@ -474,14 +475,18 @@ static int sdbWrite(void *param, void *data, int type) {
}
walFsync
(
tsSdbObj
.
wal
);
sdbForwardToPeer
(
pHead
);
code
=
sdbForwardToPeer
(
pHead
);
pthread_mutex_unlock
(
&
tsSdbObj
.
mutex
);
// from app, oper is created
if
(
param
!=
NULL
)
return
code
;
// from wal or forward msg, should create oper
if
(
param
!=
NULL
)
{
//sdbTrace("request from app is disposed, version:%" PRIu64 " code:%s", pHead->version, tstrerror(code));
return
code
;
}
// from wal or forward msg, oper not created, should add into hash
if
(
tsSdbObj
.
sync
!=
NULL
)
{
sdbTrace
(
"forward request is received, version:%"
PRIu64
" result:%s, confirm it"
,
pHead
->
version
,
tstrerror
(
code
));
syncConfirmForward
(
tsSdbObj
.
sync
,
pHead
->
version
,
code
);
}
...
...
tests/script/unique/mnode/mgmt33.sim
浏览文件 @
6ff5f373
...
...
@@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
-t
sql connect
sql show mnodes
...
...
@@ -26,7 +26,7 @@ if $data3_3 != null then
endi
print ============== step2
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
-t
sql create dnode $hostname2
sleep 8000
...
...
@@ -49,7 +49,7 @@ if $dnode3Role != null then
endi
print ============== step3
system sh/exec_up.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
-t
sql create dnode $hostname3
sleep 8000
...
...
@@ -98,7 +98,7 @@ sleep 3000
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
-t
print ============== step5
sql create dnode $hostname2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录