Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
34565eff
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
34565eff
编写于
3月 17, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some log for debug
上级
9d024fe4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
30 deletion
+32
-30
src/query/src/queryMain.c
src/query/src/queryMain.c
+2
-2
src/sync/src/syncRetrieve.c
src/sync/src/syncRetrieve.c
+22
-22
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+2
-2
src/vnode/src/vnodeStatus.c
src/vnode/src/vnodeStatus.c
+2
-0
src/vnode/src/vnodeSync.c
src/vnode/src/vnodeSync.c
+3
-3
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+1
-1
未找到文件。
src/query/src/queryMain.c
浏览文件 @
34565eff
...
...
@@ -430,7 +430,7 @@ void qQueryMgmtNotifyClosed(void* pQMgmt) {
}
SQueryMgmt
*
pQueryMgmt
=
pQMgmt
;
q
Debug
(
"vgId:%d, set querymgmt closed, wait for all queries cancelled"
,
pQueryMgmt
->
vgId
);
q
Info
(
"vgId:%d, set querymgmt closed, wait for all queries cancelled"
,
pQueryMgmt
->
vgId
);
pthread_mutex_lock
(
&
pQueryMgmt
->
lock
);
pQueryMgmt
->
closed
=
true
;
...
...
@@ -445,7 +445,7 @@ void qQueryMgmtReOpen(void *pQMgmt) {
}
SQueryMgmt
*
pQueryMgmt
=
pQMgmt
;
q
Debug
(
"vgId:%d, set querymgmt reopen"
,
pQueryMgmt
->
vgId
);
q
Info
(
"vgId:%d, set querymgmt reopen"
,
pQueryMgmt
->
vgId
);
pthread_mutex_lock
(
&
pQueryMgmt
->
lock
);
pQueryMgmt
->
closed
=
false
;
...
...
src/sync/src/syncRetrieve.c
浏览文件 @
34565eff
...
...
@@ -29,7 +29,7 @@ static int32_t syncGetWalVersion(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t
fver
,
wver
;
int32_t
code
=
(
*
pNode
->
getVersionFp
)(
pNode
->
vgId
,
&
fver
,
&
wver
);
if
(
code
!=
0
)
{
s
Debug
(
"%s, vnode is commiting while retrieve, last wver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastWalVer
);
s
Info
(
"%s, vnode is commiting while retrieve, last wver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastWalVer
);
return
-
1
;
}
...
...
@@ -41,12 +41,12 @@ static bool syncIsWalModified(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t
fver
,
wver
;
int32_t
code
=
(
*
pNode
->
getVersionFp
)(
pNode
->
vgId
,
&
fver
,
&
wver
);
if
(
code
!=
0
)
{
s
Debug
(
"%s, vnode is commiting while retrieve, last wver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastWalVer
);
s
Info
(
"%s, vnode is commiting while retrieve, last wver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastWalVer
);
return
true
;
}
if
(
wver
!=
pPeer
->
lastWalVer
)
{
s
Debug
(
"%s, wal is modified while retrieve, wver:%"
PRIu64
", last:%"
PRIu64
,
pPeer
->
id
,
wver
,
pPeer
->
lastWalVer
);
s
Info
(
"%s, wal is modified while retrieve, wver:%"
PRIu64
", last:%"
PRIu64
,
pPeer
->
id
,
wver
,
pPeer
->
lastWalVer
);
return
true
;
}
...
...
@@ -57,7 +57,7 @@ static int32_t syncGetFileVersion(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t
fver
,
wver
;
int32_t
code
=
(
*
pNode
->
getVersionFp
)(
pNode
->
vgId
,
&
fver
,
&
wver
);
if
(
code
!=
0
)
{
s
Debug
(
"%s, vnode is commiting while get fver for retrieve, last fver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastFileVer
);
s
Info
(
"%s, vnode is commiting while get fver for retrieve, last fver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastFileVer
);
return
-
1
;
}
...
...
@@ -69,13 +69,13 @@ static bool syncAreFilesModified(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t
fver
,
wver
;
int32_t
code
=
(
*
pNode
->
getVersionFp
)(
pNode
->
vgId
,
&
fver
,
&
wver
);
if
(
code
!=
0
)
{
s
Debug
(
"%s, vnode is commiting while retrieve, last fver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastFileVer
);
s
Info
(
"%s, vnode is commiting while retrieve, last fver:%"
PRIu64
,
pPeer
->
id
,
pPeer
->
lastFileVer
);
pPeer
->
fileChanged
=
1
;
return
true
;
}
if
(
fver
!=
pPeer
->
lastFileVer
)
{
s
Debug
(
"%s, files are modified while retrieve, fver:%"
PRIu64
", last:%"
PRIu64
,
pPeer
->
id
,
fver
,
pPeer
->
lastFileVer
);
s
Info
(
"%s, files are modified while retrieve, fver:%"
PRIu64
", last:%"
PRIu64
,
pPeer
->
id
,
fver
,
pPeer
->
lastFileVer
);
pPeer
->
fileChanged
=
1
;
return
true
;
}
...
...
@@ -143,13 +143,13 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) {
}
if
(
ret
==
0
)
{
s
Debug
(
"sfd:%d, read to the end of file, ret:%d"
,
sfd
,
ret
);
s
Info
(
"sfd:%d, read to the end of file, ret:%d"
,
sfd
,
ret
);
return
0
;
}
if
(
ret
!=
sizeof
(
SWalHead
))
{
// file is not at end yet, it shall be reloaded
s
Debug
(
"sfd:%d, a partial wal head is read out, ret:%d"
,
sfd
,
ret
);
s
Info
(
"sfd:%d, a partial wal head is read out, ret:%d"
,
sfd
,
ret
);
return
0
;
}
...
...
@@ -163,7 +163,7 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) {
if
(
ret
!=
pHead
->
len
)
{
// file is not at end yet, it shall be reloaded
s
Debug
(
"sfd:%d, a partial wal conetnt is read out, ret:%d"
,
sfd
,
ret
);
s
Info
(
"sfd:%d, a partial wal conetnt is read out, ret:%d"
,
sfd
,
ret
);
return
0
;
}
...
...
@@ -184,7 +184,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
return
-
1
;
}
s
Debug
(
"%s, retrieve last wal:%s, offset:%"
PRId64
" fver:%"
PRIu64
,
pPeer
->
id
,
name
,
offset
,
fversion
);
s
Info
(
"%s, retrieve last wal:%s, offset:%"
PRId64
" fver:%"
PRIu64
,
pPeer
->
id
,
name
,
offset
,
fversion
);
SWalHead
*
pHead
=
malloc
(
SYNC_MAX_SIZE
);
int64_t
bytes
=
0
;
...
...
@@ -198,7 +198,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
if
(
code
==
0
)
{
code
=
bytes
;
s
Debug
(
"%s, read to the end of wal, bytes:%"
PRId64
,
pPeer
->
id
,
bytes
);
s
Info
(
"%s, read to the end of wal, bytes:%"
PRId64
,
pPeer
->
id
,
bytes
);
break
;
}
...
...
@@ -217,7 +217,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
if
(
pHead
->
version
>=
fversion
&&
fversion
>
0
)
{
code
=
0
;
s
Debug
(
"%s, retrieve wal finished, hver:%"
PRIu64
" fver:%"
PRIu64
,
pPeer
->
id
,
pHead
->
version
,
fversion
);
s
Info
(
"%s, retrieve wal finished, hver:%"
PRIu64
" fver:%"
PRIu64
,
pPeer
->
id
,
pHead
->
version
,
fversion
);
break
;
}
}
...
...
@@ -237,7 +237,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
// get full path to wal file
snprintf
(
fname
,
sizeof
(
fname
),
"%s/%s"
,
pNode
->
path
,
wname
);
s
Debug
(
"%s, start to retrieve last wal:%s"
,
pPeer
->
id
,
fname
);
s
Info
(
"%s, start to retrieve last wal:%s"
,
pPeer
->
id
,
fname
);
while
(
1
)
{
if
(
syncAreFilesModified
(
pNode
,
pPeer
))
return
-
1
;
...
...
@@ -245,7 +245,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
int64_t
bytes
=
syncRetrieveLastWal
(
pPeer
,
fname
,
fversion
,
offset
);
if
(
bytes
<
0
)
{
s
Debug
(
"%s, failed to retrieve last wal, bytes:%"
PRId64
,
pPeer
->
id
,
bytes
);
s
Info
(
"%s, failed to retrieve last wal, bytes:%"
PRId64
,
pPeer
->
id
,
bytes
);
return
bytes
;
}
...
...
@@ -257,13 +257,13 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
if
(
fversion
==
0
)
{
pPeer
->
sstatus
=
TAOS_SYNC_STATUS_CACHE
;
// start to forward pkt
fversion
=
nodeVersion
;
// must read data to fversion
s
Debug
(
"%s, set sstatus:%s and fver:%"
PRIu64
,
pPeer
->
id
,
syncStatus
[
pPeer
->
sstatus
],
fversion
);
s
Info
(
"%s, set sstatus:%s and fver:%"
PRIu64
,
pPeer
->
id
,
syncStatus
[
pPeer
->
sstatus
],
fversion
);
}
}
// if all data up to fversion is read out, it is over
if
(
pPeer
->
sversion
>=
fversion
&&
fversion
>
0
)
{
s
Debug
(
"%s, data up to fver:%"
PRIu64
" has been read out, bytes:%"
PRId64
" sver:%"
PRIu64
,
pPeer
->
id
,
fversion
,
bytes
,
s
Info
(
"%s, data up to fver:%"
PRIu64
" has been read out, bytes:%"
PRId64
" sver:%"
PRIu64
,
pPeer
->
id
,
fversion
,
bytes
,
pPeer
->
sversion
);
return
0
;
}
...
...
@@ -277,7 +277,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
// if bytes > 0, file is updated, or fversion is not reached but file still open, read again
once
=
1
;
offset
+=
bytes
;
s
Debug
(
"%s, continue retrieve last wal, bytes:%"
PRId64
" offset:%"
PRId64
" sver:%"
PRIu64
" fver:%"
PRIu64
,
pPeer
->
id
,
s
Info
(
"%s, continue retrieve last wal, bytes:%"
PRId64
" offset:%"
PRId64
" sver:%"
PRIu64
" fver:%"
PRIu64
,
pPeer
->
id
,
bytes
,
offset
,
pPeer
->
sversion
,
fversion
);
}
...
...
@@ -303,7 +303,7 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) {
if
(
wname
[
0
]
==
0
)
{
// no wal file
code
=
0
;
s
Debug
(
"%s, no wal file anymore"
,
pPeer
->
id
);
s
Info
(
"%s, no wal file anymore"
,
pPeer
->
id
);
break
;
}
...
...
@@ -320,12 +320,12 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) {
struct
stat
fstat
;
if
(
stat
(
fname
,
&
fstat
)
<
0
)
{
code
=
-
1
;
s
Debug
(
"%s, failed to stat wal:%s for retrieve since %s, code:0x%"
PRIx64
,
pPeer
->
id
,
fname
,
strerror
(
errno
),
code
);
s
Info
(
"%s, failed to stat wal:%s for retrieve since %s, code:0x%"
PRIx64
,
pPeer
->
id
,
fname
,
strerror
(
errno
),
code
);
break
;
}
size
=
fstat
.
st_size
;
s
Debug
(
"%s, retrieve wal:%s size:%d"
,
pPeer
->
id
,
fname
,
size
);
s
Info
(
"%s, retrieve wal:%s size:%d"
,
pPeer
->
id
,
fname
,
size
);
int32_t
sfd
=
open
(
fname
,
O_RDONLY
|
O_BINARY
);
if
(
sfd
<
0
)
{
...
...
@@ -374,7 +374,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) {
sError
(
"%s, failed to send sync-data msg since %s, tranId:%u"
,
pPeer
->
id
,
strerror
(
errno
),
msg
.
tranId
);
return
-
1
;
}
s
Debug
(
"%s, send sync-data msg to peer, tranId:%u"
,
pPeer
->
id
,
msg
.
tranId
);
s
Info
(
"%s, send sync-data msg to peer, tranId:%u"
,
pPeer
->
id
,
msg
.
tranId
);
SSyncRsp
rsp
;
if
(
taosReadMsg
(
pPeer
->
syncFd
,
&
rsp
,
sizeof
(
SSyncRsp
))
!=
sizeof
(
SSyncRsp
))
{
...
...
@@ -382,7 +382,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) {
return
-
1
;
}
s
Debug
(
"%s, recv sync-data rsp from peer, tranId:%u rsp-tranId:%u"
,
pPeer
->
id
,
msg
.
tranId
,
rsp
.
tranId
);
s
Info
(
"%s, recv sync-data rsp from peer, tranId:%u rsp-tranId:%u"
,
pPeer
->
id
,
msg
.
tranId
,
rsp
.
tranId
);
return
0
;
}
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
34565eff
...
...
@@ -482,7 +482,7 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
if
(
status
==
TSDB_STATUS_COMMIT_START
)
{
pVnode
->
isCommiting
=
1
;
pVnode
->
cversion
=
pVnode
->
version
;
v
Debug
(
"vgId:%d, start commit, fver:%"
PRIu64
" vver:%"
PRIu64
,
pVnode
->
vgId
,
pVnode
->
fversion
,
pVnode
->
version
);
v
Info
(
"vgId:%d, start commit, fver:%"
PRIu64
" vver:%"
PRIu64
,
pVnode
->
vgId
,
pVnode
->
fversion
,
pVnode
->
version
);
if
(
!
vnodeInInitStatus
(
pVnode
))
{
return
walRenew
(
pVnode
->
wal
);
}
...
...
@@ -493,7 +493,7 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
pVnode
->
isCommiting
=
0
;
pVnode
->
isFull
=
0
;
pVnode
->
fversion
=
pVnode
->
cversion
;
v
Debug
(
"vgId:%d, commit over, fver:%"
PRIu64
" vver:%"
PRIu64
,
pVnode
->
vgId
,
pVnode
->
fversion
,
pVnode
->
version
);
v
Info
(
"vgId:%d, commit over, fver:%"
PRIu64
" vver:%"
PRIu64
,
pVnode
->
vgId
,
pVnode
->
fversion
,
pVnode
->
version
);
if
(
!
vnodeInInitStatus
(
pVnode
))
{
walRemoveOneOldFile
(
pVnode
->
wal
);
}
...
...
src/vnode/src/vnodeStatus.c
浏览文件 @
34565eff
...
...
@@ -109,6 +109,8 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode) {
taosMsleep
(
1
);
}
vInfo
(
"vgId:%d, set to reset status"
,
pVnode
->
vgId
);
// release local resources only after cutting off outside connections
qQueryMgmtNotifyClosed
(
pVnode
->
qMgmt
);
vnodeWaitReadCompleted
(
pVnode
);
...
...
src/vnode/src/vnodeSync.c
浏览文件 @
34565eff
...
...
@@ -91,7 +91,7 @@ void vnodeStartSyncFile(int32_t vgId) {
return
;
}
v
Debug
(
"vgId:%d, datafile will be synced"
,
vgId
);
v
Info
(
"vgId:%d, datafile will be synced"
,
vgId
);
vnodeSetResetStatus
(
pVnode
);
vnodeRelease
(
pVnode
);
...
...
@@ -147,7 +147,7 @@ int32_t vnodeGetVersion(int32_t vgId, uint64_t *fver, uint64_t *wver) {
int32_t
code
=
0
;
if
(
pVnode
->
isCommiting
)
{
v
Debug
(
"vgId:%d, vnode is commiting while get version"
,
vgId
);
v
Info
(
"vgId:%d, vnode is commiting while get version"
,
vgId
);
code
=
-
1
;
}
else
{
*
fver
=
pVnode
->
fversion
;
...
...
@@ -168,7 +168,7 @@ int32_t vnodeResetVersion(int32_t vgId, uint64_t fver) {
pVnode
->
fversion
=
fver
;
pVnode
->
version
=
fver
;
walResetVersion
(
pVnode
->
wal
,
fver
);
v
Debug
(
"vgId:%d, version reset to %"
PRIu64
,
vgId
,
fver
);
v
Info
(
"vgId:%d, version reset to %"
PRIu64
,
vgId
,
fver
);
vnodeRelease
(
pVnode
);
return
0
;
...
...
src/wal/src/walWrite.c
浏览文件 @
34565eff
...
...
@@ -455,7 +455,7 @@ uint64_t walGetVersion(twalh param) {
void
walResetVersion
(
twalh
param
,
uint64_t
newVer
)
{
SWal
*
pWal
=
param
;
if
(
pWal
==
0
)
return
;
w
Debug
(
"vgId:%d, version reset from %"
PRIu64
" to %"
PRIu64
,
pWal
->
vgId
,
pWal
->
version
,
newVer
);
w
Info
(
"vgId:%d, version reset from %"
PRIu64
" to %"
PRIu64
,
pWal
->
vgId
,
pWal
->
version
,
newVer
);
pWal
->
version
=
newVer
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录