Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
de644c7d
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,发现更多精彩内容 >>
提交
de644c7d
编写于
7月 08, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: adjust logs
上级
a5e8ddbc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
19 deletion
+20
-19
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+1
-1
source/libs/sync/src/syncElection.c
source/libs/sync/src/syncElection.c
+3
-2
source/libs/wal/src/walRead.c
source/libs/wal/src/walRead.c
+15
-15
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+1
-1
未找到文件。
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
de644c7d
...
...
@@ -167,7 +167,7 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
if
(
pMsg
==
NULL
)
return
-
1
;
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
dTrace
(
"msg:%p, is created and will put int
%s queue"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p, is created and will put int
o %s queue, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
)
);
return
mmPutMsgToWorker
(
pMgmt
,
pWorker
,
pMsg
);
}
...
...
source/libs/sync/src/syncElection.c
浏览文件 @
de644c7d
...
...
@@ -123,8 +123,9 @@ int32_t syncNodeRequestVote(SSyncNode* pSyncNode, const SRaftId* destRaftId, con
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
destRaftId
->
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-request-vote to %s:%d, {term:%"
PRIu64
", last-index:%"
PRId64
", last-term:%"
PRIu64
"}"
,
pSyncNode
->
vgId
,
host
,
port
,
pMsg
->
term
,
pMsg
->
lastLogTerm
,
pMsg
->
lastLogIndex
);
sDebug
(
"vgId:%d, send sync-request-vote to %s:%d, {term:%"
PRIu64
", last-index:%"
PRId64
", last-term:%"
PRIu64
"}"
,
pSyncNode
->
vgId
,
host
,
port
,
pMsg
->
term
,
pMsg
->
lastLogTerm
,
pMsg
->
lastLogIndex
);
}
while
(
0
);
SRpcMsg
rpcMsg
;
...
...
source/libs/wal/src/walRead.c
浏览文件 @
de644c7d
...
...
@@ -94,7 +94,7 @@ static int64_t walReadSeekFilePos(SWalReader *pRead, int64_t fileFirstVer, int64
ret
=
taosLSeekFile
(
pIdxTFile
,
offset
,
SEEK_SET
);
if
(
ret
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d, failed to seek idx file,
ver
:%"
PRId64
", pos:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
wError
(
"vgId:%d, failed to seek idx file,
index
:%"
PRId64
", pos:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
offset
,
terrstr
());
return
-
1
;
}
...
...
@@ -115,7 +115,7 @@ static int64_t walReadSeekFilePos(SWalReader *pRead, int64_t fileFirstVer, int64
ret
=
taosLSeekFile
(
pLogTFile
,
entry
.
offset
,
SEEK_SET
);
if
(
ret
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d, failed to seek log file,
ver
:%"
PRId64
", pos:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
wError
(
"vgId:%d, failed to seek log file,
index
:%"
PRId64
", pos:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
entry
.
offset
,
terrstr
());
return
-
1
;
}
...
...
@@ -156,7 +156,7 @@ static int32_t walReadSeekVer(SWalReader *pRead, int64_t ver) {
return
0
;
}
if
(
ver
>
pWal
->
vers
.
lastVer
||
ver
<
pWal
->
vers
.
firstVer
)
{
wError
(
"vgId:$d, invalid
version:%"
PRId64
", first ver:%"
PRId64
", last ver
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
wError
(
"vgId:$d, invalid
index:%"
PRId64
", first index:%"
PRId64
", last index
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
pWal
->
vers
.
firstVer
,
pWal
->
vers
.
lastVer
);
terrno
=
TSDB_CODE_WAL_LOG_NOT_EXIST
;
return
-
1
;
...
...
@@ -224,10 +224,10 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
if
(
pReadHead
->
bodyLen
!=
taosReadFile
(
pRead
->
pLogFile
,
pReadHead
->
body
,
pReadHead
->
bodyLen
))
{
if
(
pReadHead
->
bodyLen
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request version
:%"
PRId64
", since %s"
,
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request index
:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
,
tstrerror
(
terrno
));
}
else
{
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request version
:%"
PRId64
", since file corrupted"
,
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request index
:%"
PRId64
", since file corrupted"
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
);
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
}
...
...
@@ -237,7 +237,7 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
}
if
(
pReadHead
->
version
!=
ver
)
{
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request version
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request index
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
);
pRead
->
curVersion
=
-
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
...
...
@@ -246,7 +246,7 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
}
if
(
walValidBodyCksum
(
pRead
->
pHead
)
!=
0
)
{
wError
(
"vgId:%d, wal fetch body error:
%
%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
->
curVersion
=
-
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
ASSERT
(
0
);
...
...
@@ -297,7 +297,7 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
code
=
walValidHeadCksum
(
pHead
);
if
(
code
!=
0
)
{
wError
(
"vgId:%d, unexpected wal log
version
:%"
PRId64
", since head checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
wError
(
"vgId:%d, unexpected wal log
index
:%"
PRId64
", since head checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
return
-
1
;
...
...
@@ -344,7 +344,7 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
}
if
(
pReadHead
->
version
!=
ver
)
{
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request version
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
wError
(
"vgId:%d, wal fetch body error:
%"
PRId64
", read request index
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
);
pRead
->
curVersion
=
-
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
...
...
@@ -352,7 +352,7 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
}
if
(
walValidBodyCksum
(
*
ppHead
)
!=
0
)
{
wError
(
"vgId:%d, wal fetch body error:
%
%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
->
curVersion
=
-
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
return
-
1
;
...
...
@@ -389,13 +389,13 @@ int32_t walReadVer(SWalReader *pRead, int64_t ver) {
// TODO: check wal life
if
(
pRead
->
curVersion
!=
ver
)
{
if
(
walReadSeekVer
(
pRead
,
ver
)
<
0
)
{
wError
(
"vgId:%d, unexpected wal log
version
:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
terrstr
());
wError
(
"vgId:%d, unexpected wal log
index
:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
terrstr
());
return
-
1
;
}
}
if
(
ver
>
pRead
->
pWal
->
vers
.
lastVer
||
ver
<
pRead
->
pWal
->
vers
.
firstVer
)
{
wError
(
"vgId:%d, invalid
version:%"
PRId64
", first ver:%"
PRId64
", last ver
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
wError
(
"vgId:%d, invalid
index:%"
PRId64
", first index:%"
PRId64
", last index
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
,
pRead
->
pWal
->
vers
.
firstVer
,
pRead
->
pWal
->
vers
.
lastVer
);
terrno
=
TSDB_CODE_WAL_LOG_NOT_EXIST
;
return
-
1
;
...
...
@@ -416,7 +416,7 @@ int32_t walReadVer(SWalReader *pRead, int64_t ver) {
code
=
walValidHeadCksum
(
pRead
->
pHead
);
if
(
code
!=
0
)
{
wError
(
"vgId:%d, unexpected wal log
version
:%"
PRId64
", since head checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
wError
(
"vgId:%d, unexpected wal log
index
:%"
PRId64
", since head checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
return
-
1
;
...
...
@@ -444,7 +444,7 @@ int32_t walReadVer(SWalReader *pRead, int64_t ver) {
}
if
(
pRead
->
pHead
->
head
.
version
!=
ver
)
{
wError
(
"vgId:%d, unexpected wal log
version:%"
PRId64
", read request version
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
wError
(
"vgId:%d, unexpected wal log
index:%"
PRId64
", read request index
:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
);
pRead
->
curVersion
=
-
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
...
...
@@ -453,7 +453,7 @@ int32_t walReadVer(SWalReader *pRead, int64_t ver) {
code
=
walValidBodyCksum
(
pRead
->
pHead
);
if
(
code
!=
0
)
{
wError
(
"vgId:%d, unexpected wal log
version
:%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
wError
(
"vgId:%d, unexpected wal log
index
:%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
->
curVersion
=
-
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
...
...
source/libs/wal/src/walWrite.c
浏览文件 @
de644c7d
...
...
@@ -318,7 +318,7 @@ int walRoll(SWal *pWal) {
static
int
walWriteIndex
(
SWal
*
pWal
,
int64_t
ver
,
int64_t
offset
)
{
SWalIdxEntry
entry
=
{.
ver
=
ver
,
.
offset
=
offset
};
int64_t
idxOffset
=
taosLSeekFile
(
pWal
->
pWriteIdxTFile
,
0
,
SEEK_END
);
wDebug
(
"vgId:%d, write index,
ver
:%"
PRId64
", offset:%"
PRId64
", at %"
PRId64
,
pWal
->
cfg
.
vgId
,
ver
,
offset
,
wDebug
(
"vgId:%d, write index,
index
:%"
PRId64
", offset:%"
PRId64
", at %"
PRId64
,
pWal
->
cfg
.
vgId
,
ver
,
offset
,
idxOffset
);
int64_t
size
=
taosWriteFile
(
pWal
->
pWriteIdxTFile
,
&
entry
,
sizeof
(
SWalIdxEntry
));
if
(
size
!=
sizeof
(
SWalIdxEntry
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录