Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Rattenking
TDengine
提交
82a72bf2
T
TDengine
项目概览
Rattenking
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
82a72bf2
编写于
3月 10, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile errors
上级
cb7322de
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
98 addition
and
97 deletion
+98
-97
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/dnode/CMakeLists.txt
src/dnode/CMakeLists.txt
+1
-1
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+93
-93
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+1
-0
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+1
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
82a72bf2
...
...
@@ -395,7 +395,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char
*
pMsg
=
pCmd
->
payload
+
tsRpcHeadSize
;
pMsg
+=
sizeof
(
SMgmtHead
);
SC
fgDnodeMsg
*
pCfg
=
(
S
CfgDnodeMsg
*
)
pMsg
;
SC
MCfgDnodeMsg
*
pCfg
=
(
SCM
CfgDnodeMsg
*
)
pMsg
;
strncpy
(
pCfg
->
ip
,
pDCL
->
a
[
0
].
z
,
pDCL
->
a
[
0
].
n
);
strncpy
(
pCfg
->
config
,
pDCL
->
a
[
1
].
z
,
pDCL
->
a
[
1
].
n
);
...
...
src/client/src/tscServer.c
浏览文件 @
82a72bf2
...
...
@@ -1795,7 +1795,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t
tscBuildCfgDnodeMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pCmd
->
payloadLen
=
sizeof
(
SCfgDnodeMsg
);
pCmd
->
payloadLen
=
sizeof
(
SC
MC
fgDnodeMsg
);
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
pCmd
,
pCmd
->
payloadLen
))
{
tscError
(
"%p failed to malloc for query msg"
,
pSql
);
...
...
src/dnode/CMakeLists.txt
浏览文件 @
82a72bf2
...
...
@@ -7,7 +7,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/util/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/vnode/tsdb/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/
vnode/
common/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/common/inc
)
INCLUDE_DIRECTORIES
(
${
TD_ENTERPRISE_DIR
}
/src/inc
)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
82a72bf2
...
...
@@ -21,7 +21,7 @@
#include "tlog.h"
#include "trpc.h"
#include "tstatus.h"
//
#include "tsdb.h"
#include "tsdb.h"
#include "dnodeMgmt.h"
#include "dnodeRead.h"
#include "dnodeWrite.h"
...
...
@@ -139,111 +139,111 @@ static void dnodeCleanupVnodes() {
}
static
int32_t
dnodeOpenVnode
(
int32_t
vgId
)
{
//
char rootDir[TSDB_FILENAME_LEN] = {0};
//
sprintf(rootDir, "%s/vnode%d", tsDirectory, vgId);
//
//
void *pTsdb = tsdbOpenRepo(rootDir);
//
if (pTsdb != NULL) {
//
return terrno;
//
}
//
//
SVnodeObj vnodeObj;
//
vnodeObj.vgId = vgId;
//
vnodeObj.status = TSDB_VN_STATUS_NOT_READY;
//
vnodeObj.refCount = 1;
//
vnodeObj.version = 0;
//
vnodeObj.wworker = dnodeAllocateWriteWorker();
//
vnodeObj.rworker = dnodeAllocateReadWorker();
//
vnodeObj.wal = NULL;
//
vnodeObj.tsdb = pTsdb;
//
vnodeObj.replica = NULL;
//
vnodeObj.events = NULL;
//
vnodeObj.cq = NULL;
//
//
taosAddIntHash(tsDnodeVnodesHash, vnodeObj.vgId, &vnodeObj);
char
rootDir
[
TSDB_FILENAME_LEN
]
=
{
0
};
sprintf
(
rootDir
,
"%s/vnode%d"
,
tsDirectory
,
vgId
);
void
*
pTsdb
=
tsdbOpenRepo
(
rootDir
);
if
(
pTsdb
!=
NULL
)
{
return
terrno
;
}
SVnodeObj
vnodeObj
;
vnodeObj
.
vgId
=
vgId
;
vnodeObj
.
status
=
TSDB_VN_STATUS_NOT_READY
;
vnodeObj
.
refCount
=
1
;
vnodeObj
.
version
=
0
;
vnodeObj
.
wworker
=
dnodeAllocateWriteWorker
();
vnodeObj
.
rworker
=
dnodeAllocateReadWorker
();
vnodeObj
.
wal
=
NULL
;
vnodeObj
.
tsdb
=
pTsdb
;
vnodeObj
.
replica
=
NULL
;
vnodeObj
.
events
=
NULL
;
vnodeObj
.
cq
=
NULL
;
taosAddIntHash
(
tsDnodeVnodesHash
,
vnodeObj
.
vgId
,
&
vnodeObj
);
return
TSDB_CODE_SUCCESS
;
}
static
void
dnodeCleanupVnode
(
SVnodeObj
*
pVnode
)
{
//
pVnode->status = TSDB_VN_STATUS_NOT_READY;
//
int32_t count = atomic_sub_fetch_32(&pVnode->refCount, 1);
//
if (count > 0) {
//
// wait refcount
//
}
//
//
// remove replica
//
//
// remove read queue
//
dnodeFreeReadWorker(pVnode->rworker);
//
pVnode->rworker = NULL;
//
//
// remove write queue
//
dnodeFreeWriteWorker(pVnode->wworker);
//
pVnode->wworker = NULL;
//
//
// remove wal
//
//
// remove tsdb
//
if (pVnode->tsdb) {
//
tsdbCloseRepo(pVnode->tsdb);
//
pVnode->tsdb = NULL;
//
}
//
//
taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
pVnode
->
status
=
TSDB_VN_STATUS_NOT_READY
;
int32_t
count
=
atomic_sub_fetch_32
(
&
pVnode
->
refCount
,
1
);
if
(
count
>
0
)
{
// wait refcount
}
// remove replica
// remove read queue
dnodeFreeReadWorker
(
pVnode
->
rworker
);
pVnode
->
rworker
=
NULL
;
// remove write queue
dnodeFreeWriteWorker
(
pVnode
->
wworker
);
pVnode
->
wworker
=
NULL
;
// remove wal
// remove tsdb
if
(
pVnode
->
tsdb
)
{
tsdbCloseRepo
(
pVnode
->
tsdb
);
pVnode
->
tsdb
=
NULL
;
}
taosDeleteIntHash
(
tsDnodeVnodesHash
,
pVnode
->
vgId
);
}
static
int32_t
dnodeCreateVnode
(
SMDCreateVnodeMsg
*
pVnodeCfg
)
{
//
STsdbCfg tsdbCfg;
//
tsdbCfg.precision = pVnodeCfg->cfg.precision;
//
tsdbCfg.tsdbId = pVnodeCfg->vnode;
//
tsdbCfg.maxTables = pVnodeCfg->cfg.maxSessions;
//
tsdbCfg.daysPerFile = pVnodeCfg->cfg.daysPerFile;
//
tsdbCfg.minRowsPerFileBlock = -1;
//
tsdbCfg.maxRowsPerFileBlock = -1;
//
tsdbCfg.keep = -1;
//
tsdbCfg.maxCacheSize = -1;
//
char rootDir[TSDB_FILENAME_LEN] = {0};
//
sprintf(rootDir, "%s/vnode%d", tsDirectory, pVnodeCfg->cfg.vgId);
//
//
void *pTsdb = tsdbCreateRepo(rootDir, &tsdbCfg, NULL);
//
if (pTsdb != NULL) {
//
return terrno;
//
}
//
//
SVnodeObj vnodeObj;
//
vnodeObj.vgId = pVnodeCfg->cfg.vgId;
//
vnodeObj.status = TSDB_VN_STATUS_NOT_READY;
//
vnodeObj.refCount = 1;
//
vnodeObj.version = 0;
//
vnodeObj.wworker = dnodeAllocateWriteWorker();
//
vnodeObj.rworker = dnodeAllocateReadWorker();
//
vnodeObj.wal = NULL;
//
vnodeObj.tsdb = pTsdb;
//
vnodeObj.replica = NULL;
//
vnodeObj.events = NULL;
//
vnodeObj.cq = NULL;
//
//
taosAddIntHash(tsDnodeVnodesHash, vnodeObj.vgId, &vnodeObj);
STsdbCfg
tsdbCfg
;
tsdbCfg
.
precision
=
pVnodeCfg
->
cfg
.
precision
;
tsdbCfg
.
tsdbId
=
pVnodeCfg
->
vnode
;
tsdbCfg
.
maxTables
=
pVnodeCfg
->
cfg
.
maxSessions
;
tsdbCfg
.
daysPerFile
=
pVnodeCfg
->
cfg
.
daysPerFile
;
tsdbCfg
.
minRowsPerFileBlock
=
-
1
;
tsdbCfg
.
maxRowsPerFileBlock
=
-
1
;
tsdbCfg
.
keep
=
-
1
;
tsdbCfg
.
maxCacheSize
=
-
1
;
char
rootDir
[
TSDB_FILENAME_LEN
]
=
{
0
};
sprintf
(
rootDir
,
"%s/vnode%d"
,
tsDirectory
,
pVnodeCfg
->
cfg
.
vgId
);
void
*
pTsdb
=
tsdbCreateRepo
(
rootDir
,
&
tsdbCfg
,
NULL
);
if
(
pTsdb
!=
NULL
)
{
return
terrno
;
}
SVnodeObj
vnodeObj
;
vnodeObj
.
vgId
=
pVnodeCfg
->
cfg
.
vgId
;
vnodeObj
.
status
=
TSDB_VN_STATUS_NOT_READY
;
vnodeObj
.
refCount
=
1
;
vnodeObj
.
version
=
0
;
vnodeObj
.
wworker
=
dnodeAllocateWriteWorker
();
vnodeObj
.
rworker
=
dnodeAllocateReadWorker
();
vnodeObj
.
wal
=
NULL
;
vnodeObj
.
tsdb
=
pTsdb
;
vnodeObj
.
replica
=
NULL
;
vnodeObj
.
events
=
NULL
;
vnodeObj
.
cq
=
NULL
;
taosAddIntHash
(
tsDnodeVnodesHash
,
vnodeObj
.
vgId
,
&
vnodeObj
);
return
TSDB_CODE_SUCCESS
;
}
static
void
dnodeDropVnode
(
SVnodeObj
*
pVnode
)
{
//
pVnode->status = TSDB_VN_STATUS_NOT_READY;
//
//
int32_t count = atomic_sub_fetch_32(&pVnode->refCount, 1);
//
if (count > 0) {
//
// wait refcount
//
}
//
//
if (pVnode->tsdb) {
//
tsdbDropRepo(pVnode->tsdb);
//
pVnode->tsdb = NULL;
//
}
//
//
dnodeCleanupVnode(pVnode);
pVnode
->
status
=
TSDB_VN_STATUS_NOT_READY
;
int32_t
count
=
atomic_sub_fetch_32
(
&
pVnode
->
refCount
,
1
);
if
(
count
>
0
)
{
// wait refcount
}
if
(
pVnode
->
tsdb
)
{
tsdbDropRepo
(
pVnode
->
tsdb
);
pVnode
->
tsdb
=
NULL
;
}
dnodeCleanupVnode
(
pVnode
);
}
static
void
dnodeProcesSMDCreateVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
...
...
src/mnode/src/mgmtMnode.c
浏览文件 @
82a72bf2
...
...
@@ -14,6 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "mgmtMnode.h"
bool
mgmtCheckRedirect
(
void
*
handle
)
{
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
82a72bf2
...
...
@@ -96,7 +96,7 @@ void mgmtCleanUpShell() {
}
}
void
mgmtAddShellHandle
(
uint8_t
showType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
))
{
void
mgmtAddShell
Msg
Handle
(
uint8_t
showType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
))
{
tsMgmtProcessShellMsgFp
[
showType
]
=
fp
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录