Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4a0468aa
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
未验证
提交
4a0468aa
编写于
11月 08, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
11月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17945 from taosdata/enh/TD-20043
reafct: adjust sync propose
上级
16054dcd
29f88785
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
133 addition
and
170 deletion
+133
-170
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+0
-4
source/libs/sync/inc/syncTools.h
source/libs/sync/inc/syncTools.h
+2
-3
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+93
-103
source/libs/sync/src/syncMessage.c
source/libs/sync/src/syncMessage.c
+4
-8
source/libs/sync/src/syncUtil.c
source/libs/sync/src/syncUtil.c
+6
-24
source/libs/sync/src/syncVoteMgr.c
source/libs/sync/src/syncVoteMgr.c
+12
-12
source/libs/sync/test/syncApplyMsgTest.cpp
source/libs/sync/test/syncApplyMsgTest.cpp
+1
-1
source/libs/sync/test/syncClientRequestBatchTest.cpp
source/libs/sync/test/syncClientRequestBatchTest.cpp
+1
-1
source/libs/sync/test/syncClientRequestTest.cpp
source/libs/sync/test/syncClientRequestTest.cpp
+4
-4
source/libs/sync/test/syncEncodeTest.cpp
source/libs/sync/test/syncEncodeTest.cpp
+2
-2
source/libs/sync/test/syncEntryTest.cpp
source/libs/sync/test/syncEntryTest.cpp
+2
-2
source/libs/sync/test/syncRpcMsgTest.cpp
source/libs/sync/test/syncRpcMsgTest.cpp
+2
-2
source/libs/sync/test/syncSnapshotTest.cpp
source/libs/sync/test/syncSnapshotTest.cpp
+2
-2
source/libs/sync/test/syncWriteTest.cpp
source/libs/sync/test/syncWriteTest.cpp
+2
-2
未找到文件。
source/libs/sync/inc/syncInt.h
浏览文件 @
4a0468aa
...
...
@@ -111,10 +111,6 @@ typedef struct SElectTimer {
void
*
pData
;
}
SElectTimer
;
int32_t
syncHbTimerInit
(
SSyncNode
*
pSyncNode
,
SSyncTimer
*
pSyncTimer
,
SRaftId
destId
);
int32_t
syncHbTimerStart
(
SSyncNode
*
pSyncNode
,
SSyncTimer
*
pSyncTimer
);
int32_t
syncHbTimerStop
(
SSyncNode
*
pSyncNode
,
SSyncTimer
*
pSyncTimer
);
typedef
struct
SPeerState
{
SyncIndex
lastSendIndex
;
int64_t
lastSendTime
;
...
...
source/libs/sync/inc/syncTools.h
浏览文件 @
4a0468aa
...
...
@@ -182,9 +182,8 @@ typedef struct SyncClientRequest {
char
data
[];
// origin RpcMsg.pCont
}
SyncClientRequest
;
SyncClientRequest
*
syncClientRequestBuild
(
uint32_t
dataLen
);
SyncClientRequest
*
syncClientRequestBuild2
(
const
SRpcMsg
*
pOriginalRpcMsg
,
uint64_t
seqNum
,
bool
isWeak
,
int32_t
vgId
);
// step 1
SyncClientRequest
*
syncClientRequestAlloc
(
uint32_t
dataLen
);
SyncClientRequest
*
syncClientRequestBuild
(
const
SRpcMsg
*
pMsg
,
uint64_t
seqNum
,
bool
isWeak
,
int32_t
vgId
);
// step 1
void
syncClientRequestDestroy
(
SyncClientRequest
*
pMsg
);
void
syncClientRequestSerialize
(
const
SyncClientRequest
*
pMsg
,
char
*
buf
,
uint32_t
bufLen
);
void
syncClientRequestDeserialize
(
const
char
*
buf
,
uint32_t
len
,
SyncClientRequest
*
pMsg
);
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
4a0468aa
此差异已折叠。
点击以展开。
source/libs/sync/src/syncMessage.c
浏览文件 @
4a0468aa
...
...
@@ -831,21 +831,18 @@ void syncPingReplyLog2(char* s, const SyncPingReply* pMsg) {
}
// ---- message process SyncClientRequest----
SyncClientRequest
*
syncClientRequest
Build
(
uint32_t
dataLen
)
{
SyncClientRequest
*
syncClientRequest
Alloc
(
uint32_t
dataLen
)
{
uint32_t
bytes
=
sizeof
(
SyncClientRequest
)
+
dataLen
;
SyncClientRequest
*
pMsg
=
taosMemoryMalloc
(
bytes
);
memset
(
pMsg
,
0
,
bytes
);
SyncClientRequest
*
pMsg
=
taosMemoryCalloc
(
1
,
bytes
);
pMsg
->
bytes
=
bytes
;
pMsg
->
msgType
=
TDMT_SYNC_CLIENT_REQUEST
;
pMsg
->
seqNum
=
0
;
pMsg
->
isWeak
=
false
;
pMsg
->
dataLen
=
dataLen
;
return
pMsg
;
}
// step 1. original SRpcMsg => SyncClientRequest, add seqNum, isWeak
SyncClientRequest
*
syncClientRequestBuild
2
(
const
SRpcMsg
*
pOriginalRpcMsg
,
uint64_t
seqNum
,
bool
isWeak
,
int32_t
vgId
)
{
SyncClientRequest
*
pMsg
=
syncClientRequest
Build
(
pOriginalRpcMsg
->
contLen
);
SyncClientRequest
*
syncClientRequestBuild
(
const
SRpcMsg
*
pOriginalRpcMsg
,
uint64_t
seqNum
,
bool
isWeak
,
int32_t
vgId
)
{
SyncClientRequest
*
pMsg
=
syncClientRequest
Alloc
(
pOriginalRpcMsg
->
contLen
);
pMsg
->
vgId
=
vgId
;
pMsg
->
originalRpcType
=
pOriginalRpcMsg
->
msgType
;
pMsg
->
seqNum
=
seqNum
;
...
...
@@ -891,7 +888,6 @@ SyncClientRequest* syncClientRequestDeserialize2(const char* buf, uint32_t len)
// step 2. SyncClientRequest => RpcMsg, to queue
void
syncClientRequest2RpcMsg
(
const
SyncClientRequest
*
pMsg
,
SRpcMsg
*
pRpcMsg
)
{
memset
(
pRpcMsg
,
0
,
sizeof
(
*
pRpcMsg
));
pRpcMsg
->
msgType
=
pMsg
->
msgType
;
pRpcMsg
->
contLen
=
pMsg
->
bytes
;
pRpcMsg
->
pCont
=
rpcMallocCont
(
pRpcMsg
->
contLen
);
...
...
source/libs/sync/src/syncUtil.c
浏览文件 @
4a0468aa
...
...
@@ -142,7 +142,7 @@ char* syncUtilPrintBin(char* ptr, uint32_t len) {
memset
(
s
,
0
,
len
+
1
);
memcpy
(
s
,
ptr
,
len
);
for
(
int
i
=
0
;
i
<
len
;
++
i
)
{
for
(
int
32_t
i
=
0
;
i
<
len
;
++
i
)
{
if
(
!
syncUtilCanPrint
(
s
[
i
]))
{
s
[
i
]
=
'.'
;
}
...
...
@@ -157,8 +157,8 @@ char* syncUtilPrintBin2(char* ptr, uint32_t len) {
memset
(
s
,
0
,
len2
);
char
*
p
=
s
;
for
(
int
i
=
0
;
i
<
len
;
++
i
)
{
int
n
=
sprintf
(
p
,
"%d,"
,
ptr
[
i
]);
for
(
int
32_t
i
=
0
;
i
<
len
;
++
i
)
{
int
32_t
n
=
sprintf
(
p
,
"%d,"
,
ptr
[
i
]);
p
+=
n
;
}
return
s
;
...
...
@@ -178,29 +178,11 @@ void syncUtilMsgNtoH(void* msg) {
pHead
->
vgId
=
ntohl
(
pHead
->
vgId
);
}
bool
syncUtilUserPreCommit
(
tmsg_t
msgType
)
{
if
(
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
)
{
return
true
;
}
return
false
;
}
bool
syncUtilUserCommit
(
tmsg_t
msgType
)
{
if
(
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
)
{
return
true
;
}
return
false
;
}
bool
syncUtilUserPreCommit
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
bool
syncUtilUserRollback
(
tmsg_t
msgType
)
{
if
(
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
)
{
return
true
;
}
bool
syncUtilUserCommit
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
return
false
;
}
bool
syncUtilUserRollback
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
void
syncCfg2SimpleStr
(
const
SSyncCfg
*
pCfg
,
char
*
buf
,
int32_t
bufLen
)
{
int32_t
len
=
snprintf
(
buf
,
bufLen
,
"{r-num:%d, my:%d, "
,
pCfg
->
replicaNum
,
pCfg
->
myIndex
);
...
...
source/libs/sync/src/syncVoteMgr.c
浏览文件 @
4a0468aa
...
...
@@ -74,8 +74,8 @@ void voteGrantedVote(SVotesGranted *pVotesGranted, SyncRequestVoteReply *pMsg) {
ASSERT
(
syncUtilSameId
(
&
pVotesGranted
->
pSyncNode
->
myRaftId
,
&
pMsg
->
destId
));
int
j
=
-
1
;
for
(
int
i
=
0
;
i
<
pVotesGranted
->
replicaNum
;
++
i
)
{
int
32_t
j
=
-
1
;
for
(
int
32_t
i
=
0
;
i
<
pVotesGranted
->
replicaNum
;
++
i
)
{
if
(
syncUtilSameId
(
&
((
*
(
pVotesGranted
->
replicas
))[
i
]),
&
(
pMsg
->
srcId
)))
{
j
=
i
;
break
;
...
...
@@ -105,11 +105,11 @@ cJSON *voteGranted2Json(SVotesGranted *pVotesGranted) {
cJSON_AddNumberToObject
(
pRoot
,
"replicaNum"
,
pVotesGranted
->
replicaNum
);
cJSON
*
pReplicas
=
cJSON_CreateArray
();
cJSON_AddItemToObject
(
pRoot
,
"replicas"
,
pReplicas
);
for
(
int
i
=
0
;
i
<
pVotesGranted
->
replicaNum
;
++
i
)
{
for
(
int
32_t
i
=
0
;
i
<
pVotesGranted
->
replicaNum
;
++
i
)
{
cJSON_AddItemToArray
(
pReplicas
,
syncUtilRaftId2Json
(
&
(
*
(
pVotesGranted
->
replicas
))[
i
]));
}
int
*
arr
=
(
int
*
)
taosMemoryMalloc
(
sizeof
(
in
t
)
*
pVotesGranted
->
replicaNum
);
for
(
int
i
=
0
;
i
<
pVotesGranted
->
replicaNum
;
++
i
)
{
int
32_t
*
arr
=
(
int32_t
*
)
taosMemoryMalloc
(
sizeof
(
int32_
t
)
*
pVotesGranted
->
replicaNum
);
for
(
int
32_t
i
=
0
;
i
<
pVotesGranted
->
replicaNum
;
++
i
)
{
arr
[
i
]
=
pVotesGranted
->
isGranted
[
i
];
}
cJSON
*
pIsGranted
=
cJSON_CreateIntArray
(
arr
,
pVotesGranted
->
replicaNum
);
...
...
@@ -168,7 +168,7 @@ void votesRespondUpdate(SVotesRespond *pVotesRespond, SSyncNode *pSyncNode) {
bool
votesResponded
(
SVotesRespond
*
pVotesRespond
,
const
SRaftId
*
pRaftId
)
{
bool
ret
=
false
;
for
(
int
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
for
(
int
32_t
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
if
(
syncUtilSameId
(
&
(
*
pVotesRespond
->
replicas
)[
i
],
pRaftId
)
&&
pVotesRespond
->
isRespond
[
i
])
{
ret
=
true
;
break
;
...
...
@@ -183,7 +183,7 @@ void votesRespondAdd(SVotesRespond *pVotesRespond, const SyncRequestVoteReply *p
return
;
}
for
(
int
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
for
(
int
32_t
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
if
(
syncUtilSameId
(
&
((
*
(
pVotesRespond
->
replicas
))[
i
]),
&
pMsg
->
srcId
))
{
// ASSERT(pVotesRespond->isRespond[i] == false);
pVotesRespond
->
isRespond
[
i
]
=
true
;
...
...
@@ -197,7 +197,7 @@ void votesRespondReset(SVotesRespond *pVotesRespond, SyncTerm term) {
pVotesRespond
->
term
=
term
;
memset
(
pVotesRespond
->
isRespond
,
0
,
sizeof
(
pVotesRespond
->
isRespond
));
/*
for (int i = 0; i < pVotesRespond->replicaNum; ++i) {
for (int
32_t
i = 0; i < pVotesRespond->replicaNum; ++i) {
pVotesRespond->isRespond[i] = false;
}
*/
...
...
@@ -211,12 +211,12 @@ cJSON *votesRespond2Json(SVotesRespond *pVotesRespond) {
cJSON_AddNumberToObject
(
pRoot
,
"replicaNum"
,
pVotesRespond
->
replicaNum
);
cJSON
*
pReplicas
=
cJSON_CreateArray
();
cJSON_AddItemToObject
(
pRoot
,
"replicas"
,
pReplicas
);
for
(
int
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
for
(
int
32_t
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
cJSON_AddItemToArray
(
pReplicas
,
syncUtilRaftId2Json
(
&
(
*
(
pVotesRespond
->
replicas
))[
i
]));
}
int
respondNum
=
0
;
int
*
arr
=
(
int
*
)
taosMemoryMalloc
(
sizeof
(
in
t
)
*
pVotesRespond
->
replicaNum
);
for
(
int
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
int
32_t
respondNum
=
0
;
int
32_t
*
arr
=
(
int32_t
*
)
taosMemoryMalloc
(
sizeof
(
int32_
t
)
*
pVotesRespond
->
replicaNum
);
for
(
int
32_t
i
=
0
;
i
<
pVotesRespond
->
replicaNum
;
++
i
)
{
arr
[
i
]
=
pVotesRespond
->
isRespond
[
i
];
if
(
pVotesRespond
->
isRespond
[
i
])
{
respondNum
++
;
...
...
source/libs/sync/test/syncApplyMsgTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -81,7 +81,7 @@ void test4() {
void
test5
()
{
SyncApplyMsg
*
pMsg
=
createMsg
();
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
syncApplyMsg2RpcMsg
(
pMsg
,
&
rpcMsg
);
SyncApplyMsg
*
pMsg2
=
syncApplyMsgFromRpcMsg2
(
&
rpcMsg
);
syncApplyMsgLog2
((
char
*
)
"test5: syncClientRequest2RpcMsg -> syncApplyMsgFromRpcMsg2 "
,
pMsg2
);
...
...
source/libs/sync/test/syncClientRequestBatchTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -59,7 +59,7 @@ void test2() {
uint32_t len = pMsg->bytes;
char * serialized = (char *)taosMemoryMalloc(len);
syncClientRequestSerialize(pMsg, serialized, len);
SyncClientRequest *pMsg2 = syncClientRequest
Build
(pMsg->dataLen);
SyncClientRequest *pMsg2 = syncClientRequest
Alloc
(pMsg->dataLen);
syncClientRequestDeserialize(serialized, len, pMsg2);
syncClientRequestLog2((char *)"test2: syncClientRequestSerialize -> syncClientRequestDeserialize ", pMsg2);
...
...
source/libs/sync/test/syncClientRequestTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -21,7 +21,7 @@ SyncClientRequest *createMsg() {
rpcMsg
.
contLen
=
20
;
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
strcpy
((
char
*
)
rpcMsg
.
pCont
,
"hello rpc"
);
SyncClientRequest
*
pMsg
=
syncClientRequestBuild
2
(
&
rpcMsg
,
123
,
true
,
1000
);
SyncClientRequest
*
pMsg
=
syncClientRequestBuild
(
&
rpcMsg
,
123
,
true
,
1000
);
rpcFreeCont
(
rpcMsg
.
pCont
);
return
pMsg
;
}
...
...
@@ -37,7 +37,7 @@ void test2() {
uint32_t
len
=
pMsg
->
bytes
;
char
*
serialized
=
(
char
*
)
taosMemoryMalloc
(
len
);
syncClientRequestSerialize
(
pMsg
,
serialized
,
len
);
SyncClientRequest
*
pMsg2
=
syncClientRequest
Build
(
pMsg
->
dataLen
);
SyncClientRequest
*
pMsg2
=
syncClientRequest
Alloc
(
pMsg
->
dataLen
);
syncClientRequestDeserialize
(
serialized
,
len
,
pMsg2
);
syncClientRequestLog2
((
char
*
)
"test2: syncClientRequestSerialize -> syncClientRequestDeserialize "
,
pMsg2
);
...
...
@@ -60,7 +60,7 @@ void test3() {
void
test4
()
{
SyncClientRequest
*
pMsg
=
createMsg
();
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
syncClientRequest2RpcMsg
(
pMsg
,
&
rpcMsg
);
SyncClientRequest
*
pMsg2
=
(
SyncClientRequest
*
)
taosMemoryMalloc
(
rpcMsg
.
contLen
);
syncClientRequestFromRpcMsg
(
&
rpcMsg
,
pMsg2
);
...
...
@@ -73,7 +73,7 @@ void test4() {
void
test5
()
{
SyncClientRequest
*
pMsg
=
createMsg
();
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
syncClientRequest2RpcMsg
(
pMsg
,
&
rpcMsg
);
SyncClientRequest
*
pMsg2
=
syncClientRequestFromRpcMsg2
(
&
rpcMsg
);
syncClientRequestLog2
((
char
*
)
"test5: syncClientRequest2RpcMsg -> syncClientRequestFromRpcMsg2 "
,
pMsg2
);
...
...
source/libs/sync/test/syncEncodeTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -102,12 +102,12 @@ SRpcMsg *step0() {
}
SyncClientRequest
*
step1
(
const
SRpcMsg
*
pMsg
)
{
SyncClientRequest
*
pRetMsg
=
syncClientRequestBuild
2
(
pMsg
,
123
,
true
,
1000
);
SyncClientRequest
*
pRetMsg
=
syncClientRequestBuild
(
pMsg
,
123
,
true
,
1000
);
return
pRetMsg
;
}
SRpcMsg
*
step2
(
const
SyncClientRequest
*
pMsg
)
{
SRpcMsg
*
pRetMsg
=
(
SRpcMsg
*
)
taosMemory
Malloc
(
sizeof
(
SRpcMsg
)
);
SRpcMsg
*
pRetMsg
=
(
SRpcMsg
*
)
taosMemory
Calloc
(
sizeof
(
SRpcMsg
),
1
);
syncClientRequest2RpcMsg
(
pMsg
,
pRetMsg
);
return
pRetMsg
;
}
...
...
source/libs/sync/test/syncEntryTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -32,7 +32,7 @@ void test1() {
}
void
test2
()
{
SyncClientRequest
*
pSyncMsg
=
syncClientRequest
Build
(
10
);
SyncClientRequest
*
pSyncMsg
=
syncClientRequest
Alloc
(
10
);
pSyncMsg
->
originalRpcType
=
33
;
pSyncMsg
->
seqNum
=
11
;
pSyncMsg
->
isWeak
=
1
;
...
...
@@ -46,7 +46,7 @@ void test2() {
}
void
test3
()
{
SyncClientRequest
*
pSyncMsg
=
syncClientRequest
Build
(
10
);
SyncClientRequest
*
pSyncMsg
=
syncClientRequest
Alloc
(
10
);
pSyncMsg
->
originalRpcType
=
33
;
pSyncMsg
->
seqNum
=
11
;
pSyncMsg
->
isWeak
=
1
;
...
...
source/libs/sync/test/syncRpcMsgTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -47,7 +47,7 @@ SyncClientRequest *createSyncClientRequest() {
rpcMsg
.
contLen
=
20
;
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
strcpy
((
char
*
)
rpcMsg
.
pCont
,
"hello rpc"
);
SyncClientRequest
*
pMsg
=
syncClientRequestBuild
2
(
&
rpcMsg
,
123
,
true
,
1000
);
SyncClientRequest
*
pMsg
=
syncClientRequestBuild
(
&
rpcMsg
,
123
,
true
,
1000
);
return
pMsg
;
}
...
...
@@ -156,7 +156,7 @@ void test7() {
void
test8
()
{
SyncClientRequest
*
pMsg
=
createSyncClientRequest
();
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
syncClientRequest2RpcMsg
(
pMsg
,
&
rpcMsg
);
syncRpcMsgLog2
((
char
*
)
"test8"
,
&
rpcMsg
);
syncClientRequestDestroy
(
pMsg
);
...
...
source/libs/sync/test/syncSnapshotTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -162,7 +162,7 @@ SRpcMsg *step0() {
}
SyncClientRequest
*
step1
(
const
SRpcMsg
*
pMsg
)
{
SyncClientRequest
*
pRetMsg
=
syncClientRequestBuild
2
(
pMsg
,
123
,
true
,
1000
);
SyncClientRequest
*
pRetMsg
=
syncClientRequestBuild
(
pMsg
,
123
,
true
,
1000
);
return
pRetMsg
;
}
...
...
@@ -206,7 +206,7 @@ int main(int argc, char **argv) {
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
SyncClientRequest
*
pSyncClientRequest
=
pMsg1
;
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
syncClientRequest2RpcMsg
(
pSyncClientRequest
,
&
rpcMsg
);
gSyncNode
->
syncEqMsg
(
gSyncNode
->
msgcb
,
&
rpcMsg
);
...
...
source/libs/sync/test/syncWriteTest.cpp
浏览文件 @
4a0468aa
...
...
@@ -140,7 +140,7 @@ SRpcMsg *step0() {
}
SyncClientRequest
*
step1
(
const
SRpcMsg
*
pMsg
)
{
SyncClientRequest
*
pRetMsg
=
syncClientRequestBuild
2
(
pMsg
,
123
,
true
,
1000
);
SyncClientRequest
*
pRetMsg
=
syncClientRequestBuild
(
pMsg
,
123
,
true
,
1000
);
return
pRetMsg
;
}
...
...
@@ -181,7 +181,7 @@ int main(int argc, char **argv) {
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
SyncClientRequest
*
pSyncClientRequest
=
pMsg1
;
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
syncClientRequest2RpcMsg
(
pSyncClientRequest
,
&
rpcMsg
);
gSyncNode
->
syncEqMsg
(
gSyncNode
->
msgcb
,
&
rpcMsg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录