Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2b256542
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b256542
编写于
12月 14, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact: add vnode timer
上级
b89877b4
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
70 addition
and
15 deletion
+70
-15
include/libs/sync/sync.h
include/libs/sync/sync.h
+2
-1
include/util/tdef.h
include/util/tdef.h
+3
-0
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+13
-2
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+2
-0
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+26
-2
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+1
-1
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+18
-5
source/libs/sync/test/syncConfigChangeSnapshotTest.cpp
source/libs/sync/test/syncConfigChangeSnapshotTest.cpp
+1
-1
source/libs/sync/test/syncConfigChangeTest.cpp
source/libs/sync/test/syncConfigChangeTest.cpp
+1
-1
source/libs/sync/test/syncReplicateTest.cpp
source/libs/sync/test/syncReplicateTest.cpp
+1
-1
source/libs/sync/test/syncTestTool.cpp
source/libs/sync/test/syncTestTool.cpp
+1
-1
未找到文件。
include/libs/sync/sync.h
浏览文件 @
2b256542
...
@@ -230,7 +230,7 @@ int64_t syncOpen(SSyncInfo* pSyncInfo);
...
@@ -230,7 +230,7 @@ int64_t syncOpen(SSyncInfo* pSyncInfo);
int32_t
syncStart
(
int64_t
rid
);
int32_t
syncStart
(
int64_t
rid
);
void
syncStop
(
int64_t
rid
);
void
syncStop
(
int64_t
rid
);
void
syncPreStop
(
int64_t
rid
);
void
syncPreStop
(
int64_t
rid
);
int32_t
syncPropose
(
int64_t
rid
,
SRpcMsg
*
pMsg
,
bool
isWeak
);
int32_t
syncPropose
(
int64_t
rid
,
SRpcMsg
*
pMsg
,
bool
isWeak
,
int64_t
*
seq
);
int32_t
syncProcessMsg
(
int64_t
rid
,
SRpcMsg
*
pMsg
);
int32_t
syncProcessMsg
(
int64_t
rid
,
SRpcMsg
*
pMsg
);
int32_t
syncReconfig
(
int64_t
rid
,
SSyncCfg
*
pCfg
);
int32_t
syncReconfig
(
int64_t
rid
,
SSyncCfg
*
pCfg
);
int32_t
syncBeginSnapshot
(
int64_t
rid
,
int64_t
lastApplyIndex
);
int32_t
syncBeginSnapshot
(
int64_t
rid
,
int64_t
lastApplyIndex
);
...
@@ -240,6 +240,7 @@ int32_t syncStepDown(int64_t rid, SyncTerm newTerm);
...
@@ -240,6 +240,7 @@ int32_t syncStepDown(int64_t rid, SyncTerm newTerm);
bool
syncIsReadyForRead
(
int64_t
rid
);
bool
syncIsReadyForRead
(
int64_t
rid
);
bool
syncSnapshotSending
(
int64_t
rid
);
bool
syncSnapshotSending
(
int64_t
rid
);
bool
syncSnapshotRecving
(
int64_t
rid
);
bool
syncSnapshotRecving
(
int64_t
rid
);
void
syncSendTimeoutRsp
(
int64_t
rid
,
int64_t
seq
);
SSyncState
syncGetState
(
int64_t
rid
);
SSyncState
syncGetState
(
int64_t
rid
);
void
syncGetRetryEpSet
(
int64_t
rid
,
SEpSet
*
pEpSet
);
void
syncGetRetryEpSet
(
int64_t
rid
,
SEpSet
*
pEpSet
);
...
...
include/util/tdef.h
浏览文件 @
2b256542
...
@@ -497,6 +497,9 @@ enum {
...
@@ -497,6 +497,9 @@ enum {
// sort page size by default
// sort page size by default
#define DEFAULT_PAGESIZE 4096
#define DEFAULT_PAGESIZE 4096
#define VNODE_TIMEOUT_SEC 60
#define MNODE_TIMEOUT_SEC 10
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
2b256542
...
@@ -334,7 +334,18 @@ static void vmCleanup(SVnodeMgmt *pMgmt) {
...
@@ -334,7 +334,18 @@ static void vmCleanup(SVnodeMgmt *pMgmt) {
taosMemoryFree
(
pMgmt
);
taosMemoryFree
(
pMgmt
);
}
}
static
void
vmCheckSyncTimeout
(
SVnodeMgmt
*
pMgmt
)
{}
static
void
vmCheckSyncTimeout
(
SVnodeMgmt
*
pMgmt
)
{
taosThreadRwlockRdlock
(
&
pMgmt
->
lock
);
void
*
pIter
=
taosHashIterate
(
pMgmt
->
hash
,
NULL
);
while
(
pIter
)
{
SVnodeObj
**
ppVnode
=
pIter
;
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
continue
;
SVnodeObj
*
pVnode
=
*
ppVnode
;
vnodeSyncCheckTimeout
(
pVnode
->
pImpl
);
pIter
=
taosHashIterate
(
pMgmt
->
hash
,
pIter
);
}
}
static
void
*
vmThreadFp
(
void
*
param
)
{
static
void
*
vmThreadFp
(
void
*
param
)
{
SVnodeMgmt
*
pMgmt
=
param
;
SVnodeMgmt
*
pMgmt
=
param
;
...
@@ -348,7 +359,7 @@ static void *vmThreadFp(void *param) {
...
@@ -348,7 +359,7 @@ static void *vmThreadFp(void *param) {
if
(
lastTime
%
10
!=
0
)
continue
;
if
(
lastTime
%
10
!=
0
)
continue
;
int64_t
sec
=
lastTime
/
10
;
int64_t
sec
=
lastTime
/
10
;
if
(
sec
%
(
tsStatusInterval
*
5
)
==
0
)
{
if
(
sec
%
(
VNODE_TIMEOUT_SEC
/
2
)
==
0
)
{
vmCheckSyncTimeout
(
pMgmt
);
vmCheckSyncTimeout
(
pMgmt
);
}
}
}
}
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
2b256542
...
@@ -54,6 +54,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs);
...
@@ -54,6 +54,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs);
void
vnodeDestroy
(
const
char
*
path
,
STfs
*
pTfs
);
void
vnodeDestroy
(
const
char
*
path
,
STfs
*
pTfs
);
SVnode
*
vnodeOpen
(
const
char
*
path
,
STfs
*
pTfs
,
SMsgCb
msgCb
);
SVnode
*
vnodeOpen
(
const
char
*
path
,
STfs
*
pTfs
,
SMsgCb
msgCb
);
void
vnodePreClose
(
SVnode
*
pVnode
);
void
vnodePreClose
(
SVnode
*
pVnode
);
void
vnodeSyncCheckTimeout
(
SVnode
*
pVnode
);
void
vnodeClose
(
SVnode
*
pVnode
);
void
vnodeClose
(
SVnode
*
pVnode
);
int32_t
vnodeStart
(
SVnode
*
pVnode
);
int32_t
vnodeStart
(
SVnode
*
pVnode
);
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
2b256542
...
@@ -344,6 +344,8 @@ struct SVnode {
...
@@ -344,6 +344,8 @@ struct SVnode {
bool
blocked
;
bool
blocked
;
bool
restored
;
bool
restored
;
tsem_t
syncSem
;
tsem_t
syncSem
;
int32_t
blockSec
;
int64_t
blockSeq
;
SQHandle
*
pQuery
;
SQHandle
*
pQuery
;
};
};
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
2b256542
...
@@ -22,7 +22,8 @@ static inline bool vnodeIsMsgWeak(tmsg_t type) { return false; }
...
@@ -22,7 +22,8 @@ static inline bool vnodeIsMsgWeak(tmsg_t type) { return false; }
static
inline
void
vnodeWaitBlockMsg
(
SVnode
*
pVnode
,
const
SRpcMsg
*
pMsg
)
{
static
inline
void
vnodeWaitBlockMsg
(
SVnode
*
pVnode
,
const
SRpcMsg
*
pMsg
)
{
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
vGTrace
(
"vgId:%d, msg:%p wait block, type:%s"
,
pVnode
->
config
.
vgId
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
));
vGTrace
(
"vgId:%d, msg:%p wait block, type:%s sec:%d seq:%"
PRId64
,
pVnode
->
config
.
vgId
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
),
pVnode
->
blockSec
,
pVnode
->
blockSeq
);
tsem_wait
(
&
pVnode
->
syncSem
);
tsem_wait
(
&
pVnode
->
syncSem
);
}
}
...
@@ -202,12 +203,16 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs)
...
@@ -202,12 +203,16 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs)
#else
#else
static
int32_t
inline
vnodeProposeMsg
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
,
bool
isWeak
)
{
static
int32_t
inline
vnodeProposeMsg
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
,
bool
isWeak
)
{
int64_t
seq
=
0
;
taosThreadMutexLock
(
&
pVnode
->
lock
);
taosThreadMutexLock
(
&
pVnode
->
lock
);
int32_t
code
=
syncPropose
(
pVnode
->
sync
,
pMsg
,
isWeak
);
int32_t
code
=
syncPropose
(
pVnode
->
sync
,
pMsg
,
isWeak
,
&
seq
);
bool
wait
=
(
code
==
0
&&
vnodeIsMsgBlock
(
pMsg
->
msgType
));
bool
wait
=
(
code
==
0
&&
vnodeIsMsgBlock
(
pMsg
->
msgType
));
if
(
wait
)
{
if
(
wait
)
{
ASSERT
(
!
pVnode
->
blocked
);
ASSERT
(
!
pVnode
->
blocked
);
pVnode
->
blocked
=
true
;
pVnode
->
blocked
=
true
;
pVnode
->
blockSec
=
taosGetTimestampSec
();
pVnode
->
blockSeq
=
seq
;
}
}
taosThreadMutexUnlock
(
&
pVnode
->
lock
);
taosThreadMutexUnlock
(
&
pVnode
->
lock
);
...
@@ -606,6 +611,25 @@ void vnodeSyncClose(SVnode *pVnode) {
...
@@ -606,6 +611,25 @@ void vnodeSyncClose(SVnode *pVnode) {
syncStop
(
pVnode
->
sync
);
syncStop
(
pVnode
->
sync
);
}
}
void
vnodeSyncCheckTimeout
(
SVnode
*
pVnode
)
{
vTrace
(
"vgId:%d, check sync timeout msg"
,
pVnode
->
config
.
vgId
);
taosThreadMutexLock
(
&
pVnode
->
lock
);
if
(
pVnode
->
blocked
)
{
int32_t
curSec
=
taosGetTimestampSec
();
int32_t
delta
=
curSec
-
pVnode
->
blockSec
;
if
(
delta
>
VNODE_TIMEOUT_SEC
)
{
syncSendTimeoutRsp
(
pVnode
->
sync
,
pVnode
->
blockSeq
);
vError
(
"vgId:%d, failed to propose since timeout and post block, start:%d cur:%d delta:%d seq:%"
PRId64
,
pVnode
->
config
.
vgId
,
pVnode
->
blockSec
,
curSec
,
delta
,
pVnode
->
blockSeq
);
pVnode
->
blocked
=
false
;
pVnode
->
blockSec
=
0
;
pVnode
->
blockSeq
=
0
;
tsem_post
(
&
pVnode
->
syncSem
);
}
}
taosThreadMutexUnlock
(
&
pVnode
->
lock
);
}
bool
vnodeIsRoleLeader
(
SVnode
*
pVnode
)
{
bool
vnodeIsRoleLeader
(
SVnode
*
pVnode
)
{
SSyncState
state
=
syncGetState
(
pVnode
->
sync
);
SSyncState
state
=
syncGetState
(
pVnode
->
sync
);
return
state
.
state
==
TAOS_SYNC_STATE_LEADER
;
return
state
.
state
==
TAOS_SYNC_STATE_LEADER
;
...
...
source/libs/sync/inc/syncInt.h
浏览文件 @
2b256542
...
@@ -215,7 +215,7 @@ int32_t syncNodeStart(SSyncNode* pSyncNode);
...
@@ -215,7 +215,7 @@ int32_t syncNodeStart(SSyncNode* pSyncNode);
int32_t
syncNodeStartStandBy
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeStartStandBy
(
SSyncNode
*
pSyncNode
);
void
syncNodeClose
(
SSyncNode
*
pSyncNode
);
void
syncNodeClose
(
SSyncNode
*
pSyncNode
);
void
syncNodePreClose
(
SSyncNode
*
pSyncNode
);
void
syncNodePreClose
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
);
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
,
int64_t
*
seq
);
int32_t
syncNodeRestore
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeRestore
(
SSyncNode
*
pSyncNode
);
void
syncHbTimerDataFree
(
SSyncHbTimerData
*
pData
);
void
syncHbTimerDataFree
(
SSyncHbTimerData
*
pData
);
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
2b256542
...
@@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) {
...
@@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) {
}
}
syncNodeStartHeartbeatTimer
(
pSyncNode
);
syncNodeStartHeartbeatTimer
(
pSyncNode
);
//syncNodeReplicate(pSyncNode);
//
syncNodeReplicate(pSyncNode);
}
}
syncNodeRelease
(
pSyncNode
);
syncNodeRelease
(
pSyncNode
);
...
@@ -218,6 +218,18 @@ int32_t syncLeaderTransfer(int64_t rid) {
...
@@ -218,6 +218,18 @@ int32_t syncLeaderTransfer(int64_t rid) {
return
ret
;
return
ret
;
}
}
void
syncSendTimeoutRsp
(
int64_t
rid
,
int64_t
seq
)
{
SSyncNode
*
pNode
=
syncNodeAcquire
(
rid
);
if
(
pNode
==
NULL
)
return
;
SRpcMsg
rpcMsg
=
{
0
};
(
void
)
syncRespMgrGetAndDel
(
pNode
->
pSyncRespMgr
,
seq
,
&
rpcMsg
.
info
);
rpcMsg
.
code
=
TSDB_CODE_SYN_TIMEOUT
;
syncNodeRelease
(
pNode
);
rpcSendResponse
(
&
rpcMsg
);
}
SyncIndex
syncMinMatchIndex
(
SSyncNode
*
pSyncNode
)
{
SyncIndex
syncMinMatchIndex
(
SSyncNode
*
pSyncNode
)
{
SyncIndex
minMatchIndex
=
SYNC_INDEX_INVALID
;
SyncIndex
minMatchIndex
=
SYNC_INDEX_INVALID
;
...
@@ -538,7 +550,7 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) {
...
@@ -538,7 +550,7 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) {
pMsg
->
newLeaderId
.
vgId
=
pSyncNode
->
vgId
;
pMsg
->
newLeaderId
.
vgId
=
pSyncNode
->
vgId
;
pMsg
->
newNodeInfo
=
newLeader
;
pMsg
->
newNodeInfo
=
newLeader
;
int32_t
ret
=
syncNodePropose
(
pSyncNode
,
&
rpcMsg
,
false
);
int32_t
ret
=
syncNodePropose
(
pSyncNode
,
&
rpcMsg
,
false
,
NULL
);
rpcFreeCont
(
rpcMsg
.
pCont
);
rpcFreeCont
(
rpcMsg
.
pCont
);
return
ret
;
return
ret
;
}
}
...
@@ -670,19 +682,19 @@ void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet) {
...
@@ -670,19 +682,19 @@ void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet) {
syncNodeRelease
(
pSyncNode
);
syncNodeRelease
(
pSyncNode
);
}
}
int32_t
syncPropose
(
int64_t
rid
,
SRpcMsg
*
pMsg
,
bool
isWeak
)
{
int32_t
syncPropose
(
int64_t
rid
,
SRpcMsg
*
pMsg
,
bool
isWeak
,
int64_t
*
seq
)
{
SSyncNode
*
pSyncNode
=
syncNodeAcquire
(
rid
);
SSyncNode
*
pSyncNode
=
syncNodeAcquire
(
rid
);
if
(
pSyncNode
==
NULL
)
{
if
(
pSyncNode
==
NULL
)
{
sError
(
"sync propose error"
);
sError
(
"sync propose error"
);
return
-
1
;
return
-
1
;
}
}
int32_t
ret
=
syncNodePropose
(
pSyncNode
,
pMsg
,
isWeak
);
int32_t
ret
=
syncNodePropose
(
pSyncNode
,
pMsg
,
isWeak
,
seq
);
syncNodeRelease
(
pSyncNode
);
syncNodeRelease
(
pSyncNode
);
return
ret
;
return
ret
;
}
}
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
)
{
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
,
int64_t
*
seq
)
{
if
(
pSyncNode
->
state
!=
TAOS_SYNC_STATE_LEADER
)
{
if
(
pSyncNode
->
state
!=
TAOS_SYNC_STATE_LEADER
)
{
terrno
=
TSDB_CODE_SYN_NOT_LEADER
;
terrno
=
TSDB_CODE_SYN_NOT_LEADER
;
sNError
(
pSyncNode
,
"sync propose not leader, %s, type:%s"
,
syncStr
(
pSyncNode
->
state
),
TMSG_INFO
(
pMsg
->
msgType
));
sNError
(
pSyncNode
,
"sync propose not leader, %s, type:%s"
,
syncStr
(
pSyncNode
->
state
),
TMSG_INFO
(
pMsg
->
msgType
));
...
@@ -739,6 +751,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) {
...
@@ -739,6 +751,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) {
(
void
)
syncRespMgrDel
(
pSyncNode
->
pSyncRespMgr
,
seqNum
);
(
void
)
syncRespMgrDel
(
pSyncNode
->
pSyncRespMgr
,
seqNum
);
}
}
if
(
seq
!=
NULL
)
*
seq
=
seqNum
;
return
code
;
return
code
;
}
}
}
}
...
...
source/libs/sync/test/syncConfigChangeSnapshotTest.cpp
浏览文件 @
2b256542
...
@@ -337,7 +337,7 @@ int main(int argc, char** argv) {
...
@@ -337,7 +337,7 @@ int main(int argc, char** argv) {
if
(
alreadySend
<
writeRecordNum
)
{
if
(
alreadySend
<
writeRecordNum
)
{
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
,
NULL
);
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
sTrace
(
"%s value%d write not leader"
,
s
,
alreadySend
);
sTrace
(
"%s value%d write not leader"
,
s
,
alreadySend
);
}
else
{
}
else
{
...
...
source/libs/sync/test/syncConfigChangeTest.cpp
浏览文件 @
2b256542
...
@@ -249,7 +249,7 @@ int main(int argc, char** argv) {
...
@@ -249,7 +249,7 @@ int main(int argc, char** argv) {
if
(
alreadySend
<
writeRecordNum
)
{
if
(
alreadySend
<
writeRecordNum
)
{
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
,
NULL
);
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
sTrace
(
"%s value%d write not leader"
,
s
,
alreadySend
);
sTrace
(
"%s value%d write not leader"
,
s
,
alreadySend
);
}
else
{
}
else
{
...
...
source/libs/sync/test/syncReplicateTest.cpp
浏览文件 @
2b256542
...
@@ -189,7 +189,7 @@ int main(int argc, char** argv) {
...
@@ -189,7 +189,7 @@ int main(int argc, char** argv) {
if
(
alreadySend
<
writeRecordNum
)
{
if
(
alreadySend
<
writeRecordNum
)
{
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
,
NULL
);
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
sTrace
(
"%s value%d write not leader"
,
s
,
alreadySend
);
sTrace
(
"%s value%d write not leader"
,
s
,
alreadySend
);
}
else
{
}
else
{
...
...
source/libs/sync/test/syncTestTool.cpp
浏览文件 @
2b256542
...
@@ -396,7 +396,7 @@ int main(int argc, char** argv) {
...
@@ -396,7 +396,7 @@ int main(int argc, char** argv) {
if
(
alreadySend
<
writeRecordNum
)
{
if
(
alreadySend
<
writeRecordNum
)
{
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
SRpcMsg
*
pRpcMsg
=
createRpcMsg
(
alreadySend
,
writeRecordNum
,
myIndex
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
);
int32_t
ret
=
syncPropose
(
rid
,
pRpcMsg
,
false
,
NULL
);
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
if
(
ret
==
-
1
&&
terrno
==
TSDB_CODE_SYN_NOT_LEADER
)
{
sTrace
(
"%s value%d write not leader, leaderTransferWait:%d"
,
simpleStr
,
alreadySend
,
leaderTransferWait
);
sTrace
(
"%s value%d write not leader, leaderTransferWait:%d"
,
simpleStr
,
alreadySend
,
leaderTransferWait
);
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录