Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8cdd7023
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看板
提交
8cdd7023
编写于
1月 21, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove warnings
上级
ecdb23c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
13 deletion
+13
-13
source/common/src/ttime.c
source/common/src/ttime.c
+4
-4
source/libs/sync/src/raft_handle_vote_message.c
source/libs/sync/src/raft_handle_vote_message.c
+1
-1
source/libs/sync/src/sync.c
source/libs/sync/src/sync.c
+8
-8
未找到文件。
source/common/src/ttime.c
浏览文件 @
8cdd7023
...
...
@@ -100,12 +100,12 @@ int32_t taosParseTime(const char* timestr, int64_t* time, int32_t len, int32_t t
}
else
if
(
checkTzPresent
(
timestr
,
len
))
{
return
parseTimeWithTz
(
timestr
,
time
,
timePrec
,
0
);
}
else
{
return
(
*
parseLocaltimeFp
[
day_light
])(
timestr
,
time
,
timePrec
);
return
(
*
parseLocaltimeFp
[
day_light
])(
(
char
*
)
timestr
,
time
,
timePrec
);
}
}
bool
checkTzPresent
(
const
char
*
str
,
int32_t
len
)
{
char
*
seg
=
forwardToTimeStringEnd
(
str
);
bool
checkTzPresent
(
const
char
*
str
,
int32_t
len
)
{
char
*
seg
=
forwardToTimeStringEnd
((
char
*
)
str
);
int32_t
seg_len
=
len
-
(
int32_t
)(
seg
-
str
);
char
*
c
=
&
seg
[
seg_len
-
1
];
...
...
@@ -267,7 +267,7 @@ int32_t parseTimeWithTz(const char* timestr, int64_t* time, int32_t timePrec, ch
#endif
int64_t
fraction
=
0
;
str
=
forwardToTimeStringEnd
(
timestr
);
str
=
forwardToTimeStringEnd
(
(
char
*
)
timestr
);
if
((
str
[
0
]
==
'Z'
||
str
[
0
]
==
'z'
)
&&
str
[
1
]
==
'\0'
)
{
/* utc time, no millisecond, return directly*/
...
...
source/libs/sync/src/raft_handle_vote_message.c
浏览文件 @
8cdd7023
...
...
@@ -37,7 +37,7 @@ int syncRaftHandleVoteMessage(SSyncRaft* pRaft, const SSyncMessage* pMsg) {
if
(
pRespMsg
==
NULL
)
{
return
0
;
}
syncInfo
(
"[%d:%d] [logterm: %"
PRId64
", index: %"
PRId64
", vote: %d] %s for %d"
\
syncInfo
(
"[%d:%d] [logterm: %"
PRId64
", index: %"
PRId64
", vote: %d] %s for %d"
"[logterm: %"
PRId64
", index: %"
PRId64
"] at term %"
PRId64
""
,
pRaft
->
selfGroupId
,
pRaft
->
selfId
,
lastTerm
,
lastIndex
,
pRaft
->
voteFor
,
grant
?
"grant"
:
"reject"
,
...
...
source/libs/sync/src/sync.c
浏览文件 @
8cdd7023
...
...
@@ -23,8 +23,8 @@ SSyncManager* gSyncManager = NULL;
#define SYNC_ACTIVITY_TIMER 5
#define SYNC_SERVER_WORKER 2
static
void
syncProcessRsp
(
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
static
void
syncProcessReqMsg
(
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
static
void
syncProcessRsp
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
static
void
syncProcessReqMsg
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
static
int
syncInitRpcServer
(
SSyncManager
*
syncManager
,
const
SSyncCluster
*
pSyncCfg
);
static
int
syncInitRpcClient
(
SSyncManager
*
syncManager
);
...
...
@@ -119,7 +119,7 @@ SSyncNode* syncStart(const SSyncInfo* pInfo) {
return
NULL
;
}
pNode
->
syncTimer
=
taosTmrStart
(
syncNodeTick
,
SYNC_TICK_TIMER
,
(
void
*
)
pInfo
->
vgId
,
gSyncManager
->
syncTimerManager
);
pNode
->
syncTimer
=
taosTmrStart
(
syncNodeTick
,
SYNC_TICK_TIMER
,
(
void
*
)
((
int64_t
)
pInfo
->
vgId
)
,
gSyncManager
->
syncTimerManager
);
// start raft
pNode
->
raft
.
pNode
=
pNode
;
...
...
@@ -176,12 +176,12 @@ int32_t syncRemoveNode(SSyncNode syncNode, const SNodeInfo *pNode) {
}
// process rpc rsp message from other sync server
static
void
syncProcessRsp
(
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
static
void
syncProcessRsp
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
}
// process rpc message from other sync server
static
void
syncProcessReqMsg
(
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
static
void
syncProcessReqMsg
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
}
...
...
@@ -195,7 +195,7 @@ static int syncInitRpcServer(SSyncManager* syncManager, const SSyncCluster* pSyn
}
assert
(
pSyncCfg
->
selfIndex
<
pSyncCfg
->
replica
&&
pSyncCfg
->
selfIndex
>=
0
);
const
SNodeInfo
*
pNode
=
&
(
pSyncCfg
->
nodeInfo
[
pSyncCfg
->
replica
]);
char
buffer
[
20
]
=
{
'\0'
};
char
buffer
[
156
]
=
{
'\0'
};
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s:%d"
,
&
(
pNode
->
nodeFqdn
[
0
]),
pNode
->
nodePort
);
size_t
len
=
strlen
(
buffer
);
void
**
ppRpcServer
=
taosHashGet
(
gSyncManager
->
rpcServerTable
,
buffer
,
len
);
...
...
@@ -287,7 +287,7 @@ static void *syncWorkerMain(void *argv) {
}
static
void
syncNodeTick
(
void
*
param
,
void
*
tmrId
)
{
SyncGroupId
vgId
=
(
SyncGroupId
)
param
;
SyncGroupId
vgId
=
(
SyncGroupId
)
((
int64_t
)
param
)
;
SSyncNode
**
ppNode
=
taosHashGet
(
gSyncManager
->
vgroupTable
,
&
vgId
,
sizeof
(
SyncGroupId
*
));
if
(
ppNode
==
NULL
)
{
return
;
...
...
@@ -298,5 +298,5 @@ static void syncNodeTick(void *param, void *tmrId) {
syncRaftTick
(
&
pNode
->
raft
);
pthread_mutex_unlock
(
&
pNode
->
mutex
);
pNode
->
syncTimer
=
taosTmrStart
(
syncNodeTick
,
SYNC_TICK_TIMER
,
(
void
*
)
pNode
->
vgId
,
gSyncManager
->
syncTimerManager
);
pNode
->
syncTimer
=
taosTmrStart
(
syncNodeTick
,
SYNC_TICK_TIMER
,
(
void
*
)
(
int64_t
)
pNode
->
vgId
,
gSyncManager
->
syncTimerManager
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录