Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
94e662c9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
94e662c9
编写于
11月 22, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
38af2df4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
23 deletion
+23
-23
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+1
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+20
-20
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+2
-2
未找到文件。
src/mnode/src/mnodeTable.c
浏览文件 @
94e662c9
...
...
@@ -413,7 +413,7 @@ static void mnodeRemoveTableFromStable(SSTableObj *pStable, SCTableObj *pCtable)
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pCtable
->
vgId
);
if
(
pVgroup
==
NULL
)
{
taosHashRemove
(
pStable
->
vgHash
,
(
char
*
)
&
pCtable
->
vgId
,
sizeof
(
pCtable
->
vgId
));
taosHashRemove
(
pStable
->
vgHash
,
&
pCtable
->
vgId
,
sizeof
(
pCtable
->
vgId
));
mDebug
(
"table:%s, vgId:%d is remove from stable vgList, sizeOfVgList:%d"
,
pStable
->
info
.
tableId
,
pCtable
->
vgId
,
(
int32_t
)
taosHashGetSize
(
pStable
->
vgHash
));
}
...
...
src/sync/src/syncMain.c
浏览文件 @
94e662c9
...
...
@@ -201,10 +201,10 @@ int64_t syncStart(const SSyncInfo *pInfo) {
return
-
1
;
}
for
(
int32_t
i
=
0
;
i
<
pCfg
->
replica
;
++
i
)
{
const
SNodeInfo
*
pNodeInfo
=
pCfg
->
nodeInfo
+
i
;
pNode
->
peerInfo
[
i
]
=
syncAddPeer
(
pNode
,
pNodeInfo
);
if
(
pNode
->
peerInfo
[
i
]
==
NULL
)
{
for
(
int32_t
i
ndex
=
0
;
index
<
pCfg
->
replica
;
++
index
)
{
const
SNodeInfo
*
pNodeInfo
=
pCfg
->
nodeInfo
+
i
ndex
;
pNode
->
peerInfo
[
i
ndex
]
=
syncAddPeer
(
pNode
,
pNodeInfo
);
if
(
pNode
->
peerInfo
[
i
ndex
]
==
NULL
)
{
sError
(
"vgId:%d, node:%d fqdn:%s port:%u is not configured, stop taosd"
,
pNode
->
vgId
,
pNodeInfo
->
nodeId
,
pNodeInfo
->
nodeFqdn
,
pNodeInfo
->
nodePort
);
syncStop
(
pNode
->
rid
);
...
...
@@ -212,7 +212,7 @@ int64_t syncStart(const SSyncInfo *pInfo) {
}
if
((
strcmp
(
pNodeInfo
->
nodeFqdn
,
tsNodeFqdn
)
==
0
)
&&
(
pNodeInfo
->
nodePort
==
tsSyncPort
))
{
pNode
->
selfIndex
=
i
;
pNode
->
selfIndex
=
i
ndex
;
}
}
...
...
@@ -251,7 +251,7 @@ int64_t syncStart(const SSyncInfo *pInfo) {
}
syncAddArbitrator
(
pNode
);
taosHashPut
(
tsVgIdHash
,
(
const
char
*
)
&
pNode
->
vgId
,
sizeof
(
int32_t
),
(
char
*
)(
&
pNode
)
,
sizeof
(
SSyncNode
*
));
taosHashPut
(
tsVgIdHash
,
&
pNode
->
vgId
,
sizeof
(
int32_t
),
&
pNode
,
sizeof
(
SSyncNode
*
));
if
(
pNode
->
notifyRole
)
{
(
*
pNode
->
notifyRole
)(
pNode
->
vgId
,
nodeRole
);
...
...
@@ -268,14 +268,14 @@ void syncStop(int64_t rid) {
sInfo
(
"vgId:%d, cleanup sync"
,
pNode
->
vgId
);
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
if
(
tsVgIdHash
)
taosHashRemove
(
tsVgIdHash
,
(
const
char
*
)
&
pNode
->
vgId
,
sizeof
(
int32_t
));
if
(
tsVgIdHash
)
taosHashRemove
(
tsVgIdHash
,
&
pNode
->
vgId
,
sizeof
(
int32_t
));
if
(
pNode
->
pFwdTimer
)
taosTmrStop
(
pNode
->
pFwdTimer
);
if
(
pNode
->
pRoleTimer
)
taosTmrStop
(
pNode
->
pRoleTimer
);
for
(
int32_t
i
=
0
;
i
<
pNode
->
replica
;
++
i
)
{
pPeer
=
pNode
->
peerInfo
[
i
];
for
(
int32_t
i
ndex
=
0
;
index
<
pNode
->
replica
;
++
index
)
{
pPeer
=
pNode
->
peerInfo
[
i
ndex
];
if
(
pPeer
)
syncRemovePeer
(
pPeer
);
}
...
...
@@ -297,7 +297,7 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg *pNewCfg) {
sInfo
(
"vgId:%d, reconfig, role:%s replica:%d old:%d"
,
pNode
->
vgId
,
syncRole
[
nodeRole
],
pNewCfg
->
replica
,
pNode
->
replica
);
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
for
(
i
=
0
;
i
<
pNode
->
replica
;
++
i
)
{
for
(
j
=
0
;
j
<
pNewCfg
->
replica
;
++
j
)
{
...
...
@@ -414,7 +414,7 @@ void syncRecover(int64_t rid) {
(*pNode->notifyRole)(pNode->vgId, nodeRole);
nodeVersion = 0;
pthread_mutex_lock(&
(pNode->mutex)
);
pthread_mutex_lock(&
pNode->mutex
);
for (int32_t i = 0; i < pNode->replica; ++i) {
pPeer = pNode->peerInfo[i];
...
...
@@ -831,7 +831,7 @@ static void syncNotStarted(void *param, void *tmrId) {
SSyncPeer
*
pPeer
=
param
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
pPeer
->
timer
=
NULL
;
sInfo
(
"%s, sync connection is still not up, restart"
,
pPeer
->
id
);
syncRestartConnection
(
pPeer
);
...
...
@@ -842,7 +842,7 @@ static void syncTryRecoverFromMaster(void *param, void *tmrId) {
SSyncPeer
*
pPeer
=
param
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
syncRecoverFromMaster
(
pPeer
);
pthread_mutex_unlock
(
&
(
pNode
->
mutex
));
}
...
...
@@ -968,7 +968,7 @@ static int32_t syncProcessPeerMsg(void *param, void *buffer) {
char
*
cont
=
buffer
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
int32_t
code
=
syncReadPeerMsg
(
pPeer
,
&
head
,
cont
);
...
...
@@ -1066,7 +1066,7 @@ static void syncCheckPeerConnection(void *param, void *tmrId) {
SSyncPeer
*
pPeer
=
param
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
sDebug
(
"%s, check peer connection"
,
pPeer
->
id
);
syncSetupPeerConnection
(
pPeer
);
...
...
@@ -1118,7 +1118,7 @@ static void syncProcessIncommingConnection(int32_t connFd, uint32_t sourceIp) {
}
SSyncNode
*
pNode
=
*
ppNode
;
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
SSyncPeer
*
pPeer
;
for
(
i
=
0
;
i
<
pNode
->
replica
;
++
i
)
{
...
...
@@ -1156,7 +1156,7 @@ static void syncProcessBrokenLink(void *param) {
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
if
(
taosAcquireRef
(
tsSyncRefId
,
pNode
->
rid
)
==
NULL
)
return
;
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
sDebug
(
"%s, TCP link is broken since %s"
,
pPeer
->
id
,
strerror
(
errno
));
pPeer
->
peerFd
=
-
1
;
...
...
@@ -1262,7 +1262,7 @@ static void syncMonitorFwdInfos(void *param, void *tmrId) {
int64_t
time
=
taosGetTimestampMs
();
if
(
pSyncFwds
->
fwds
>
0
)
{
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
for
(
int32_t
i
=
0
;
i
<
pSyncFwds
->
fwds
;
++
i
)
{
SFwdInfo
*
pFwdInfo
=
pSyncFwds
->
fwdInfo
+
(
pSyncFwds
->
first
+
i
)
%
tsMaxFwdInfo
;
if
(
ABS
(
time
-
pFwdInfo
->
time
)
<
2000
)
break
;
...
...
@@ -1320,7 +1320,7 @@ static int32_t syncForwardToPeerImpl(SSyncNode *pNode, void *data, void *mhandle
pSyncHead
->
len
=
sizeof
(
SWalHead
)
+
pWalHead
->
len
;
fwdLen
=
pSyncHead
->
len
+
sizeof
(
SSyncHead
);
// include the WAL and SYNC head
pthread_mutex_lock
(
&
(
pNode
->
mutex
)
);
pthread_mutex_lock
(
&
pNode
->
mutex
);
for
(
int32_t
i
=
0
;
i
<
pNode
->
replica
;
++
i
)
{
pPeer
=
pNode
->
peerInfo
[
i
];
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
94e662c9
...
...
@@ -338,7 +338,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
vDebug
(
"vgId:%d, vnode is opened in %s, pVnode:%p"
,
pVnode
->
vgId
,
rootDir
,
pVnode
);
tsdbIncCommitRef
(
pVnode
->
vgId
);
taosHashPut
(
tsVnodesHash
,
(
const
char
*
)
&
pVnode
->
vgId
,
sizeof
(
int32_t
),
(
char
*
)(
&
pVnode
)
,
sizeof
(
SVnodeObj
*
));
taosHashPut
(
tsVnodesHash
,
&
pVnode
->
vgId
,
sizeof
(
int32_t
),
&
pVnode
,
sizeof
(
SVnodeObj
*
));
SSyncInfo
syncInfo
;
syncInfo
.
vgId
=
pVnode
->
vgId
;
...
...
@@ -570,7 +570,7 @@ void vnodeSetAccess(SVgroupAccess *pAccess, int32_t numOfVnodes) {
static
void
vnodeCleanUp
(
SVnodeObj
*
pVnode
)
{
// remove from hash, so new messages wont be consumed
taosHashRemove
(
tsVnodesHash
,
(
const
char
*
)
&
pVnode
->
vgId
,
sizeof
(
int32_t
));
taosHashRemove
(
tsVnodesHash
,
&
pVnode
->
vgId
,
sizeof
(
int32_t
));
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_INIT
)
{
// it may be in updateing or reset state, then it shall wait
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录