Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a2e97d8e
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
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看板
提交
a2e97d8e
编写于
7月 07, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-860]
上级
354f2327
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
26 addition
and
24 deletion
+26
-24
src/dnode/src/dnodeMWrite.c
src/dnode/src/dnodeMWrite.c
+0
-2
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+26
-22
未找到文件。
src/dnode/src/dnodeMWrite.c
浏览文件 @
a2e97d8e
...
...
@@ -140,8 +140,6 @@ void dnodeSendRpcMnodeWriteRsp(void *pMsg, int32_t code) {
return
;
}
if
(
code
>
0
)
return
;
SRpcMsg
rpcRsp
=
{
.
handle
=
pWrite
->
rpcMsg
.
handle
,
.
pCont
=
pWrite
->
rpcRsp
.
rsp
,
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
a2e97d8e
...
...
@@ -244,12 +244,20 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
FORCE_INLINE
static
void
sdbConfirmForward
(
void
*
ahandle
,
void
*
param
,
int32_t
code
)
{
SMnodeMsg
*
pMsg
=
param
;
if
(
code
>
0
)
return
;
if
(
pMsg
)
{
sdbDebug
(
"app:%p:%p, forward request is confirmed, result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
tstrerror
(
code
));
assert
(
param
);
SSdbOper
*
pOper
=
param
;
SMnodeMsg
*
pMsg
=
pOper
->
pMsg
;
if
(
pOper
->
cb
!=
NULL
)
{
sdbDebug
(
"app:%p:%p, is confirmed and will do callback func"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
);
pOper
->
retCode
=
(
*
pOper
->
cb
)(
pMsg
,
code
);
}
dnodeSendRpcMnodeWriteRsp
(
pMsg
,
code
);
dnodeSendRpcMnodeWriteRsp
(
pMsg
,
pOper
->
retCode
);
taosFreeQitem
(
pOper
);
}
void
sdbUpdateSync
()
{
...
...
@@ -529,7 +537,6 @@ static int sdbWrite(void *param, void *data, int type) {
return
code
;
}
// forward to peers, even it is WAL/FWD, it shall be called to update version in sync
void
*
mhandle
=
NULL
;
if
(
pOper
!=
NULL
)
mhandle
=
pOper
->
pMsg
;
...
...
@@ -541,18 +548,19 @@ static int sdbWrite(void *param, void *data, int type) {
tstrerror
(
syncCode
),
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
return
syncCode
;
}
else
if
(
syncCode
>
0
)
{
sdbDebug
(
"table:%s, forward request is sent, result:%s action:%s record:%s version:%"
PRId64
,
pTable
->
tableName
,
tstrerror
(
syncCode
),
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
}
else
{}
sdbDebug
(
"table:%s, forward request is sent, syncCode:%d action:%s record:%s version:%"
PRId64
,
pTable
->
tableName
,
syncCode
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
}
else
{
}
// from app, oper is created
if
(
pOper
!=
NULL
)
{
sdbDebug
(
"table:%s, record from app is disposed,
result:%s
action:%s record:%s version:%"
PRId64
,
pTable
->
tableName
,
tstrerror
(
code
),
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
sdbDebug
(
"table:%s, record from app is disposed, action:%s record:%s version:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
return
syncCode
;
}
else
{
sdbDebug
(
"table:%s, record from wal/fwd is disposed,
result:%s
action:%s record:%s version:%"
PRId64
,
pTable
->
tableName
,
tstrerror
(
code
),
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
sdbDebug
(
"table:%s, record from wal/fwd is disposed, action:%s record:%s version:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
}
// from wal or forward msg, oper not created, should add into hash
...
...
@@ -619,7 +627,7 @@ int32_t sdbInsertRow(SSdbOper *pOper) {
memcpy
(
pNewOper
,
pOper
,
sizeof
(
SSdbOper
));
if
(
pNewOper
->
pMsg
!=
NULL
)
{
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s, insert action is add to sdb queue
,
"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s, insert action is add to sdb queue"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
,
pTable
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
}
...
...
@@ -669,7 +677,7 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
memcpy
(
pNewOper
,
pOper
,
sizeof
(
SSdbOper
));
if
(
pNewOper
->
pMsg
!=
NULL
)
{
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s, delete action is add to sdb queue
,
"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s, delete action is add to sdb queue"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
,
pTable
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
}
...
...
@@ -719,7 +727,7 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
memcpy
(
pNewOper
,
pOper
,
sizeof
(
SSdbOper
));
if
(
pNewOper
->
pMsg
!=
NULL
)
{
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s, update action is add to sdb queue
,
"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s, update action is add to sdb queue"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
,
pTable
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
}
...
...
@@ -964,20 +972,16 @@ static void *sdbWorkerFp(void *param) {
continue
;
}
if
(
pOper
->
cb
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, will do callback func, index:%d"
,
pOper
->
pMsg
->
rpcMsg
.
ahandle
,
pOper
->
pMsg
,
i
);
pOper
->
retCode
=
(
*
pOper
->
cb
)(
pOper
->
pMsg
,
pOper
->
retCode
);
}
dnodeSendRpcMnodeWriteRsp
(
pOper
->
pMsg
,
pOper
->
retCode
);
sdbDecRef
(
pOper
->
table
,
pOper
->
pObj
);
sdbConfirmForward
(
NULL
,
pOper
,
pOper
->
retCode
);
}
else
if
(
type
==
TAOS_QTYPE_FWD
)
{
syncConfirmForward
(
tsSdbObj
.
sync
,
pHead
->
version
,
TSDB_CODE_SUCCESS
);
taosFreeQitem
(
item
);
}
else
{
}
taosFreeQitem
(
item
);
}
}
}
return
NULL
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录