Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e8ce28f0
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e8ce28f0
编写于
12月 21, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2506
上级
7726ede5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
7 deletion
+23
-7
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+1
-1
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+3
-3
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+11
-3
src/util/src/tsocket.c
src/util/src/tsocket.c
+8
-0
未找到文件。
src/dnode/src/dnodeVRead.c
浏览文件 @
e8ce28f0
...
@@ -65,7 +65,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
...
@@ -65,7 +65,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
assert
(
pHead
->
contLen
>
0
);
assert
(
pHead
->
contLen
>
0
);
void
*
pVnode
=
vnodeAcquire
(
pHead
->
vgId
);
void
*
pVnode
=
vnodeAcquire
(
pHead
->
vgId
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
int32_t
code
=
vnodeWriteToRQueue
(
pVnode
,
pCont
,
pHead
->
contLen
,
TAOS_QTYPE_RPC
,
pMsg
);
code
=
vnodeWriteToRQueue
(
pVnode
,
pCont
,
pHead
->
contLen
,
TAOS_QTYPE_RPC
,
pMsg
);
if
(
code
==
TSDB_CODE_SUCCESS
)
queuedMsgNum
++
;
if
(
code
==
TSDB_CODE_SUCCESS
)
queuedMsgNum
++
;
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
}
}
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
e8ce28f0
...
@@ -656,7 +656,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
...
@@ -656,7 +656,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
pShow
->
bytes
[
cols
]
=
4
;
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
[
cols
].
name
,
"online
Vnode
s"
);
strcpy
(
pSchema
[
cols
].
name
,
"onlines"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
...
@@ -671,13 +671,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
...
@@ -671,13 +671,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
for
(
int32_t
i
=
0
;
i
<
pShow
->
maxReplica
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pShow
->
maxReplica
;
++
i
)
{
pShow
->
bytes
[
cols
]
=
2
;
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
D
node"
,
i
+
1
);
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
_d
node"
,
i
+
1
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
pShow
->
bytes
[
cols
]
=
9
+
VARSTR_HEADER_SIZE
;
pShow
->
bytes
[
cols
]
=
9
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
S
tatus"
,
i
+
1
);
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
_s
tatus"
,
i
+
1
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
}
}
...
...
src/sync/src/syncMain.c
浏览文件 @
e8ce28f0
...
@@ -560,6 +560,9 @@ static void syncChooseMaster(SSyncNode *pNode) {
...
@@ -560,6 +560,9 @@ static void syncChooseMaster(SSyncNode *pNode) {
index
=
i
;
index
=
i
;
}
}
}
}
sDebug
(
"vgId:%d, master:%s may be choosed, index:%d"
,
pNode
->
vgId
,
pNode
->
peerInfo
[
index
]
->
id
,
index
);
}
else
{
sDebug
(
"vgId:%d, no master election since onlineNum:%d replica:%d"
,
pNode
->
vgId
,
onlineNum
,
pNode
->
replica
);
}
}
// add arbitrator connection
// add arbitrator connection
...
@@ -580,6 +583,11 @@ static void syncChooseMaster(SSyncNode *pNode) {
...
@@ -580,6 +583,11 @@ static void syncChooseMaster(SSyncNode *pNode) {
}
}
}
}
}
}
if
(
index
>=
0
)
{
sDebug
(
"vgId:%d, master:%s may be choosed, index:%d onlineNum(arb):%d replica:%d"
,
pNode
->
vgId
,
pNode
->
peerInfo
[
index
]
->
id
,
index
,
onlineNum
,
replica
);
}
}
}
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
...
@@ -678,7 +686,7 @@ static void syncCheckRole(SSyncPeer *pPeer, SPeerStatus* peersStatus, int8_t new
...
@@ -678,7 +686,7 @@ static void syncCheckRole(SSyncPeer *pPeer, SPeerStatus* peersStatus, int8_t new
if
(
pMaster
)
{
if
(
pMaster
)
{
// master is there
// master is there
pNode
->
pMaster
=
pMaster
;
pNode
->
pMaster
=
pMaster
;
sDebug
(
"%s, it is the master,
sver:%"
PRIu64
,
pMaster
->
id
,
pMaster
->
version
);
sDebug
(
"%s, it is the master,
replica:^%d sver:%"
PRIu64
,
pMaster
->
id
,
pNode
->
replica
,
pMaster
->
version
);
if
(
syncValidateMaster
(
pPeer
)
<
0
)
return
;
if
(
syncValidateMaster
(
pPeer
)
<
0
)
return
;
...
@@ -711,10 +719,10 @@ static void syncCheckRole(SSyncPeer *pPeer, SPeerStatus* peersStatus, int8_t new
...
@@ -711,10 +719,10 @@ static void syncCheckRole(SSyncPeer *pPeer, SPeerStatus* peersStatus, int8_t new
}
}
if
(
consistent
)
{
if
(
consistent
)
{
sDebug
(
"vgId:%d, choose master
"
,
pNode
->
vgId
);
sDebug
(
"vgId:%d, choose master
, replica:%d"
,
pNode
->
vgId
,
pNode
->
replica
);
syncChooseMaster
(
pNode
);
syncChooseMaster
(
pNode
);
}
else
{
}
else
{
sDebug
(
"vgId:%d, cannot choose master since roles inequality
"
,
pNode
->
vgId
);
sDebug
(
"vgId:%d, cannot choose master since roles inequality
, replica:%d"
,
pNode
->
vgId
,
pNode
->
replica
);
}
}
}
}
...
...
src/util/src/tsocket.c
浏览文件 @
e8ce28f0
...
@@ -115,6 +115,10 @@ int32_t taosWriteMsg(SOCKET fd, void *buf, int32_t nbytes) {
...
@@ -115,6 +115,10 @@ int32_t taosWriteMsg(SOCKET fd, void *buf, int32_t nbytes) {
nleft
-=
nwritten
;
nleft
-=
nwritten
;
ptr
+=
nwritten
;
ptr
+=
nwritten
;
}
}
if
(
errno
==
SIGPIPE
||
errno
==
EPIPE
)
{
return
-
1
;
}
}
}
return
(
nbytes
-
nleft
);
return
(
nbytes
-
nleft
);
...
@@ -142,6 +146,10 @@ int32_t taosReadMsg(SOCKET fd, void *buf, int32_t nbytes) {
...
@@ -142,6 +146,10 @@ int32_t taosReadMsg(SOCKET fd, void *buf, int32_t nbytes) {
nleft
-=
nread
;
nleft
-=
nread
;
ptr
+=
nread
;
ptr
+=
nread
;
}
}
if
(
errno
==
SIGPIPE
||
errno
==
EPIPE
)
{
return
-
1
;
}
}
}
return
(
nbytes
-
nleft
);
return
(
nbytes
-
nleft
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录