Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9a9e93b6
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看板
提交
9a9e93b6
编写于
1月 09, 2023
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: compile error in mac
上级
cdcb3364
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
32 addition
and
32 deletion
+32
-32
source/libs/sync/test/syncLocalCmdTest.cpp
source/libs/sync/test/syncLocalCmdTest.cpp
+2
-2
source/libs/sync/test/syncRaftStoreTest.cpp
source/libs/sync/test/syncRaftStoreTest.cpp
+20
-20
source/libs/sync/test/syncSnapshotReceiverTest.cpp
source/libs/sync/test/syncSnapshotReceiverTest.cpp
+1
-1
source/libs/sync/test/syncSnapshotSenderTest.cpp
source/libs/sync/test/syncSnapshotSenderTest.cpp
+1
-1
source/libs/sync/test/sync_test_lib/src/syncMainDebug.c
source/libs/sync/test/sync_test_lib/src/syncMainDebug.c
+1
-1
source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c
source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c
+4
-4
source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c
source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c
+2
-2
source/util/src/tlog.c
source/util/src/tlog.c
+1
-1
未找到文件。
source/libs/sync/test/syncLocalCmdTest.cpp
浏览文件 @
9a9e93b6
...
...
@@ -16,8 +16,8 @@ SyncLocalCmd *createMsg() {
pMsg
->
srcId
.
vgId
=
100
;
pMsg
->
destId
.
addr
=
syncUtilAddr2U64
(
"127.0.0.1"
,
5678
);
pMsg
->
destId
.
vgId
=
100
;
pMsg
->
sdNewTerm
=
123
;
pMsg
->
fcIndex
=
456
;
//
pMsg->sdNewTerm = 123;
//
pMsg->fcIndex = 456;
pMsg
->
cmd
=
SYNC_LOCAL_CMD_STEP_DOWN
;
return
pMsg
;
...
...
source/libs/sync/test/syncRaftStoreTest.cpp
浏览文件 @
9a9e93b6
...
...
@@ -33,35 +33,35 @@ int main() {
initRaftId
();
SRaftStore
*
pRaftStore
=
raftStoreOpen
(
"./test_raft_store.json"
);
assert
(
pRaftStore
!=
NULL
);
raftStoreLog2
((
char
*
)
"==raftStoreOpen=="
,
pRaftStore
);
//
SRaftStore* pRaftStore = raftStoreOpen("./test_raft_store.json");
//
assert(pRaftStore != NULL);
//
raftStoreLog2((char*)"==raftStoreOpen==", pRaftStore);
raftStoreSetTerm
(
pRaftStore
,
100
);
raftStoreLog2
((
char
*
)
"==raftStoreSetTerm=="
,
pRaftStore
);
//
raftStoreSetTerm(pRaftStore, 100);
//
raftStoreLog2((char*)"==raftStoreSetTerm==", pRaftStore);
raftStoreVote
(
pRaftStore
,
&
ids
[
0
]);
raftStoreLog2
((
char
*
)
"==raftStoreVote=="
,
pRaftStore
);
//
raftStoreVote(pRaftStore, &ids[0]);
//
raftStoreLog2((char*)"==raftStoreVote==", pRaftStore);
raftStoreClearVote
(
pRaftStore
);
raftStoreLog2
((
char
*
)
"==raftStoreClearVote=="
,
pRaftStore
);
//
raftStoreClearVote(pRaftStore);
//
raftStoreLog2((char*)"==raftStoreClearVote==", pRaftStore);
raftStoreVote
(
pRaftStore
,
&
ids
[
1
]);
raftStoreLog2
((
char
*
)
"==raftStoreVote=="
,
pRaftStore
);
//
raftStoreVote(pRaftStore, &ids[1]);
//
raftStoreLog2((char*)"==raftStoreVote==", pRaftStore);
raftStoreNextTerm
(
pRaftStore
);
raftStoreLog2
((
char
*
)
"==raftStoreNextTerm=="
,
pRaftStore
);
//
raftStoreNextTerm(pRaftStore);
//
raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore);
raftStoreNextTerm
(
pRaftStore
);
raftStoreLog2
((
char
*
)
"==raftStoreNextTerm=="
,
pRaftStore
);
//
raftStoreNextTerm(pRaftStore);
//
raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore);
raftStoreNextTerm
(
pRaftStore
);
raftStoreLog2
((
char
*
)
"==raftStoreNextTerm=="
,
pRaftStore
);
//
raftStoreNextTerm(pRaftStore);
//
raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore);
raftStoreNextTerm
(
pRaftStore
);
raftStoreLog2
((
char
*
)
"==raftStoreNextTerm=="
,
pRaftStore
);
//
raftStoreNextTerm(pRaftStore);
//
raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore);
raftStoreClose
(
pRaftStore
);
//
raftStoreClose(pRaftStore);
return
0
;
}
source/libs/sync/test/syncSnapshotReceiverTest.cpp
浏览文件 @
9a9e93b6
...
...
@@ -29,7 +29,7 @@ int32_t SnapshotDoWrite(struct SSyncFSM* pFsm, void* pWriter, void* pBuf, int32_
SSyncSnapshotReceiver
*
createReceiver
()
{
SSyncNode
*
pSyncNode
=
(
SSyncNode
*
)
taosMemoryMalloc
(
sizeof
(
*
pSyncNode
));
pSyncNode
->
pRaftStore
=
(
SRaftStore
*
)
taosMemoryMalloc
(
sizeof
(
*
(
pSyncNode
->
pRaftStore
)));
//
pSyncNode->pRaftStore = (SRaftStore*)taosMemoryMalloc(sizeof(*(pSyncNode->pRaftStore)));
pSyncNode
->
pFsm
=
(
SSyncFSM
*
)
taosMemoryMalloc
(
sizeof
(
*
(
pSyncNode
->
pFsm
)));
#if 0
...
...
source/libs/sync/test/syncSnapshotSenderTest.cpp
浏览文件 @
9a9e93b6
...
...
@@ -29,7 +29,7 @@ int32_t SnapshotDoWrite(struct SSyncFSM* pFsm, void* pWriter, void* pBuf, int32_
SSyncSnapshotSender
*
createSender
()
{
SSyncNode
*
pSyncNode
=
(
SSyncNode
*
)
taosMemoryMalloc
(
sizeof
(
*
pSyncNode
));
pSyncNode
->
pRaftStore
=
(
SRaftStore
*
)
taosMemoryMalloc
(
sizeof
(
*
(
pSyncNode
->
pRaftStore
)));
//
pSyncNode->pRaftStore = (SRaftStore*)taosMemoryMalloc(sizeof(*(pSyncNode->pRaftStore)));
pSyncNode
->
pFsm
=
(
SSyncFSM
*
)
taosMemoryMalloc
(
sizeof
(
*
(
pSyncNode
->
pFsm
)));
#if 0
...
...
source/libs/sync/test/sync_test_lib/src/syncMainDebug.c
浏览文件 @
9a9e93b6
...
...
@@ -80,7 +80,7 @@ cJSON* syncNode2Json(const SSyncNode* pSyncNode) {
// tla+ server vars
cJSON_AddNumberToObject
(
pRoot
,
"state"
,
pSyncNode
->
state
);
cJSON_AddStringToObject
(
pRoot
,
"state_str"
,
syncStr
(
pSyncNode
->
state
));
cJSON_AddItemToObject
(
pRoot
,
"pRaftStore"
,
raftStore2Json
(
&
pSyncNode
.
raftStore
));
//
cJSON_AddItemToObject(pRoot, "pRaftStore", raftStore2Json(&pSyncNode.raftStore));
// tla+ candidate vars
cJSON_AddItemToObject
(
pRoot
,
"pVotesGranted"
,
voteGranted2Json
(
pSyncNode
->
pVotesGranted
));
...
...
source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c
浏览文件 @
9a9e93b6
...
...
@@ -2858,11 +2858,11 @@ cJSON* syncLocalCmd2Json(const SyncLocalCmd* pMsg) {
cJSON_AddNumberToObject
(
pRoot
,
"cmd"
,
pMsg
->
cmd
);
snprintf
(
u64buf
,
sizeof
(
u64buf
),
"%"
PRIu64
,
pMsg
->
sdNewTerm
);
cJSON_AddStringToObject
(
pRoot
,
"sd-new-term"
,
u64buf
);
//
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->sdNewTerm);
//
cJSON_AddStringToObject(pRoot, "sd-new-term", u64buf);
snprintf
(
u64buf
,
sizeof
(
u64buf
),
"%"
PRId64
,
pMsg
->
fcIndex
);
cJSON_AddStringToObject
(
pRoot
,
"fc-index"
,
u64buf
);
//
snprintf(u64buf, sizeof(u64buf), "%" PRId64, pMsg->fcIndex);
//
cJSON_AddStringToObject(pRoot, "fc-index", u64buf);
}
cJSON
*
pJson
=
cJSON_CreateObject
();
...
...
source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c
浏览文件 @
9a9e93b6
...
...
@@ -41,8 +41,8 @@ cJSON *raftStore2Json(SRaftStore *pRaftStore) {
cJSON_AddNumberToObject
(
pVoteFor
,
"vgId"
,
pRaftStore
->
voteFor
.
vgId
);
cJSON_AddItemToObject
(
pRoot
,
"voteFor"
,
pVoteFor
);
int
hasVoted
=
raftStoreHasVoted
(
pRaftStore
);
cJSON_AddNumberToObject
(
pRoot
,
"hasVoted"
,
hasVoted
);
//
int hasVoted = raftStoreHasVoted(pRaftStore);
//
cJSON_AddNumberToObject(pRoot, "hasVoted", hasVoted);
}
cJSON
*
pJson
=
cJSON_CreateObject
();
...
...
source/util/src/tlog.c
浏览文件 @
9a9e93b6
...
...
@@ -1045,7 +1045,7 @@ bool taosAssertRelease(bool condition) {
int32_t
dflag
=
255
;
// tsLogEmbedded ? 255 : uDebugFlag
taosPrintLog
(
flags
,
level
,
dflag
,
"tAssert called in release mode, exit:%d"
,
tsAssert
);
taosPrintTrace
(
flags
,
level
,
dflag
);
taosPrintTrace
(
flags
,
level
,
dflag
,
0
);
if
(
tsAssert
)
{
taosMsleep
(
300
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录