Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7725aa1c
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看板
提交
7725aa1c
编写于
11月 22, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-1129]
上级
86ad4166
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
55 addition
and
34 deletion
+55
-34
src/inc/tstatus.h
src/inc/tstatus.h
+2
-0
src/system/detail/src/dnodeMgmt.c
src/system/detail/src/dnodeMgmt.c
+9
-9
src/system/detail/src/mgmtDnodeInt.c
src/system/detail/src/mgmtDnodeInt.c
+3
-2
src/system/detail/src/vnodeCache.c
src/system/detail/src/vnodeCache.c
+2
-2
src/system/detail/src/vnodeFile.c
src/system/detail/src/vnodeFile.c
+4
-6
src/system/detail/src/vnodeStore.c
src/system/detail/src/vnodeStore.c
+9
-9
src/system/detail/src/vnodeStream.c
src/system/detail/src/vnodeStream.c
+4
-4
src/system/lite/src/vnodeFile.spec.c
src/system/lite/src/vnodeFile.spec.c
+1
-1
src/system/lite/src/vnodePeer.spec.c
src/system/lite/src/vnodePeer.spec.c
+1
-1
src/util/src/tstatus.c
src/util/src/tstatus.c
+20
-0
未找到文件。
src/inc/tstatus.h
浏览文件 @
7725aa1c
...
...
@@ -78,6 +78,8 @@ enum _TSDB_VN_STREAM_STATUS {
TSDB_VN_STREAM_STATUS_START
};
const
char
*
taosGetVgroupStatusStr
(
int
vgroupStatus
);
const
char
*
taosGetDbStatusStr
(
int
dbStatus
);
const
char
*
taosGetVnodeStatusStr
(
int
vnodeStatus
);
const
char
*
taosGetVnodeSyncStatusStr
(
int
vnodeSyncStatus
);
const
char
*
taosGetVnodeDropStatusStr
(
int
dropping
);
...
...
src/system/detail/src/dnodeMgmt.c
浏览文件 @
7725aa1c
...
...
@@ -350,33 +350,33 @@ int vnodeProcessVPeerCfg(char *msg, int msgLen, SMgmtObj *pMgmtObj) {
pCfg
->
rowsInFileBlock
=
htonl
(
pCfg
->
rowsInFileBlock
);
if
(
pCfg
->
replications
>
0
)
{
d
Trace
(
"vid:%d, vpeer cfg received, replica:%d session:%d, vnodeList replica:%d session:%d"
,
d
Print
(
"vid:%d, vpeer cfg received, replica:%d session:%d, vnodeList replica:%d session:%d"
,
vnode
,
pCfg
->
replications
,
pCfg
->
maxSessions
,
vnodeList
[
vnode
].
cfg
.
replications
,
vnodeList
[
vnode
].
cfg
.
maxSessions
);
for
(
i
=
0
;
i
<
pCfg
->
replications
;
++
i
)
{
pMsg
->
vpeerDesc
[
i
].
vnode
=
htonl
(
pMsg
->
vpeerDesc
[
i
].
vnode
);
pMsg
->
vpeerDesc
[
i
].
ip
=
htonl
(
pMsg
->
vpeerDesc
[
i
].
ip
);
d
Trace
(
"vid:%d, vpeer:%d ip:0x%x vid:%d "
,
vnode
,
i
,
pMsg
->
vpeerDesc
[
i
].
ip
,
pMsg
->
vpeerDesc
[
i
].
vnode
);
d
Print
(
"vid:%d, vpeer:%d ip:0x%x vid:%d "
,
vnode
,
i
,
pMsg
->
vpeerDesc
[
i
].
ip
,
pMsg
->
vpeerDesc
[
i
].
vnode
);
}
}
if
(
vnodeList
[
vnode
].
cfg
.
maxSessions
==
0
)
{
d
Trace
(
"vid:%d, vnode is empty"
,
vnode
);
d
Print
(
"vid:%d, vnode is empty"
,
vnode
);
if
(
pCfg
->
maxSessions
>
0
)
{
if
(
vnodeList
[
vnode
].
vnodeStatus
==
TSDB_VN_STATUS_OFFLINE
)
{
d
Trace
(
"vid:%d, status:%s, start to create vnode"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, start to create vnode"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
return
vnodeCreateVnode
(
vnode
,
pCfg
,
pMsg
->
vpeerDesc
);
}
else
{
d
Trace
(
"vid:%d, status:%s, cannot preform create vnode operation"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, cannot preform create vnode operation"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
return
TSDB_CODE_INVALID_VNODE_STATUS
;
}
}
}
else
{
d
Trace
(
"vid:%d, vnode is not empty"
,
vnode
);
d
Print
(
"vid:%d, vnode is not empty"
,
vnode
);
if
(
pCfg
->
maxSessions
>
0
)
{
if
(
vnodeList
[
vnode
].
vnodeStatus
==
TSDB_VN_STATUS_DELETING
)
{
d
Trace
(
"vid:%d, status:%s, wait vnode delete finished"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, wait vnode delete finished"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
}
else
{
d
Trace
(
"vid:%d, status:%s, start to update vnode"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, start to update vnode"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
if
(
pCfg
->
maxSessions
!=
vnodeList
[
vnode
].
cfg
.
maxSessions
)
{
vnodeCleanUpOneVnode
(
vnode
);
...
...
@@ -395,7 +395,7 @@ int vnodeProcessVPeerCfg(char *msg, int msgLen, SMgmtObj *pMgmtObj) {
}
return
0
;
}
else
{
d
Trace
(
"vid:%d, status:%s, start to delete vnode"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, start to delete vnode"
,
vnode
,
taosGetVnodeStatusStr
(
vnodeList
[
vnode
].
vnodeStatus
));
vnodeRemoveVnode
(
vnode
);
}
}
...
...
src/system/detail/src/mgmtDnodeInt.c
浏览文件 @
7725aa1c
...
...
@@ -99,7 +99,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
*
pMsg
=
0
;
pMsg
++
;
pMsg
=
mgmtBuildVpeersIe
(
pMsg
,
pVgroup
,
vnode
);
mTrace
(
"dnode:%s, vnode:%d, vgroup:%d, send create
meter
msg, code:%d"
,
taosIpStr
(
pObj
->
privateIp
),
vnode
,
pVgroup
->
vgId
,
*
pMsg
);
mTrace
(
"dnode:%s, vnode:%d, vgroup:%d, send create
vnode
msg, code:%d"
,
taosIpStr
(
pObj
->
privateIp
),
vnode
,
pVgroup
->
vgId
,
*
pMsg
);
}
else
{
mTrace
(
"dnode:%s, vnode:%d, no vgroup info, vgroup:%d"
,
taosIpStr
(
pObj
->
privateIp
),
vnode
,
pObj
->
vload
[
vnode
].
vgId
);
*
pMsg
=
TSDB_CODE_NOT_ACTIVE_VNODE
;
...
...
@@ -128,7 +128,8 @@ int mgmtProcessVPeersRsp(char *msg, int msgLen, SDnodeObj *pObj) {
}
if
(
pDb
->
vgStatus
!=
TSDB_VG_STATUS_IN_PROGRESS
)
{
mTrace
(
"dnode:%s, db:%s vpeer rsp already disposed, vgroup status:%d code:%d"
,
taosIpStr
(
pObj
->
privateIp
),
pRsp
->
more
,
pDb
->
vgStatus
,
pRsp
->
code
);
mTrace
(
"dnode:%s, db:%s vpeer rsp already disposed, vgroup status:%s code:%d"
,
taosIpStr
(
pObj
->
privateIp
),
pRsp
->
more
,
taosGetVgroupStatusStr
(
pDb
->
vgStatus
),
pRsp
->
code
);
return
0
;
}
...
...
src/system/detail/src/vnodeCache.c
浏览文件 @
7725aa1c
...
...
@@ -78,7 +78,7 @@ void *vnodeOpenCachePool(int vnode) {
}
}
d
Trace
(
"vid:%d, cache pool is allocated:0x%x"
,
vnode
,
pCachePool
);
d
Print
(
"vid:%d, cache pool is allocated:0x%x"
,
vnode
,
pCachePool
);
return
pCachePool
;
...
...
@@ -103,7 +103,7 @@ void vnodeCloseCachePool(int vnode) {
taosTmrStopA
(
&
pVnode
->
commitTimer
);
if
(
pVnode
->
commitInProcess
)
pthread_cancel
(
pVnode
->
commitThread
);
d
Trace
(
"vid:%d, cache pool closed, count:%d"
,
vnode
,
pCachePool
->
count
);
d
Print
(
"vid:%d, cache pool closed, count:%d"
,
vnode
,
pCachePool
->
count
);
int
maxAllocBlock
=
(
1024
*
1024
*
1024
)
/
pVnode
->
cfg
.
cacheBlockSize
;
while
(
blockId
<
pVnode
->
cfg
.
cacheNumOfBlocks
.
totalBlocks
)
{
...
...
src/system/detail/src/vnodeFile.c
浏览文件 @
7725aa1c
...
...
@@ -125,10 +125,8 @@ int vnodeCreateHeadDataFile(int vnode, int fileId, char *headName, char *dataNam
if
(
symlink
(
dDataName
,
dataName
)
!=
0
)
return
-
1
;
if
(
symlink
(
dLastName
,
lastName
)
!=
0
)
return
-
1
;
dTrace
(
"vid:%d, fileId:%d, empty header file:%s dataFile:%s lastFile:%s on "
"disk:%s is created "
,
vnode
,
fileId
,
headName
,
dataName
,
lastName
,
path
);
dPrint
(
"vid:%d, fileId:%d, empty header file:%s dataFile:%s lastFile:%s on disk:%s is created "
,
vnode
,
fileId
,
headName
,
dataName
,
lastName
,
path
);
return
0
;
}
...
...
@@ -309,7 +307,7 @@ int vnodeOpenCommitFiles(SVnodeObj *pVnode, int noTempLast) {
vnodeRecoverFromPeer
(
pVnode
,
fileId
);
goto
_error
;
}
else
{
d
Trace
(
"vid:%d, data file:%s is opened to write"
,
vnode
,
name
);
d
Print
(
"vid:%d, data file:%s is opened to write"
,
vnode
,
name
);
}
// open last file
...
...
@@ -414,7 +412,7 @@ void vnodeRemoveFile(int vnode, int fileId) {
remove
(
dDataName
);
remove
(
dLastName
);
d
Trace
(
"vid:%d fileId:%d on disk: %s is removed, numOfFiles:%d maxFiles:%d"
,
vnode
,
fileId
,
path
,
d
Print
(
"vid:%d fileId:%d on disk: %s is removed, numOfFiles:%d maxFiles:%d"
,
vnode
,
fileId
,
path
,
pVnode
->
numOfFiles
,
pVnode
->
maxFiles
);
}
...
...
src/system/detail/src/vnodeStore.c
浏览文件 @
7725aa1c
...
...
@@ -59,7 +59,7 @@ static int vnodeInitStoreVnode(int vnode) {
}
pthread_mutex_init
(
&
(
pVnode
->
vmutex
),
NULL
);
d
Trace
(
"vid:%d, storage initialized, version:%ld fileId:%d numOfFiles:%d"
,
vnode
,
pVnode
->
version
,
pVnode
->
fileId
,
d
Print
(
"vid:%d, storage initialized, version:%ld fileId:%d numOfFiles:%d"
,
vnode
,
pVnode
->
version
,
pVnode
->
fileId
,
pVnode
->
numOfFiles
);
return
0
;
...
...
@@ -83,7 +83,7 @@ int vnodeOpenVnode(int vnode) {
return
TSDB_CODE_INVALID_VNODE_STATUS
;
}
d
Trace
(
"vid:%d, status:%s, start to open"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, start to open"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
pthread_mutex_lock
(
&
dmutex
);
// not enough memory, abort
...
...
@@ -104,7 +104,7 @@ int vnodeOpenVnode(int vnode) {
vnodeOpenStreams
(
pVnode
,
NULL
);
#endif
d
Trace
(
"vid:%d, vnode is opened, openVnodes:%d, status:%s"
,
vnode
,
tsOpenVnodes
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
d
Print
(
"vid:%d, vnode is opened, openVnodes:%d, status:%s"
,
vnode
,
tsOpenVnodes
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -141,10 +141,10 @@ static int vnodeCloseVnode(int vnode) {
}
if
(
pVnode
->
vnodeStatus
==
TSDB_VN_STATUS_DELETING
)
{
d
Trace
(
"vid:%d, status:%s, another thread performed delete operation"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, another thread performed delete operation"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
return
TSDB_CODE_SUCCESS
;
}
else
{
d
Trace
(
"vid:%d, status:%s, enter close operation"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, enter close operation"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
pVnode
->
vnodeStatus
=
TSDB_VN_STATUS_CLOSING
;
}
...
...
@@ -154,7 +154,7 @@ static int vnodeCloseVnode(int vnode) {
return
TSDB_CODE_ACTION_IN_PROGRESS
;
}
d
Trace
(
"vid:%d, status:%s, enter delete operation"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
d
Print
(
"vid:%d, status:%s, enter delete operation"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
));
pVnode
->
vnodeStatus
=
TSDB_VN_STATUS_DELETING
;
vnodeCloseStream
(
vnodeList
+
vnode
);
...
...
@@ -235,7 +235,7 @@ static void vnodeRemoveDataFiles(int vnode) {
if
(
tcode
>=
0
)
{
remove
(
dfilePath
);
d
Trace
(
"Data file %s is removed, link file %s"
,
dfilePath
,
linkFile
);
d
Print
(
"Data file %s is removed, link file %s"
,
dfilePath
,
linkFile
);
}
}
else
{
remove
(
de
->
d_name
);
...
...
@@ -250,7 +250,7 @@ static void vnodeRemoveDataFiles(int vnode) {
sprintf
(
vnodeDir
,
"%s/vnode%d"
,
tsDirectory
,
vnode
);
rmdir
(
vnodeDir
);
d
Trace
(
"vid:%d, vnode is removed!"
,
vnode
);
d
Print
(
"vid:%d, vnode is removed!"
,
vnode
);
}
int
vnodeRemoveVnode
(
int
vnode
)
{
...
...
@@ -273,7 +273,7 @@ int vnodeRemoveVnode(int vnode) {
}
}
else
{
d
Trace
(
"vid:%d, max sessions:%d, this vnode already dropped!!!"
,
vnode
,
vnodeList
[
vnode
].
cfg
.
maxSessions
);
d
Print
(
"vid:%d, max sessions:%d, this vnode already dropped!!!"
,
vnode
,
vnodeList
[
vnode
].
cfg
.
maxSessions
);
vnodeList
[
vnode
].
cfg
.
maxSessions
=
0
;
//reset value
vnodeCalcOpenVnodes
();
}
...
...
src/system/detail/src/vnodeStream.c
浏览文件 @
7725aa1c
...
...
@@ -155,7 +155,7 @@ void vnodeRemoveStream(SMeterObj *pObj) {
// Close all streams in a vnode
void
vnodeCloseStream
(
SVnodeObj
*
pVnode
)
{
SMeterObj
*
pObj
;
d
Trace
(
"vid:%d, stream is closed, old role %s"
,
pVnode
->
vnode
,
taosGetVnodeStreamStatusStr
(
pVnode
->
streamRole
));
d
Print
(
"vid:%d, stream is closed, old role %s"
,
pVnode
->
vnode
,
taosGetVnodeStreamStatusStr
(
pVnode
->
streamRole
));
// stop stream computing
for
(
int
sid
=
0
;
sid
<
pVnode
->
cfg
.
maxSessions
;
++
sid
)
{
...
...
@@ -174,16 +174,16 @@ void vnodeUpdateStreamRole(SVnodeObj *pVnode) {
int
newRole
=
(
pVnode
->
vnodeStatus
==
TSDB_VN_STATUS_MASTER
)
?
TSDB_VN_STREAM_STATUS_START
:
TSDB_VN_STREAM_STATUS_STOP
;
if
(
newRole
!=
pVnode
->
streamRole
)
{
d
Trace
(
"vid:%d, stream role is changed from %s to %s"
,
d
Print
(
"vid:%d, stream role is changed from %s to %s"
,
pVnode
->
vnode
,
taosGetVnodeStreamStatusStr
(
pVnode
->
streamRole
),
taosGetVnodeStreamStatusStr
(
newRole
));
pVnode
->
streamRole
=
newRole
;
if
(
newRole
)
{
if
(
newRole
==
TSDB_VN_STREAM_STATUS_START
)
{
vnodeOpenStreams
(
pVnode
,
NULL
);
}
else
{
vnodeCloseStream
(
pVnode
);
}
}
else
{
d
Trace
(
"vid:%d, stream role is keep to %s"
,
pVnode
->
vnode
,
taosGetVnodeStreamStatusStr
(
new
Role
));
d
Print
(
"vid:%d, stream role is keep to %s"
,
pVnode
->
vnode
,
taosGetVnodeStreamStatusStr
(
pVnode
->
stream
Role
));
}
}
...
...
src/system/lite/src/vnodeFile.spec.c
浏览文件 @
7725aa1c
...
...
@@ -97,7 +97,7 @@ int vnodeCheckNewHeaderFile(int fd, SVnodeObj *pVnode) {
}
_correct_exit:
d
Trace
(
"vid: %d new header file %s is correct"
,
pVnode
->
vnode
,
pVnode
->
nfn
);
d
Print
(
"vid: %d new header file %s is correct"
,
pVnode
->
vnode
,
pVnode
->
nfn
);
tfree
(
pBlocks
);
tfree
(
pHeader
);
return
0
;
...
...
src/system/lite/src/vnodePeer.spec.c
浏览文件 @
7725aa1c
...
...
@@ -32,7 +32,7 @@ void vnodeBroadcastStatusToUnsyncedPeer(SVnodeObj *pVnode) {}
int
vnodeOpenPeerVnode
(
int
vnode
)
{
SVnodeObj
*
pVnode
=
vnodeList
+
vnode
;
pVnode
->
vnodeStatus
=
(
pVnode
->
cfg
.
replications
>
1
)
?
TSDB_VN_STATUS_UNSYNCED
:
TSDB_VN_STATUS_MASTER
;
d
Trace
(
"vid:%d, status:%s numOfPeers:%d"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
),
pVnode
->
cfg
.
replications
-
1
);
d
Print
(
"vid:%d, status:%s numOfPeers:%d"
,
vnode
,
taosGetVnodeStatusStr
(
pVnode
->
vnodeStatus
),
pVnode
->
cfg
.
replications
-
1
);
vnodeUpdateStreamRole
(
pVnode
);
return
0
;
}
...
...
src/util/src/tstatus.c
浏览文件 @
7725aa1c
...
...
@@ -17,6 +17,26 @@
#include "tsdb.h"
#include "tstatus.h"
const
char
*
taosGetVgroupStatusStr
(
int
vgroupStatus
)
{
switch
(
vgroupStatus
)
{
case
TSDB_VG_STATUS_READY
:
return
"ready"
;
case
TSDB_VG_STATUS_IN_PROGRESS
:
return
"inprogress"
;
case
TSDB_VG_STATUS_COMMITLOG_INIT_FAILED
:
return
"commitlog_init_failed"
;
case
TSDB_VG_STATUS_INIT_FAILED
:
return
"init_failed"
;
case
TSDB_VG_STATUS_FULL
:
return
"full"
;
default:
return
"undefined"
;
}
}
const
char
*
taosGetDbStatusStr
(
int
dbStatus
)
{
switch
(
dbStatus
)
{
case
TSDB_DB_STATUS_READY
:
return
"ready"
;
case
TSDB_DB_STATUS_DROPPING
:
return
"dropping"
;
case
TSDB_DB_STATUS_DROP_FROM_SDB
:
return
"drop_from_sdb"
;
default:
return
"undefined"
;
}
}
const
char
*
taosGetVnodeStatusStr
(
int
vnodeStatus
)
{
switch
(
vnodeStatus
)
{
case
TSDB_VN_STATUS_OFFLINE
:
return
"offline"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录