Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
66de5c58
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看板
提交
66de5c58
编写于
3月 26, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-9] fix crash while create table
上级
b6313b34
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
48 addition
and
51 deletion
+48
-51
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+2
-2
src/mnode/inc/mgmtDb.h
src/mnode/inc/mgmtDb.h
+7
-6
src/mnode/inc/mgmtMnode.h
src/mnode/inc/mgmtMnode.h
+6
-6
src/mnode/inc/mgmtProfile.h
src/mnode/inc/mgmtProfile.h
+4
-4
src/mnode/inc/mgmtSdb.h
src/mnode/inc/mgmtSdb.h
+5
-5
src/mnode/inc/mgmtShell.h
src/mnode/inc/mgmtShell.h
+2
-2
src/mnode/inc/mgmtVgroup.h
src/mnode/inc/mgmtVgroup.h
+0
-2
src/mnode/src/mgmtChildTable.c
src/mnode/src/mgmtChildTable.c
+1
-1
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+0
-1
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+9
-7
src/mnode/src/mgmtVgroup.c
src/mnode/src/mgmtVgroup.c
+10
-13
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+1
-1
未找到文件。
src/client/src/tscServer.c
浏览文件 @
66de5c58
...
@@ -1752,7 +1752,7 @@ int tscBuildMetricMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -1752,7 +1752,7 @@ int tscBuildMetricMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
pCmd
->
payloadLen
=
msgLen
;
pCmd
->
payloadLen
=
msgLen
;
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_STABLE_
META
;
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_STABLE_
VGROUP
;
assert
(
msgLen
+
minMsgSize
()
<=
size
);
assert
(
msgLen
+
minMsgSize
()
<=
size
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
src/inc/taosmsg.h
浏览文件 @
66de5c58
...
@@ -738,8 +738,8 @@ typedef struct {
...
@@ -738,8 +738,8 @@ typedef struct {
}
SDMConfigTableMsg
;
}
SDMConfigTableMsg
;
typedef
struct
{
typedef
struct
{
uint32_t
dnode
;
uint32_t
dnode
Id
;
int32_t
v
node
;
int32_t
v
gId
;
}
SDMConfigVnodeMsg
;
}
SDMConfigVnodeMsg
;
typedef
struct
{
typedef
struct
{
...
...
src/mnode/inc/mgmtDb.h
浏览文件 @
66de5c58
...
@@ -22,22 +22,23 @@ extern "C" {
...
@@ -22,22 +22,23 @@ extern "C" {
#include "mnode.h"
#include "mnode.h"
void
mgmtAddVgroupIntoDb
(
SVgObj
*
pVgroup
);
// api
void
mgmtAddVgroupIntoDbTail
(
SVgObj
*
pVgroup
);
void
mgmtRemoveVgroupFromDb
(
SVgObj
*
pVgroup
);
void
mgmtMoveVgroupToTail
(
SVgObj
*
pVgroup
);
void
mgmtMoveVgroupToHead
(
SVgObj
*
pVgroup
);
int32_t
mgmtInitDbs
();
int32_t
mgmtInitDbs
();
void
mgmtCleanUpDbs
();
void
mgmtCleanUpDbs
();
SDbObj
*
mgmtGetDb
(
char
*
db
);
SDbObj
*
mgmtGetDb
(
char
*
db
);
SDbObj
*
mgmtGetDbByTableId
(
char
*
db
);
SDbObj
*
mgmtGetDbByTableId
(
char
*
db
);
bool
mgmtCheckIsMonitorDB
(
char
*
db
,
char
*
monitordb
);
bool
mgmtCheckIsMonitorDB
(
char
*
db
,
char
*
monitordb
);
// util func
void
mgmtAddSuperTableIntoDb
(
SDbObj
*
pDb
);
void
mgmtAddSuperTableIntoDb
(
SDbObj
*
pDb
);
void
mgmtRemoveSuperTableFromDb
(
SDbObj
*
pDb
);
void
mgmtRemoveSuperTableFromDb
(
SDbObj
*
pDb
);
void
mgmtAddTableIntoDb
(
SDbObj
*
pDb
);
void
mgmtAddTableIntoDb
(
SDbObj
*
pDb
);
void
mgmtRemoveTableFromDb
(
SDbObj
*
pDb
);
void
mgmtRemoveTableFromDb
(
SDbObj
*
pDb
);
void
mgmtAddVgroupIntoDb
(
SVgObj
*
pVgroup
);
void
mgmtAddVgroupIntoDbTail
(
SVgObj
*
pVgroup
);
void
mgmtRemoveVgroupFromDb
(
SVgObj
*
pVgroup
);
void
mgmtMoveVgroupToTail
(
SVgObj
*
pVgroup
);
void
mgmtMoveVgroupToHead
(
SVgObj
*
pVgroup
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/inc/mgmtMnode.h
浏览文件 @
66de5c58
src/mnode/inc/mgmtProfile.h
浏览文件 @
66de5c58
src/mnode/inc/mgmtSdb.h
浏览文件 @
66de5c58
...
@@ -53,7 +53,7 @@ typedef struct {
...
@@ -53,7 +53,7 @@ typedef struct {
int32_t
(
*
destroyFp
)(
SSdbOperDesc
*
pDesc
);
int32_t
(
*
destroyFp
)(
SSdbOperDesc
*
pDesc
);
}
SSdbTableDesc
;
}
SSdbTableDesc
;
void
*
sdbOpenTable
(
SSdbTableDesc
*
desc
);
void
*
sdbOpenTable
(
SSdbTableDesc
*
desc
);
void
sdbCloseTable
(
void
*
handle
);
void
sdbCloseTable
(
void
*
handle
);
int32_t
sdbInsertRow
(
SSdbOperDesc
*
pOper
);
int32_t
sdbInsertRow
(
SSdbOperDesc
*
pOper
);
...
...
src/mnode/inc/mgmtShell.h
浏览文件 @
66de5c58
src/mnode/inc/mgmtVgroup.h
浏览文件 @
66de5c58
...
@@ -27,12 +27,10 @@ extern "C" {
...
@@ -27,12 +27,10 @@ extern "C" {
int32_t
mgmtInitVgroups
();
int32_t
mgmtInitVgroups
();
void
mgmtCleanUpVgroups
();
void
mgmtCleanUpVgroups
();
SVgObj
*
mgmtGetVgroup
(
int32_t
vgId
);
SVgObj
*
mgmtGetVgroup
(
int32_t
vgId
);
SVgObj
*
mgmtGetVgroupByVnode
(
uint32_t
dnode
,
int32_t
vnode
);
void
mgmtDropAllVgroups
(
SDbObj
*
pDropDb
);
void
mgmtDropAllVgroups
(
SDbObj
*
pDropDb
);
void
mgmtCreateVgroup
(
SQueuedMsg
*
pMsg
);
void
mgmtCreateVgroup
(
SQueuedMsg
*
pMsg
);
void
mgmtDropVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mgmtDropVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mgmtUpdateVgroup
(
SVgObj
*
pVgroup
);
void
mgmtAlterVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mgmtAlterVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
SVgObj
*
mgmtGetAvailableVgroup
(
SDbObj
*
pDb
);
SVgObj
*
mgmtGetAvailableVgroup
(
SDbObj
*
pDb
);
...
...
src/mnode/src/mgmtChildTable.c
浏览文件 @
66de5c58
...
@@ -332,7 +332,6 @@ static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableOb
...
@@ -332,7 +332,6 @@ static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableOb
}
}
memcpy
(
pCreate
->
tableId
,
pTable
->
info
.
tableId
,
TSDB_TABLE_ID_LEN
+
1
);
memcpy
(
pCreate
->
tableId
,
pTable
->
info
.
tableId
,
TSDB_TABLE_ID_LEN
+
1
);
memcpy
(
pCreate
->
superTableId
,
pTable
->
superTable
->
info
.
tableId
,
TSDB_TABLE_ID_LEN
+
1
);
pCreate
->
contLen
=
htonl
(
contLen
);
pCreate
->
contLen
=
htonl
(
contLen
);
pCreate
->
vgId
=
htonl
(
pTable
->
vgId
);
pCreate
->
vgId
=
htonl
(
pTable
->
vgId
);
pCreate
->
tableType
=
pTable
->
info
.
type
;
pCreate
->
tableType
=
pTable
->
info
.
type
;
...
@@ -342,6 +341,7 @@ static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableOb
...
@@ -342,6 +341,7 @@ static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableOb
pCreate
->
uid
=
htobe64
(
pTable
->
uid
);
pCreate
->
uid
=
htobe64
(
pTable
->
uid
);
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
memcpy
(
pCreate
->
superTableId
,
pTable
->
superTable
->
info
.
tableId
,
TSDB_TABLE_ID_LEN
+
1
);
pCreate
->
numOfColumns
=
htons
(
pTable
->
superTable
->
numOfColumns
);
pCreate
->
numOfColumns
=
htons
(
pTable
->
superTable
->
numOfColumns
);
pCreate
->
numOfTags
=
htons
(
pTable
->
superTable
->
numOfTags
);
pCreate
->
numOfTags
=
htons
(
pTable
->
superTable
->
numOfTags
);
pCreate
->
sversion
=
htonl
(
pTable
->
superTable
->
sversion
);
pCreate
->
sversion
=
htonl
(
pTable
->
superTable
->
sversion
);
...
...
src/mnode/src/mgmtDb.c
浏览文件 @
66de5c58
...
@@ -41,7 +41,6 @@ static int32_t tsDbUpdateSize;
...
@@ -41,7 +41,6 @@ static int32_t tsDbUpdateSize;
static
int32_t
mgmtCreateDb
(
SAcctObj
*
pAcct
,
SCMCreateDbMsg
*
pCreate
);
static
int32_t
mgmtCreateDb
(
SAcctObj
*
pAcct
,
SCMCreateDbMsg
*
pCreate
);
static
void
mgmtDropDb
(
void
*
handle
,
void
*
tmrId
);
static
void
mgmtDropDb
(
void
*
handle
,
void
*
tmrId
);
static
int32_t
mgmtSetDbDirty
(
SDbObj
*
pDb
);
static
int32_t
mgmtSetDbDirty
(
SDbObj
*
pDb
);
static
int32_t
mgmtGetDbMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtGetDbMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtRetrieveDbs
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mgmtRetrieveDbs
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
void
mgmtProcessCreateDbMsg
(
SQueuedMsg
*
pMsg
);
static
void
mgmtProcessCreateDbMsg
(
SQueuedMsg
*
pMsg
);
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
66de5c58
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "mgmtShell.h"
#include "mgmtShell.h"
#include "mgmtUser.h"
#include "mgmtUser.h"
void
*
tsUserSdb
=
NULL
;
static
void
*
tsUserSdb
=
NULL
;
static
int32_t
tsUserUpdateSize
=
0
;
static
int32_t
tsUserUpdateSize
=
0
;
static
int32_t
mgmtCreateUser
(
SAcctObj
*
pAcct
,
char
*
name
,
char
*
pass
);
static
int32_t
mgmtCreateUser
(
SAcctObj
*
pAcct
,
char
*
name
,
char
*
pass
);
...
@@ -313,7 +313,9 @@ static int32_t mgmtRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, void
...
@@ -313,7 +313,9 @@ static int32_t mgmtRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, void
SUserObj
*
mgmtGetUserFromConn
(
void
*
pConn
,
bool
*
usePublicIp
)
{
SUserObj
*
mgmtGetUserFromConn
(
void
*
pConn
,
bool
*
usePublicIp
)
{
SRpcConnInfo
connInfo
;
SRpcConnInfo
connInfo
;
if
(
rpcGetConnInfo
(
pConn
,
&
connInfo
)
==
0
)
{
if
(
rpcGetConnInfo
(
pConn
,
&
connInfo
)
==
0
)
{
if
(
usePublicIp
)
{
*
usePublicIp
=
(
connInfo
.
serverIp
==
tsPublicIpInt
);
*
usePublicIp
=
(
connInfo
.
serverIp
==
tsPublicIpInt
);
}
return
mgmtGetUser
(
connInfo
.
user
);
return
mgmtGetUser
(
connInfo
.
user
);
}
}
...
...
src/mnode/src/mgmtVgroup.c
浏览文件 @
66de5c58
...
@@ -67,8 +67,8 @@ static int32_t mgmtVgroupActionInsert(SSdbOperDesc *pOper) {
...
@@ -67,8 +67,8 @@ static int32_t mgmtVgroupActionInsert(SSdbOperDesc *pOper) {
pVgroup
->
prev
=
NULL
;
pVgroup
->
prev
=
NULL
;
pVgroup
->
next
=
NULL
;
pVgroup
->
next
=
NULL
;
int32_t
size
=
sizeof
(
S
TableInfo
*
)
*
pDb
->
cfg
.
maxSessions
;
int32_t
size
=
sizeof
(
S
ChildTableObj
*
)
*
pDb
->
cfg
.
maxSessions
;
pVgroup
->
tableList
=
(
STableInfo
**
)
calloc
(
pDb
->
cfg
.
maxSessions
,
sizeof
(
STableInfo
*
));
pVgroup
->
tableList
=
calloc
(
pDb
->
cfg
.
maxSessions
,
sizeof
(
SChildTableObj
*
));
if
(
pVgroup
->
tableList
==
NULL
)
{
if
(
pVgroup
->
tableList
==
NULL
)
{
mError
(
"vgroup:%d, failed to malloc(size:%d) for the tableList of vgroups"
,
pVgroup
->
vgId
,
size
);
mError
(
"vgroup:%d, failed to malloc(size:%d) for the tableList of vgroups"
,
pVgroup
->
vgId
,
size
);
return
-
1
;
return
-
1
;
...
@@ -112,8 +112,8 @@ static int32_t mgmtVgroupActionUpdate(SSdbOperDesc *pOper) {
...
@@ -112,8 +112,8 @@ static int32_t mgmtVgroupActionUpdate(SSdbOperDesc *pOper) {
if
(
pDb
->
cfg
.
maxSessions
!=
oldTables
)
{
if
(
pDb
->
cfg
.
maxSessions
!=
oldTables
)
{
mPrint
(
"vgroup:%d tables change from %d to %d"
,
pVgroup
->
vgId
,
oldTables
,
pDb
->
cfg
.
maxSessions
);
mPrint
(
"vgroup:%d tables change from %d to %d"
,
pVgroup
->
vgId
,
oldTables
,
pDb
->
cfg
.
maxSessions
);
taosUpdateIdPool
(
pVgroup
->
idPool
,
pDb
->
cfg
.
maxSessions
);
taosUpdateIdPool
(
pVgroup
->
idPool
,
pDb
->
cfg
.
maxSessions
);
int32_t
size
=
sizeof
(
S
TableInfo
*
)
*
pDb
->
cfg
.
maxSessions
;
int32_t
size
=
sizeof
(
S
ChildTableObj
*
)
*
pDb
->
cfg
.
maxSessions
;
pVgroup
->
tableList
=
(
S
TableInfo
**
)
realloc
(
pVgroup
->
tableList
,
size
);
pVgroup
->
tableList
=
(
S
ChildTableObj
**
)
realloc
(
pVgroup
->
tableList
,
size
);
}
}
}
}
...
@@ -483,17 +483,14 @@ SMDCreateVnodeMsg *mgmtBuildCreateVnodeMsg(SVgObj *pVgroup) {
...
@@ -483,17 +483,14 @@ SMDCreateVnodeMsg *mgmtBuildCreateVnodeMsg(SVgObj *pVgroup) {
return
pVnode
;
return
pVnode
;
}
}
SVgObj
*
mgmtGetVgroupByVnode
(
uint32_t
dnode
,
int32_t
vnode
)
{
static
SVgObj
*
mgmtGetVgroupInDnode
(
uint32_t
dnodeId
,
int32_t
vgId
)
{
if
(
vnode
<
0
||
vnode
>=
TSDB_MAX_VNODES
)
{
if
(
vnovgId
<
1
||
dnodeId
<
1
)
return
NULL
;
return
NULL
;
}
SDnodeObj
*
pDnode
=
mgmtGetDnode
(
dnode
);
SDnodeObj
*
pDnode
=
mgmtGetDnode
(
dnode
Id
);
if
(
pDnode
==
NULL
)
{
if
(
pDnode
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
int32_t
vgId
=
pDnode
->
vload
[
vnode
].
vgId
;
return
mgmtGetVgroup
(
vgId
);
return
mgmtGetVgroup
(
vgId
);
}
}
...
@@ -660,10 +657,10 @@ static void mgmtProcessVnodeCfgMsg(SRpcMsg *rpcMsg) {
...
@@ -660,10 +657,10 @@ static void mgmtProcessVnodeCfgMsg(SRpcMsg *rpcMsg) {
if
(
mgmtCheckRedirect
(
rpcMsg
->
handle
))
return
;
if
(
mgmtCheckRedirect
(
rpcMsg
->
handle
))
return
;
SDMConfigVnodeMsg
*
pCfg
=
(
SDMConfigVnodeMsg
*
)
rpcMsg
->
pCont
;
SDMConfigVnodeMsg
*
pCfg
=
(
SDMConfigVnodeMsg
*
)
rpcMsg
->
pCont
;
pCfg
->
dnode
=
htonl
(
pCfg
->
dnode
);
pCfg
->
dnode
Id
=
htonl
(
pCfg
->
dnode
);
pCfg
->
v
node
=
htonl
(
pCfg
->
vnode
);
pCfg
->
v
gId
=
htonl
(
pCfg
->
vnode
);
SVgObj
*
pVgroup
=
mgmtGetVgroup
ByVnode
(
pCfg
->
dnode
,
pCfg
->
vnode
);
SVgObj
*
pVgroup
=
mgmtGetVgroup
InDnode
(
pCfg
->
dnodeId
,
pCfg
->
vgId
);
if
(
pVgroup
==
NULL
)
{
if
(
pVgroup
==
NULL
)
{
mTrace
(
"dnode:%s, vnode:%d, no vgroup info"
,
taosIpStr
(
pCfg
->
dnode
),
pCfg
->
vnode
);
mTrace
(
"dnode:%s, vnode:%d, no vgroup info"
,
taosIpStr
(
pCfg
->
dnode
),
pCfg
->
vnode
);
mgmtSendSimpleResp
(
rpcMsg
->
handle
,
TSDB_CODE_NOT_ACTIVE_VNODE
);
mgmtSendSimpleResp
(
rpcMsg
->
handle
,
TSDB_CODE_NOT_ACTIVE_VNODE
);
...
...
src/rpc/src/rpcMain.c
浏览文件 @
66de5c58
...
@@ -360,7 +360,7 @@ void rpcSendRequest(void *shandle, SRpcIpSet *pIpSet, SRpcMsg *pMsg) {
...
@@ -360,7 +360,7 @@ void rpcSendRequest(void *shandle, SRpcIpSet *pIpSet, SRpcMsg *pMsg) {
// for TDengine, all the query, show commands shall have TCP connection
// for TDengine, all the query, show commands shall have TCP connection
char
type
=
pMsg
->
msgType
;
char
type
=
pMsg
->
msgType
;
if
(
type
==
TSDB_MSG_TYPE_QUERY
||
type
==
TSDB_MSG_TYPE_RETRIEVE
||
if
(
type
==
TSDB_MSG_TYPE_QUERY
||
type
==
TSDB_MSG_TYPE_RETRIEVE
||
type
==
TSDB_MSG_TYPE_CM_STABLE_
META
||
type
==
TSDB_MSG_TYPE_CM_TABLES_META
||
type
==
TSDB_MSG_TYPE_CM_STABLE_
VGROUP
||
type
==
TSDB_MSG_TYPE_CM_TABLES_META
||
type
==
TSDB_MSG_TYPE_CM_SHOW
)
type
==
TSDB_MSG_TYPE_CM_SHOW
)
pContext
->
connType
=
RPC_CONN_TCPC
;
pContext
->
connType
=
RPC_CONN_TCPC
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录