Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
521ae131
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看板
提交
521ae131
编写于
11月 28, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2266
上级
a9f53e2f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
40 deletion
+32
-40
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+2
-2
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+18
-0
src/mnode/src/mnodePeer.c
src/mnode/src/mnodePeer.c
+2
-10
src/mnode/src/mnodeRead.c
src/mnode/src/mnodeRead.c
+3
-12
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+5
-4
src/mnode/src/mnodeWrite.c
src/mnode/src/mnodeWrite.c
+2
-12
未找到文件。
src/dnode/src/dnodeMgmt.c
浏览文件 @
521ae131
...
...
@@ -444,12 +444,12 @@ static int32_t dnodeProcessCreateMnodeMsg(SRpcMsg *pMsg) {
SCreateMnodeMsg
*
pCfg
=
pMsg
->
pCont
;
pCfg
->
dnodeId
=
htonl
(
pCfg
->
dnodeId
);
if
(
pCfg
->
dnodeId
!=
dnodeGetDnodeId
())
{
d
Error
(
"dnodeId:%d, in create mnode msg is not equal with saved dnodeId:%d"
,
pCfg
->
dnodeId
,
dnodeGetDnodeId
());
d
Debug
(
"dnodeId:%d, in create mnode msg is not equal with saved dnodeId:%d"
,
pCfg
->
dnodeId
,
dnodeGetDnodeId
());
return
TSDB_CODE_MND_DNODE_ID_NOT_CONFIGURED
;
}
if
(
strcmp
(
pCfg
->
dnodeEp
,
tsLocalEp
)
!=
0
)
{
d
Error
(
"dnodeEp:%s, in create mnode msg is not equal with saved dnodeEp:%s"
,
pCfg
->
dnodeEp
,
tsLocalEp
);
d
Debug
(
"dnodeEp:%s, in create mnode msg is not equal with saved dnodeEp:%s"
,
pCfg
->
dnodeEp
,
tsLocalEp
);
return
TSDB_CODE_MND_DNODE_EP_NOT_CONFIGURED
;
}
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
521ae131
...
...
@@ -251,12 +251,30 @@ void mnodeGetMnodeEpSetForPeer(SRpcEpSet *epSet) {
mnodeMnodeRdLock
();
*
epSet
=
tsMnodeEpSetForPeer
;
mnodeMnodeUnLock
();
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfEps
;
++
i
)
{
if
(
strcmp
(
epSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
htons
(
epSet
->
port
[
i
])
==
tsServerPort
+
TSDB_PORT_DNODEDNODE
)
{
epSet
->
inUse
=
(
i
+
1
)
%
epSet
->
numOfEps
;
mTrace
(
"mnode:%d, for peer ep:%s:%u, set inUse to %d"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]),
epSet
->
inUse
);
}
else
{
mTrace
(
"mpeer:%d, for peer ep:%s:%u"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]));
}
}
}
void
mnodeGetMnodeEpSetForShell
(
SRpcEpSet
*
epSet
)
{
mnodeMnodeRdLock
();
*
epSet
=
tsMnodeEpSetForShell
;
mnodeMnodeUnLock
();
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfEps
;
++
i
)
{
if
(
strcmp
(
epSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
htons
(
epSet
->
port
[
i
])
==
tsServerPort
)
{
epSet
->
inUse
=
(
i
+
1
)
%
epSet
->
numOfEps
;
mTrace
(
"mnode:%d, for shell ep:%s:%u, set inUse to %d"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]),
epSet
->
inUse
);
}
else
{
mTrace
(
"mnode:%d, for shell ep:%s:%u"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]));
}
}
}
char
*
mnodeGetMnodeMasterEp
()
{
...
...
src/mnode/src/mnodePeer.c
浏览文件 @
521ae131
...
...
@@ -58,16 +58,8 @@ int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg) {
rpcRsp
->
rsp
=
epSet
;
rpcRsp
->
len
=
sizeof
(
SRpcEpSet
);
mDebug
(
"msg:%p, ahandle:%p type:%s in mpeer queue will be redirected, numOfEps:%d inUse:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
epSet
->
numOfEps
,
epSet
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfEps
;
++
i
)
{
if
(
strcmp
(
epSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
htons
(
epSet
->
port
[
i
])
==
tsServerPort
+
TSDB_PORT_DNODEDNODE
)
{
epSet
->
inUse
=
(
i
+
1
)
%
epSet
->
numOfEps
;
mDebug
(
"mpeer:%d ep:%s:%u, set inUse to %d"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]),
epSet
->
inUse
);
}
else
{
mDebug
(
"mpeer:%d ep:%s:%u"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]));
}
}
mDebug
(
"msg:%p, ahandle:%p type:%s in mpeer queue is redirected, numOfEps:%d inUse:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
epSet
->
numOfEps
,
epSet
->
inUse
);
return
TSDB_CODE_RPC_REDIRECT
;
}
...
...
src/mnode/src/mnodeRead.c
浏览文件 @
521ae131
...
...
@@ -51,21 +51,12 @@ int32_t mnodeProcessRead(SMnodeMsg *pMsg) {
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SRpcEpSet
*
epSet
=
rpcMallocCont
(
sizeof
(
SRpcEpSet
));
mnodeGetMnodeEpSetForShell
(
epSet
);
mDebug
(
"msg:%p, app:%p type:%s in mread queue will be redirected, numOfEps:%d inUse:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
epSet
->
numOfEps
,
epSet
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfEps
;
++
i
)
{
if
(
strcmp
(
epSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
htons
(
epSet
->
port
[
i
])
==
tsServerPort
)
{
epSet
->
inUse
=
(
i
+
1
)
%
epSet
->
numOfEps
;
mDebug
(
"mnode index:%d ep:%s:%u, set inUse to %d"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]),
epSet
->
inUse
);
}
else
{
mDebug
(
"mnode index:%d ep:%s:%u"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]));
}
}
rpcRsp
->
rsp
=
epSet
;
rpcRsp
->
len
=
sizeof
(
SRpcEpSet
);
mDebug
(
"msg:%p, app:%p type:%s in mread queue is redirected, numOfEps:%d inUse:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
epSet
->
numOfEps
,
epSet
->
inUse
);
return
TSDB_CODE_RPC_REDIRECT
;
}
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
521ae131
...
...
@@ -506,7 +506,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbRow *pRow) {
atomic_add_fetch_32
(
&
pTable
->
autoIndex
,
1
);
}
sdb
Debug
(
"vgId:1, sdb:%s, insert key:%s to hash, rowSize:%d rows:%"
PRId64
", msg:%p"
,
pTable
->
name
,
sdb
Trace
(
"vgId:1, sdb:%s, insert key:%s to hash, rowSize:%d rows:%"
PRId64
", msg:%p"
,
pTable
->
name
,
sdbGetRowStr
(
pTable
,
pRow
->
pObj
),
pRow
->
rowSize
,
pTable
->
numOfRows
,
pRow
->
pMsg
);
int32_t
code
=
(
*
pTable
->
fpInsert
)(
pRow
);
...
...
@@ -542,7 +542,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbRow *pRow) {
atomic_sub_fetch_32
(
&
pTable
->
numOfRows
,
1
);
sdb
Debug
(
"vgId:1, sdb:%s, delete key:%s from hash, numOfRows:%"
PRId64
", msg:%p"
,
pTable
->
name
,
sdb
Trace
(
"vgId:1, sdb:%s, delete key:%s from hash, numOfRows:%"
PRId64
", msg:%p"
,
pTable
->
name
,
sdbGetRowStr
(
pTable
,
pRow
->
pObj
),
pTable
->
numOfRows
,
pRow
->
pMsg
);
sdbDecRef
(
pTable
,
pRow
->
pObj
);
...
...
@@ -551,7 +551,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbRow *pRow) {
}
static
int32_t
sdbUpdateHash
(
SSdbTable
*
pTable
,
SSdbRow
*
pRow
)
{
sdb
Debug
(
"vgId:1, sdb:%s, update key:%s in hash, numOfRows:%"
PRId64
", msg:%p"
,
pTable
->
name
,
sdb
Trace
(
"vgId:1, sdb:%s, update key:%s in hash, numOfRows:%"
PRId64
", msg:%p"
,
pTable
->
name
,
sdbGetRowStr
(
pTable
,
pRow
->
pObj
),
pTable
->
numOfRows
,
pRow
->
pMsg
);
(
*
pTable
->
fpUpdate
)(
pRow
);
...
...
@@ -649,7 +649,7 @@ static int32_t sdbProcessWrite(void *wparam, void *hparam, int32_t qtype, void *
return
syncCode
;
}
sdb
Debug
(
"vgId:1, sdb:%s, record from wal/fwd is disposed, action:%s key:%s hver:%"
PRIu64
,
pTable
->
name
,
sdb
Trace
(
"vgId:1, sdb:%s, record from %s is disposed, action:%s key:%s hver:%"
PRIu64
,
pTable
->
name
,
qtypeStr
[
qtype
]
,
actStr
[
action
],
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
// even it is WAL/FWD, it shall be called to update version in sync
...
...
@@ -855,6 +855,7 @@ void sdbCloseTable(void *handle) {
taosHashCancelIterate
(
pTable
->
iHandle
,
pIter
);
taosHashCleanup
(
pTable
->
iHandle
);
pTable
->
iHandle
=
NULL
;
pthread_mutex_destroy
(
&
pTable
->
mutex
);
sdbDebug
(
"vgId:1, sdb:%s, is closed, numOfTables:%d"
,
pTable
->
name
,
tsSdbMgmt
.
numOfTables
);
...
...
src/mnode/src/mnodeWrite.c
浏览文件 @
521ae131
...
...
@@ -54,18 +54,8 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) {
rpcRsp
->
rsp
=
epSet
;
rpcRsp
->
len
=
sizeof
(
SRpcEpSet
);
mDebug
(
"msg:%p, app:%p type:%s in write queue, will be redirected, numOfEps:%d inUse:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
epSet
->
numOfEps
,
epSet
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfEps
;
++
i
)
{
if
(
strcmp
(
epSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
htons
(
epSet
->
port
[
i
])
==
tsServerPort
)
{
epSet
->
inUse
=
(
i
+
1
)
%
epSet
->
numOfEps
;
mDebug
(
"msg:%p, app:%p mnode index:%d ep:%s:%d, set inUse to %d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]),
epSet
->
inUse
);
}
else
{
mDebug
(
"msg:%p, app:%p mnode index:%d ep:%s:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
i
,
epSet
->
fqdn
[
i
],
htons
(
epSet
->
port
[
i
]));
}
}
mDebug
(
"msg:%p, app:%p type:%s in write queue, is redirected, numOfEps:%d inUse:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
epSet
->
numOfEps
,
epSet
->
inUse
);
return
TSDB_CODE_RPC_REDIRECT
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录