Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f38b2182
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,发现更多精彩内容 >>
提交
f38b2182
编写于
11月 18, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2046
上级
60146985
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
384 addition
and
384 deletion
+384
-384
src/mnode/inc/mnodeSdb.h
src/mnode/inc/mnodeSdb.h
+13
-13
src/mnode/src/mnodeAcct.c
src/mnode/src/mnodeAcct.c
+14
-14
src/mnode/src/mnodeCluster.c
src/mnode/src/mnodeCluster.c
+14
-14
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+18
-18
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+16
-16
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+16
-16
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+198
-198
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+51
-51
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+17
-17
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+24
-24
src/plugins/http/inc/httpInt.h
src/plugins/http/inc/httpInt.h
+1
-1
src/plugins/http/src/httpHandle.c
src/plugins/http/src/httpHandle.c
+2
-2
未找到文件。
src/mnode/inc/mnodeSdb.h
浏览文件 @
f38b2182
...
...
@@ -47,7 +47,7 @@ typedef enum {
SDB_OPER_LOCAL
}
ESdbOper
;
typedef
struct
SS
dbOper
{
typedef
struct
SS
WriteMsg
{
ESdbOper
type
;
int32_t
rowSize
;
int32_t
retCode
;
// for callback in sdb queue
...
...
@@ -58,7 +58,7 @@ typedef struct SSdbOper {
void
*
pObj
;
void
*
rowData
;
struct
SMnodeMsg
*
pMsg
;
}
SS
dbOper
;
}
SS
WriteMsg
;
typedef
struct
{
char
*
tableName
;
...
...
@@ -67,13 +67,13 @@ typedef struct {
int32_t
refCountPos
;
ESdbTable
tableId
;
ESdbKey
keyType
;
int32_t
(
*
insertFp
)(
SSdbOper
*
pOper
);
int32_t
(
*
deleteFp
)(
SSdbOper
*
pOper
);
int32_t
(
*
updateFp
)(
SSdbOper
*
pOper
);
int32_t
(
*
encodeFp
)(
SSdbOper
*
pOper
);
int32_t
(
*
decodeFp
)(
SSdbOper
*
pDesc
);
int32_t
(
*
destroyFp
)(
SSdbOper
*
pDesc
);
int32_t
(
*
restoredFp
)();
int32_t
(
*
fpInsert
)(
SSWriteMsg
*
pWrite
);
int32_t
(
*
fpDelete
)(
SSWriteMsg
*
pWrite
);
int32_t
(
*
fpUpdate
)(
SSWriteMsg
*
pWrite
);
int32_t
(
*
fpEncode
)(
SSWriteMsg
*
pWrite
);
int32_t
(
*
fpDecode
)(
SSWriteMsg
*
pWrite
);
int32_t
(
*
fpDestroy
)(
SSWriteMsg
*
pWrite
);
int32_t
(
*
fpDestored
)();
}
SSdbTableDesc
;
int32_t
sdbInit
();
...
...
@@ -84,10 +84,10 @@ bool sdbIsMaster();
bool
sdbIsServing
();
void
sdbUpdateMnodeRoles
();
int32_t
sdbInsertRow
(
SS
dbOper
*
pOper
);
int32_t
sdbDeleteRow
(
SS
dbOper
*
pOper
);
int32_t
sdbUpdateRow
(
SS
dbOper
*
pOper
);
int32_t
sdbInsertRowImp
(
SS
dbOper
*
pOper
);
int32_t
sdbInsertRow
(
SS
WriteMsg
*
pWrite
);
int32_t
sdbDeleteRow
(
SS
WriteMsg
*
pWrite
);
int32_t
sdbUpdateRow
(
SS
WriteMsg
*
pWrite
);
int32_t
sdbInsertRowImp
(
SS
WriteMsg
*
pWrite
);
void
*
sdbGetRow
(
void
*
handle
,
void
*
key
);
void
*
sdbFetchRow
(
void
*
handle
,
void
*
pIter
,
void
**
ppRow
);
...
...
src/mnode/src/mnodeAcct.c
浏览文件 @
f38b2182
...
...
@@ -31,14 +31,14 @@ void * tsAcctSdb = NULL;
static
int32_t
tsAcctUpdateSize
;
static
int32_t
mnodeCreateRootAcct
();
static
int32_t
mnodeAcctActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeAcctActionDestroy
(
SS
WriteMsg
*
pOper
)
{
SAcctObj
*
pAcct
=
pOper
->
pObj
;
pthread_mutex_destroy
(
&
pAcct
->
mutex
);
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeAcctActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeAcctActionInsert
(
SS
WriteMsg
*
pOper
)
{
SAcctObj
*
pAcct
=
pOper
->
pObj
;
memset
(
&
pAcct
->
acctInfo
,
0
,
sizeof
(
SAcctInfo
));
pAcct
->
acctInfo
.
accessState
=
TSDB_VN_ALL_ACCCESS
;
...
...
@@ -46,14 +46,14 @@ static int32_t mnodeAcctActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeAcctActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeAcctActionDelete
(
SS
WriteMsg
*
pOper
)
{
SAcctObj
*
pAcct
=
pOper
->
pObj
;
mnodeDropAllUsers
(
pAcct
);
mnodeDropAllDbs
(
pAcct
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeAcctActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeAcctActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SAcctObj
*
pAcct
=
pOper
->
pObj
;
SAcctObj
*
pSaved
=
mnodeGetAcct
(
pAcct
->
user
);
if
(
pAcct
!=
pSaved
)
{
...
...
@@ -64,14 +64,14 @@ static int32_t mnodeAcctActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeAcctActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeAcctActionEncode
(
SS
WriteMsg
*
pOper
)
{
SAcctObj
*
pAcct
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pAcct
,
tsAcctUpdateSize
);
pOper
->
rowSize
=
tsAcctUpdateSize
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeAcctActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeAcctActionDecode
(
SS
WriteMsg
*
pOper
)
{
SAcctObj
*
pAcct
=
(
SAcctObj
*
)
calloc
(
1
,
sizeof
(
SAcctObj
));
if
(
pAcct
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -106,13 +106,13 @@ int32_t mnodeInitAccts() {
.
maxRowSize
=
tsAcctUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
.
insertFp
=
mnodeAcctActionInsert
,
.
deleteFp
=
mnodeAcctActionDelete
,
.
updateFp
=
mnodeAcctActionUpdate
,
.
encodeFp
=
mnodeAcctActionEncode
,
.
decodeFp
=
mnodeAcctActionDecode
,
.
destroyFp
=
mnodeAcctActionDestroy
,
.
restoredFp
=
mnodeAcctActionRestored
.
fpInsert
=
mnodeAcctActionInsert
,
.
fpDelete
=
mnodeAcctActionDelete
,
.
fpUpdate
=
mnodeAcctActionUpdate
,
.
fpEncode
=
mnodeAcctActionEncode
,
.
fpDecode
=
mnodeAcctActionDecode
,
.
fpDestroy
=
mnodeAcctActionDestroy
,
.
fpDestored
=
mnodeAcctActionRestored
};
tsAcctSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -226,7 +226,7 @@ static int32_t mnodeCreateRootAcct() {
pAcct
->
acctId
=
sdbGetId
(
tsAcctSdb
);
pAcct
->
createdTime
=
taosGetTimestampMs
();
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsAcctSdb
,
.
pObj
=
pAcct
,
...
...
src/mnode/src/mnodeCluster.c
浏览文件 @
f38b2182
...
...
@@ -32,31 +32,31 @@ static int32_t mnodeCreateCluster();
static
int32_t
mnodeGetClusterMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveClusters
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeClusterActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeClusterActionDestroy
(
SS
WriteMsg
*
pOper
)
{
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeClusterActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeClusterActionInsert
(
SS
WriteMsg
*
pOper
)
{
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeClusterActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeClusterActionDelete
(
SS
WriteMsg
*
pOper
)
{
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeClusterActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeClusterActionUpdate
(
SS
WriteMsg
*
pOper
)
{
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeClusterActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeClusterActionEncode
(
SS
WriteMsg
*
pOper
)
{
SClusterObj
*
pCluster
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pCluster
,
tsClusterUpdateSize
);
pOper
->
rowSize
=
tsClusterUpdateSize
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeClusterActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeClusterActionDecode
(
SS
WriteMsg
*
pOper
)
{
SClusterObj
*
pCluster
=
(
SClusterObj
*
)
calloc
(
1
,
sizeof
(
SClusterObj
));
if
(
pCluster
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -91,13 +91,13 @@ int32_t mnodeInitCluster() {
.
maxRowSize
=
tsClusterUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
.
insertFp
=
mnodeClusterActionInsert
,
.
deleteFp
=
mnodeClusterActionDelete
,
.
updateFp
=
mnodeClusterActionUpdate
,
.
encodeFp
=
mnodeClusterActionEncode
,
.
decodeFp
=
mnodeClusterActionDecode
,
.
destroyFp
=
mnodeClusterActionDestroy
,
.
restoredFp
=
mnodeClusterActionRestored
.
fpInsert
=
mnodeClusterActionInsert
,
.
fpDelete
=
mnodeClusterActionDelete
,
.
fpUpdate
=
mnodeClusterActionUpdate
,
.
fpEncode
=
mnodeClusterActionEncode
,
.
fpDecode
=
mnodeClusterActionDecode
,
.
fpDestroy
=
mnodeClusterActionDestroy
,
.
fpDestored
=
mnodeClusterActionRestored
};
tsClusterSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -145,7 +145,7 @@ static int32_t mnodeCreateCluster() {
mDebug
(
"uid is %s"
,
pCluster
->
uid
);
}
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsClusterSdb
,
.
pObj
=
pCluster
,
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
f38b2182
...
...
@@ -56,7 +56,7 @@ static void mnodeDestroyDb(SDbObj *pDb) {
tfree
(
pDb
);
}
static
int32_t
mnodeDbActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDbActionDestroy
(
SS
WriteMsg
*
pOper
)
{
mnodeDestroyDb
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -65,7 +65,7 @@ int64_t mnodeGetDbNum() {
return
sdbGetNumOfRows
(
tsDbSdb
);
}
static
int32_t
mnodeDbActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDbActionInsert
(
SS
WriteMsg
*
pOper
)
{
SDbObj
*
pDb
=
pOper
->
pObj
;
SAcctObj
*
pAcct
=
mnodeGetAcct
(
pDb
->
acct
);
...
...
@@ -91,7 +91,7 @@ static int32_t mnodeDbActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDbActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDbActionDelete
(
SS
WriteMsg
*
pOper
)
{
SDbObj
*
pDb
=
pOper
->
pObj
;
SAcctObj
*
pAcct
=
mnodeGetAcct
(
pDb
->
acct
);
...
...
@@ -107,7 +107,7 @@ static int32_t mnodeDbActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDbActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDbActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SDbObj
*
pNew
=
pOper
->
pObj
;
SDbObj
*
pDb
=
mnodeGetDb
(
pNew
->
name
);
if
(
pDb
!=
NULL
&&
pNew
!=
pDb
)
{
...
...
@@ -120,14 +120,14 @@ static int32_t mnodeDbActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDbActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDbActionEncode
(
SS
WriteMsg
*
pOper
)
{
SDbObj
*
pDb
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pDb
,
tsDbUpdateSize
);
pOper
->
rowSize
=
tsDbUpdateSize
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDbActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDbActionDecode
(
SS
WriteMsg
*
pOper
)
{
SDbObj
*
pDb
=
(
SDbObj
*
)
calloc
(
1
,
sizeof
(
SDbObj
));
if
(
pDb
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -151,13 +151,13 @@ int32_t mnodeInitDbs() {
.
maxRowSize
=
tsDbUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
.
insertFp
=
mnodeDbActionInsert
,
.
deleteFp
=
mnodeDbActionDelete
,
.
updateFp
=
mnodeDbActionUpdate
,
.
encodeFp
=
mnodeDbActionEncode
,
.
decodeFp
=
mnodeDbActionDecode
,
.
destroyFp
=
mnodeDbActionDestroy
,
.
restoredFp
=
mnodeDbActionRestored
.
fpInsert
=
mnodeDbActionInsert
,
.
fpDelete
=
mnodeDbActionDelete
,
.
fpUpdate
=
mnodeDbActionUpdate
,
.
fpEncode
=
mnodeDbActionEncode
,
.
fpDecode
=
mnodeDbActionDecode
,
.
fpDestroy
=
mnodeDbActionDestroy
,
.
fpDestored
=
mnodeDbActionRestored
};
tsDbSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -412,7 +412,7 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *
pMsg
->
pDb
=
pDb
;
mnodeIncDbRef
(
pDb
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDbSdb
,
.
pObj
=
pDb
,
...
...
@@ -807,7 +807,7 @@ static int32_t mnodeSetDbDropping(SDbObj *pDb) {
if
(
pDb
->
status
)
return
TSDB_CODE_SUCCESS
;
pDb
->
status
=
true
;
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDbSdb
,
.
pObj
=
pDb
...
...
@@ -1019,7 +1019,7 @@ static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) {
if
(
memcmp
(
&
newCfg
,
&
pDb
->
cfg
,
sizeof
(
SDbCfg
))
!=
0
)
{
pDb
->
cfg
=
newCfg
;
pDb
->
cfgVersion
++
;
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDbSdb
,
.
pObj
=
pDb
,
...
...
@@ -1071,7 +1071,7 @@ static int32_t mnodeDropDb(SMnodeMsg *pMsg) {
SDbObj
*
pDb
=
pMsg
->
pDb
;
mInfo
(
"db:%s, drop db from sdb"
,
pDb
->
name
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDbSdb
,
.
pObj
=
pDb
,
...
...
@@ -1134,7 +1134,7 @@ void mnodeDropAllDbs(SAcctObj *pAcct) {
if
(
pDb
->
pAcct
==
pAcct
)
{
mInfo
(
"db:%s, drop db from sdb for acct:%s is dropped"
,
pDb
->
name
,
pAcct
->
user
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsDbSdb
,
.
pObj
=
pDb
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
f38b2182
...
...
@@ -87,12 +87,12 @@ static char* offlineReason[] = {
"unknown"
,
};
static
int32_t
mnodeDnodeActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDnodeActionDestroy
(
SS
WriteMsg
*
pOper
)
{
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDnodeActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDnodeActionInsert
(
SS
WriteMsg
*
pOper
)
{
SDnodeObj
*
pDnode
=
pOper
->
pObj
;
if
(
pDnode
->
status
!=
TAOS_DN_STATUS_DROPPING
)
{
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
...
...
@@ -107,7 +107,7 @@ static int32_t mnodeDnodeActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDnodeActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDnodeActionDelete
(
SS
WriteMsg
*
pOper
)
{
SDnodeObj
*
pDnode
=
pOper
->
pObj
;
#ifndef _SYNC
...
...
@@ -121,7 +121,7 @@ static int32_t mnodeDnodeActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDnodeActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDnodeActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SDnodeObj
*
pNew
=
pOper
->
pObj
;
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pNew
->
dnodeId
);
if
(
pDnode
!=
NULL
&&
pNew
!=
pDnode
)
{
...
...
@@ -134,14 +134,14 @@ static int32_t mnodeDnodeActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDnodeActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDnodeActionEncode
(
SS
WriteMsg
*
pOper
)
{
SDnodeObj
*
pDnode
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pDnode
,
tsDnodeUpdateSize
);
pOper
->
rowSize
=
tsDnodeUpdateSize
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeDnodeActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeDnodeActionDecode
(
SS
WriteMsg
*
pOper
)
{
SDnodeObj
*
pDnode
=
(
SDnodeObj
*
)
calloc
(
1
,
sizeof
(
SDnodeObj
));
if
(
pDnode
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -178,13 +178,13 @@ int32_t mnodeInitDnodes() {
.
maxRowSize
=
tsDnodeUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_AUTO
,
.
insertFp
=
mnodeDnodeActionInsert
,
.
deleteFp
=
mnodeDnodeActionDelete
,
.
updateFp
=
mnodeDnodeActionUpdate
,
.
encodeFp
=
mnodeDnodeActionEncode
,
.
decodeFp
=
mnodeDnodeActionDecode
,
.
destroyFp
=
mnodeDnodeActionDestroy
,
.
restoredFp
=
mnodeDnodeActionRestored
.
fpInsert
=
mnodeDnodeActionInsert
,
.
fpDelete
=
mnodeDnodeActionDelete
,
.
fpUpdate
=
mnodeDnodeActionUpdate
,
.
fpEncode
=
mnodeDnodeActionEncode
,
.
fpDecode
=
mnodeDnodeActionDecode
,
.
fpDestroy
=
mnodeDnodeActionDestroy
,
.
fpDestored
=
mnodeDnodeActionRestored
};
tsDnodeSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -296,7 +296,7 @@ void mnodeDecDnodeRef(SDnodeObj *pDnode) {
}
void
mnodeUpdateDnode
(
SDnodeObj
*
pDnode
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDnodeSdb
,
.
pObj
=
pDnode
...
...
@@ -644,7 +644,7 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) {
tstrncpy
(
pDnode
->
dnodeEp
,
ep
,
TSDB_EP_LEN
);
taosGetFqdnPortFromEp
(
ep
,
pDnode
->
dnodeFqdn
,
&
pDnode
->
dnodePort
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDnodeSdb
,
.
pObj
=
pDnode
,
...
...
@@ -665,7 +665,7 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) {
}
int32_t
mnodeDropDnode
(
SDnodeObj
*
pDnode
,
void
*
pMsg
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsDnodeSdb
,
.
pObj
=
pDnode
,
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
f38b2182
...
...
@@ -58,12 +58,12 @@ static int32_t mnodeRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, vo
#define mnodeMnodeDestroyLock() pthread_mutex_destroy(&tsMnodeLock)
#endif
static
int32_t
mnodeMnodeActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeMnodeActionDestroy
(
SS
WriteMsg
*
pOper
)
{
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeMnodeActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeMnodeActionInsert
(
SS
WriteMsg
*
pOper
)
{
SMnodeObj
*
pMnode
=
pOper
->
pObj
;
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMnode
->
mnodeId
);
if
(
pDnode
==
NULL
)
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
...
...
@@ -76,7 +76,7 @@ static int32_t mnodeMnodeActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeMnodeActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeMnodeActionDelete
(
SS
WriteMsg
*
pOper
)
{
SMnodeObj
*
pMnode
=
pOper
->
pObj
;
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMnode
->
mnodeId
);
...
...
@@ -88,7 +88,7 @@ static int32_t mnodeMnodeActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeMnodeActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeMnodeActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SMnodeObj
*
pMnode
=
pOper
->
pObj
;
SMnodeObj
*
pSaved
=
mnodeGetMnode
(
pMnode
->
mnodeId
);
if
(
pMnode
!=
pSaved
)
{
...
...
@@ -99,14 +99,14 @@ static int32_t mnodeMnodeActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeMnodeActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeMnodeActionEncode
(
SS
WriteMsg
*
pOper
)
{
SMnodeObj
*
pMnode
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pMnode
,
tsMnodeUpdateSize
);
pOper
->
rowSize
=
tsMnodeUpdateSize
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeMnodeActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeMnodeActionDecode
(
SS
WriteMsg
*
pOper
)
{
SMnodeObj
*
pMnode
=
calloc
(
1
,
sizeof
(
SMnodeObj
));
if
(
pMnode
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -144,13 +144,13 @@ int32_t mnodeInitMnodes() {
.
maxRowSize
=
tsMnodeUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_INT
,
.
insertFp
=
mnodeMnodeActionInsert
,
.
deleteFp
=
mnodeMnodeActionDelete
,
.
updateFp
=
mnodeMnodeActionUpdate
,
.
encodeFp
=
mnodeMnodeActionEncode
,
.
decodeFp
=
mnodeMnodeActionDecode
,
.
destroyFp
=
mnodeMnodeActionDestroy
,
.
restoredFp
=
mnodeMnodeActionRestored
.
fpInsert
=
mnodeMnodeActionInsert
,
.
fpDelete
=
mnodeMnodeActionDelete
,
.
fpUpdate
=
mnodeMnodeActionUpdate
,
.
fpEncode
=
mnodeMnodeActionEncode
,
.
fpDecode
=
mnodeMnodeActionDecode
,
.
fpDestroy
=
mnodeMnodeActionDestroy
,
.
fpDestored
=
mnodeMnodeActionRestored
};
tsMnodeSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -329,7 +329,7 @@ void mnodeCreateMnode(int32_t dnodeId, char *dnodeEp, bool needConfirm) {
pMnode
->
mnodeId
=
dnodeId
;
pMnode
->
createdTime
=
taosGetTimestampMs
();
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsMnodeSdb
,
.
pObj
=
pMnode
,
...
...
@@ -356,7 +356,7 @@ void mnodeCreateMnode(int32_t dnodeId, char *dnodeEp, bool needConfirm) {
void
mnodeDropMnodeLocal
(
int32_t
dnodeId
)
{
SMnodeObj
*
pMnode
=
mnodeGetMnode
(
dnodeId
);
if
(
pMnode
!=
NULL
)
{
SS
dbOper
oper
=
{.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsMnodeSdb
,
.
pObj
=
pMnode
};
SS
WriteMsg
oper
=
{.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsMnodeSdb
,
.
pObj
=
pMnode
};
sdbDeleteRow
(
&
oper
);
mnodeDecMnodeRef
(
pMnode
);
}
...
...
@@ -371,7 +371,7 @@ int32_t mnodeDropMnode(int32_t dnodeId) {
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
}
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsMnodeSdb
,
.
pObj
=
pMnode
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
f38b2182
此差异已折叠。
点击以展开。
src/mnode/src/mnodeTable.c
浏览文件 @
f38b2182
...
...
@@ -99,12 +99,12 @@ static void mnodeDestroyChildTable(SCTableObj *pTable) {
tfree
(
pTable
);
}
static
int32_t
mnodeChildTableActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeChildTableActionDestroy
(
SS
WriteMsg
*
pOper
)
{
mnodeDestroyChildTable
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeChildTableActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeChildTableActionInsert
(
SS
WriteMsg
*
pOper
)
{
SCTableObj
*
pTable
=
pOper
->
pObj
;
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pTable
->
vgId
);
...
...
@@ -153,7 +153,7 @@ static int32_t mnodeChildTableActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeChildTableActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeChildTableActionDelete
(
SS
WriteMsg
*
pOper
)
{
SCTableObj
*
pTable
=
pOper
->
pObj
;
if
(
pTable
->
vgId
==
0
)
{
return
TSDB_CODE_MND_VGROUP_NOT_EXIST
;
...
...
@@ -189,7 +189,7 @@ static int32_t mnodeChildTableActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeChildTableActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeChildTableActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SCTableObj
*
pNew
=
pOper
->
pObj
;
SCTableObj
*
pTable
=
mnodeGetChildTable
(
pNew
->
info
.
tableId
);
if
(
pTable
!=
pNew
)
{
...
...
@@ -216,7 +216,7 @@ static int32_t mnodeChildTableActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeChildTableActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeChildTableActionEncode
(
SS
WriteMsg
*
pOper
)
{
SCTableObj
*
pTable
=
pOper
->
pObj
;
assert
(
pTable
!=
NULL
&&
pOper
->
rowData
!=
NULL
);
...
...
@@ -246,7 +246,7 @@ static int32_t mnodeChildTableActionEncode(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeChildTableActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeChildTableActionDecode
(
SS
WriteMsg
*
pOper
)
{
assert
(
pOper
->
rowData
!=
NULL
);
SCTableObj
*
pTable
=
calloc
(
1
,
sizeof
(
SCTableObj
));
if
(
pTable
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -297,7 +297,7 @@ static int32_t mnodeChildTableActionRestored() {
SDbObj
*
pDb
=
mnodeGetDbByTableId
(
pTable
->
info
.
tableId
);
if
(
pDb
==
NULL
||
pDb
->
status
!=
TSDB_DB_STATUS_READY
)
{
mError
(
"ctable:%s, failed to get db or db in dropping, discard it"
,
pTable
->
info
.
tableId
);
SS
dbOper
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
sdbDeleteRow
(
&
desc
);
mnodeDecTableRef
(
pTable
);
mnodeDecDbRef
(
pDb
);
...
...
@@ -309,7 +309,7 @@ static int32_t mnodeChildTableActionRestored() {
if
(
pVgroup
==
NULL
)
{
mError
(
"ctable:%s, failed to get vgId:%d tid:%d, discard it"
,
pTable
->
info
.
tableId
,
pTable
->
vgId
,
pTable
->
tid
);
pTable
->
vgId
=
0
;
SS
dbOper
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
sdbDeleteRow
(
&
desc
);
mnodeDecTableRef
(
pTable
);
continue
;
...
...
@@ -320,7 +320,7 @@ static int32_t mnodeChildTableActionRestored() {
mError
(
"ctable:%s, db:%s not match with vgId:%d db:%s sid:%d, discard it"
,
pTable
->
info
.
tableId
,
pDb
->
name
,
pTable
->
vgId
,
pVgroup
->
dbName
,
pTable
->
tid
);
pTable
->
vgId
=
0
;
SS
dbOper
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
sdbDeleteRow
(
&
desc
);
mnodeDecTableRef
(
pTable
);
continue
;
...
...
@@ -331,7 +331,7 @@ static int32_t mnodeChildTableActionRestored() {
if
(
pSuperTable
==
NULL
)
{
mError
(
"ctable:%s, stable:%"
PRIu64
" not exist"
,
pTable
->
info
.
tableId
,
pTable
->
suid
);
pTable
->
vgId
=
0
;
SS
dbOper
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_LOCAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
sdbDeleteRow
(
&
desc
);
mnodeDecTableRef
(
pTable
);
continue
;
...
...
@@ -358,13 +358,13 @@ static int32_t mnodeInitChildTables() {
.
maxRowSize
=
sizeof
(
SCTableObj
)
+
sizeof
(
SSchema
)
*
(
TSDB_MAX_TAGS
+
TSDB_MAX_COLUMNS
+
16
)
+
TSDB_TABLE_FNAME_LEN
+
TSDB_CQ_SQL_SIZE
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_VAR_STRING
,
.
insertFp
=
mnodeChildTableActionInsert
,
.
deleteFp
=
mnodeChildTableActionDelete
,
.
updateFp
=
mnodeChildTableActionUpdate
,
.
encodeFp
=
mnodeChildTableActionEncode
,
.
decodeFp
=
mnodeChildTableActionDecode
,
.
destroyFp
=
mnodeChildTableActionDestroy
,
.
restoredFp
=
mnodeChildTableActionRestored
.
fpInsert
=
mnodeChildTableActionInsert
,
.
fpDelete
=
mnodeChildTableActionDelete
,
.
fpUpdate
=
mnodeChildTableActionUpdate
,
.
fpEncode
=
mnodeChildTableActionEncode
,
.
fpDecode
=
mnodeChildTableActionDecode
,
.
fpDestroy
=
mnodeChildTableActionDestroy
,
.
fpDestored
=
mnodeChildTableActionRestored
};
tsChildTableSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -430,12 +430,12 @@ static void mnodeDestroySuperTable(SSTableObj *pStable) {
tfree
(
pStable
);
}
static
int32_t
mnodeSuperTableActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeSuperTableActionDestroy
(
SS
WriteMsg
*
pOper
)
{
mnodeDestroySuperTable
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeSuperTableActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeSuperTableActionInsert
(
SS
WriteMsg
*
pOper
)
{
SSTableObj
*
pStable
=
pOper
->
pObj
;
SDbObj
*
pDb
=
mnodeGetDbByTableId
(
pStable
->
info
.
tableId
);
if
(
pDb
!=
NULL
&&
pDb
->
status
==
TSDB_DB_STATUS_READY
)
{
...
...
@@ -446,7 +446,7 @@ static int32_t mnodeSuperTableActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeSuperTableActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeSuperTableActionDelete
(
SS
WriteMsg
*
pOper
)
{
SSTableObj
*
pStable
=
pOper
->
pObj
;
SDbObj
*
pDb
=
mnodeGetDbByTableId
(
pStable
->
info
.
tableId
);
if
(
pDb
!=
NULL
)
{
...
...
@@ -458,7 +458,7 @@ static int32_t mnodeSuperTableActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeSuperTableActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeSuperTableActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SSTableObj
*
pNew
=
pOper
->
pObj
;
SSTableObj
*
pTable
=
mnodeGetSuperTable
(
pNew
->
info
.
tableId
);
if
(
pTable
!=
NULL
&&
pTable
!=
pNew
)
{
...
...
@@ -483,7 +483,7 @@ static int32_t mnodeSuperTableActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeSuperTableActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeSuperTableActionEncode
(
SS
WriteMsg
*
pOper
)
{
SSTableObj
*
pStable
=
pOper
->
pObj
;
assert
(
pOper
->
pObj
!=
NULL
&&
pOper
->
rowData
!=
NULL
);
...
...
@@ -506,7 +506,7 @@ static int32_t mnodeSuperTableActionEncode(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeSuperTableActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeSuperTableActionDecode
(
SS
WriteMsg
*
pOper
)
{
assert
(
pOper
->
rowData
!=
NULL
);
SSTableObj
*
pStable
=
(
SSTableObj
*
)
calloc
(
1
,
sizeof
(
SSTableObj
));
if
(
pStable
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -551,13 +551,13 @@ static int32_t mnodeInitSuperTables() {
.
maxRowSize
=
sizeof
(
SSTableObj
)
+
sizeof
(
SSchema
)
*
(
TSDB_MAX_TAGS
+
TSDB_MAX_COLUMNS
+
16
)
+
TSDB_TABLE_FNAME_LEN
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_VAR_STRING
,
.
insertFp
=
mnodeSuperTableActionInsert
,
.
deleteFp
=
mnodeSuperTableActionDelete
,
.
updateFp
=
mnodeSuperTableActionUpdate
,
.
encodeFp
=
mnodeSuperTableActionEncode
,
.
decodeFp
=
mnodeSuperTableActionDecode
,
.
destroyFp
=
mnodeSuperTableActionDestroy
,
.
restoredFp
=
mnodeSuperTableActionRestored
.
fpInsert
=
mnodeSuperTableActionInsert
,
.
fpDelete
=
mnodeSuperTableActionDelete
,
.
fpUpdate
=
mnodeSuperTableActionUpdate
,
.
fpEncode
=
mnodeSuperTableActionEncode
,
.
fpDecode
=
mnodeSuperTableActionDecode
,
.
fpDestroy
=
mnodeSuperTableActionDestroy
,
.
fpDestored
=
mnodeSuperTableActionRestored
};
tsSuperTableSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -828,7 +828,7 @@ static int32_t mnodeCreateSuperTableCb(SMnodeMsg *pMsg, int32_t code) {
}
else
{
mError
(
"app:%p:%p, stable:%s, failed to create in sdb, reason:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
tstrerror
(
code
));
SS
dbOper
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pTable
,
.
table
=
tsSuperTableSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pTable
,
.
table
=
tsSuperTableSdb
};
sdbDeleteRow
(
&
desc
);
}
...
...
@@ -878,7 +878,7 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
pMsg
->
pTable
=
(
STableObj
*
)
pStable
;
mnodeIncTableRef
(
pMsg
->
pTable
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -937,7 +937,7 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
mnodeDropAllChildTablesInStable
(
pStable
);
}
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1010,7 +1010,7 @@ static int32_t mnodeAddSuperTableTag(SMnodeMsg *pMsg, SSchema schema[], int32_t
mInfo
(
"app:%p:%p, stable %s, start to add tag %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
schema
[
0
].
name
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1044,7 +1044,7 @@ static int32_t mnodeDropSuperTableTag(SMnodeMsg *pMsg, char *tagName) {
mInfo
(
"app:%p:%p, stable %s, start to drop tag %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tagName
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1088,7 +1088,7 @@ static int32_t mnodeModifySuperTableTagName(SMnodeMsg *pMsg, char *oldTagName, c
mInfo
(
"app:%p:%p, stable %s, start to modify tag %s to %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
oldTagName
,
newTagName
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1162,7 +1162,7 @@ static int32_t mnodeAddSuperTableColumn(SMnodeMsg *pMsg, SSchema schema[], int32
mInfo
(
"app:%p:%p, stable %s, start to add column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1207,7 +1207,7 @@ static int32_t mnodeDropSuperTableColumn(SMnodeMsg *pMsg, char *colName) {
mInfo
(
"app:%p:%p, stable %s, start to delete column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1251,7 +1251,7 @@ static int32_t mnodeChangeSuperTableColumn(SMnodeMsg *pMsg, char *oldName, char
mInfo
(
"app:%p:%p, stable %s, start to modify column %s to %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
oldName
,
newName
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
...
...
@@ -1417,7 +1417,7 @@ void mnodeDropAllSuperTables(SDbObj *pDropDb) {
if
(
pTable
==
NULL
)
break
;
if
(
strncmp
(
prefix
,
pTable
->
info
.
tableId
,
prefixLen
)
==
0
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -1694,7 +1694,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
}
else
{
mError
(
"app:%p:%p, table:%s, failed to create table sid:%d, uid:%"
PRIu64
", reason:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
pTable
->
tid
,
pTable
->
uid
,
tstrerror
(
code
));
SS
dbOper
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
};
sdbDeleteRow
(
&
desc
);
return
code
;
}
...
...
@@ -1780,7 +1780,7 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) {
pMsg
->
pTable
=
(
STableObj
*
)
pTable
;
mnodeIncTableRef
(
pMsg
->
pTable
);
SS
dbOper
desc
=
{
SS
WriteMsg
desc
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
,
...
...
@@ -1901,7 +1901,7 @@ static int32_t mnodeProcessDropChildTableMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_APP_ERROR
;
}
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2005,7 +2005,7 @@ static int32_t mnodeAddNormalTableColumn(SMnodeMsg *pMsg, SSchema schema[], int3
mInfo
(
"app:%p:%p, ctable %s, start to add column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2038,7 +2038,7 @@ static int32_t mnodeDropNormalTableColumn(SMnodeMsg *pMsg, char *colName) {
mInfo
(
"app:%p:%p, ctable %s, start to drop column %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
colName
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2075,7 +2075,7 @@ static int32_t mnodeChangeNormalTableColumn(SMnodeMsg *pMsg, char *oldName, char
mInfo
(
"app:%p:%p, ctable %s, start to modify column %s to %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
oldName
,
newName
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2218,7 +2218,7 @@ void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup) {
if
(
pTable
==
NULL
)
break
;
if
(
pTable
->
vgId
==
pVgroup
->
vgId
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2251,7 +2251,7 @@ void mnodeDropAllChildTables(SDbObj *pDropDb) {
if
(
pTable
==
NULL
)
break
;
if
(
strncmp
(
prefix
,
pTable
->
info
.
tableId
,
prefixLen
)
==
0
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2280,7 +2280,7 @@ static void mnodeDropAllChildTablesInStable(SSTableObj *pStable) {
if
(
pTable
==
NULL
)
break
;
if
(
pTable
->
superTable
==
pStable
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
...
...
@@ -2410,7 +2410,7 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
}
if
(
rpcMsg
->
code
==
TSDB_CODE_SUCCESS
||
rpcMsg
->
code
==
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
)
{
SS
dbOper
desc
=
{
SS
WriteMsg
desc
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pTable
,
.
table
=
tsChildTableSdb
,
...
...
@@ -2440,7 +2440,7 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
mnodeMsg
->
rpcMsg
.
ahandle
,
mnodeMsg
,
pTable
->
info
.
tableId
,
pTable
->
vgId
,
pTable
->
tid
,
pTable
->
uid
,
tstrerror
(
rpcMsg
->
code
),
mnodeMsg
->
rpcMsg
.
handle
,
mnodeMsg
->
incomingTs
,
sec
,
mnodeMsg
->
retry
);
SS
dbOper
oper
=
{.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
};
SS
WriteMsg
oper
=
{.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
};
sdbDeleteRow
(
&
oper
);
if
(
rpcMsg
->
code
==
TSDB_CODE_APP_NOT_READY
)
{
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
f38b2182
...
...
@@ -42,12 +42,12 @@ static int32_t mnodeProcessAlterUserMsg(SMnodeMsg *pMsg);
static
int32_t
mnodeProcessDropUserMsg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mnodeProcessAuthMsg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mnodeUserActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeUserActionDestroy
(
SS
WriteMsg
*
pOper
)
{
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeUserActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeUserActionInsert
(
SS
WriteMsg
*
pOper
)
{
SUserObj
*
pUser
=
pOper
->
pObj
;
SAcctObj
*
pAcct
=
mnodeGetAcct
(
pUser
->
acct
);
...
...
@@ -62,7 +62,7 @@ static int32_t mnodeUserActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeUserActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeUserActionDelete
(
SS
WriteMsg
*
pOper
)
{
SUserObj
*
pUser
=
pOper
->
pObj
;
SAcctObj
*
pAcct
=
mnodeGetAcct
(
pUser
->
acct
);
...
...
@@ -74,7 +74,7 @@ static int32_t mnodeUserActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeUserActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeUserActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SUserObj
*
pUser
=
pOper
->
pObj
;
SUserObj
*
pSaved
=
mnodeGetUser
(
pUser
->
user
);
if
(
pUser
!=
pSaved
)
{
...
...
@@ -85,14 +85,14 @@ static int32_t mnodeUserActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeUserActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeUserActionEncode
(
SS
WriteMsg
*
pOper
)
{
SUserObj
*
pUser
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pUser
,
tsUserUpdateSize
);
pOper
->
rowSize
=
tsUserUpdateSize
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeUserActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeUserActionDecode
(
SS
WriteMsg
*
pOper
)
{
SUserObj
*
pUser
=
(
SUserObj
*
)
calloc
(
1
,
sizeof
(
SUserObj
));
if
(
pUser
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -157,13 +157,13 @@ int32_t mnodeInitUsers() {
.
maxRowSize
=
tsUserUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
.
insertFp
=
mnodeUserActionInsert
,
.
deleteFp
=
mnodeUserActionDelete
,
.
updateFp
=
mnodeUserActionUpdate
,
.
encodeFp
=
mnodeUserActionEncode
,
.
decodeFp
=
mnodeUserActionDecode
,
.
destroyFp
=
mnodeUserActionDestroy
,
.
restoredFp
=
mnodeUserActionRestored
.
fpInsert
=
mnodeUserActionInsert
,
.
fpDelete
=
mnodeUserActionDelete
,
.
fpUpdate
=
mnodeUserActionUpdate
,
.
fpEncode
=
mnodeUserActionEncode
,
.
fpDecode
=
mnodeUserActionDecode
,
.
fpDestroy
=
mnodeUserActionDestroy
,
.
fpDestored
=
mnodeUserActionRestored
};
tsUserSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -205,7 +205,7 @@ void mnodeDecUserRef(SUserObj *pUser) {
}
static
int32_t
mnodeUpdateUser
(
SUserObj
*
pUser
,
void
*
pMsg
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsUserSdb
,
.
pObj
=
pUser
,
...
...
@@ -259,7 +259,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) {
pUser
->
superAuth
=
1
;
}
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsUserSdb
,
.
pObj
=
pUser
,
...
...
@@ -279,7 +279,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) {
}
static
int32_t
mnodeDropUser
(
SUserObj
*
pUser
,
void
*
pMsg
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsUserSdb
,
.
pObj
=
pUser
,
...
...
@@ -562,7 +562,7 @@ void mnodeDropAllUsers(SAcctObj *pAcct) {
if
(
pUser
==
NULL
)
break
;
if
(
strncmp
(
pUser
->
acct
,
pAcct
->
user
,
acctNameLen
)
==
0
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsUserSdb
,
.
pObj
=
pUser
,
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
f38b2182
...
...
@@ -72,12 +72,12 @@ static void mnodeDestroyVgroup(SVgObj *pVgroup) {
tfree
(
pVgroup
);
}
static
int32_t
mnodeVgroupActionDestroy
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeVgroupActionDestroy
(
SS
WriteMsg
*
pOper
)
{
mnodeDestroyVgroup
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeVgroupActionInsert
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeVgroupActionInsert
(
SS
WriteMsg
*
pOper
)
{
SVgObj
*
pVgroup
=
pOper
->
pObj
;
// refer to db
...
...
@@ -115,7 +115,7 @@ static int32_t mnodeVgroupActionInsert(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeVgroupActionDelete
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeVgroupActionDelete
(
SS
WriteMsg
*
pOper
)
{
SVgObj
*
pVgroup
=
pOper
->
pObj
;
if
(
pVgroup
->
pDb
==
NULL
)
{
...
...
@@ -137,7 +137,7 @@ static int32_t mnodeVgroupActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeVgroupActionUpdate
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeVgroupActionUpdate
(
SS
WriteMsg
*
pOper
)
{
SVgObj
*
pNew
=
pOper
->
pObj
;
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pNew
->
vgId
);
...
...
@@ -176,7 +176,7 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeVgroupActionEncode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeVgroupActionEncode
(
SS
WriteMsg
*
pOper
)
{
SVgObj
*
pVgroup
=
pOper
->
pObj
;
memcpy
(
pOper
->
rowData
,
pVgroup
,
tsVgUpdateSize
);
SVgObj
*
pTmpVgroup
=
pOper
->
rowData
;
...
...
@@ -189,7 +189,7 @@ static int32_t mnodeVgroupActionEncode(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeVgroupActionDecode
(
SS
dbOper
*
pOper
)
{
static
int32_t
mnodeVgroupActionDecode
(
SS
WriteMsg
*
pOper
)
{
SVgObj
*
pVgroup
=
(
SVgObj
*
)
calloc
(
1
,
sizeof
(
SVgObj
));
if
(
pVgroup
==
NULL
)
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -213,13 +213,13 @@ int32_t mnodeInitVgroups() {
.
maxRowSize
=
tsVgUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_AUTO
,
.
insertFp
=
mnodeVgroupActionInsert
,
.
deleteFp
=
mnodeVgroupActionDelete
,
.
updateFp
=
mnodeVgroupActionUpdate
,
.
encodeFp
=
mnodeVgroupActionEncode
,
.
decodeFp
=
mnodeVgroupActionDecode
,
.
destroyFp
=
mnodeVgroupActionDestroy
,
.
restoredFp
=
mnodeVgroupActionRestored
,
.
fpInsert
=
mnodeVgroupActionInsert
,
.
fpDelete
=
mnodeVgroupActionDelete
,
.
fpUpdate
=
mnodeVgroupActionUpdate
,
.
fpEncode
=
mnodeVgroupActionEncode
,
.
fpDecode
=
mnodeVgroupActionDecode
,
.
fpDestroy
=
mnodeVgroupActionDestroy
,
.
fpDestored
=
mnodeVgroupActionRestored
,
};
tsVgroupSdb
=
sdbOpenTable
(
&
tableDesc
);
...
...
@@ -253,7 +253,7 @@ SVgObj *mnodeGetVgroup(int32_t vgId) {
}
void
mnodeUpdateVgroup
(
SVgObj
*
pVgroup
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
...
...
@@ -519,14 +519,14 @@ static int32_t mnodeCreateVgroupCb(SMnodeMsg *pMsg, int32_t code) {
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mError
(
"app:%p:%p, vgId:%d, failed to create in sdb, reason:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pVgroup
->
vgId
,
tstrerror
(
code
));
SS
dbOper
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pVgroup
,
.
table
=
tsVgroupSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pVgroup
,
.
table
=
tsVgroupSdb
};
sdbDeleteRow
(
&
desc
);
return
code
;
}
else
{
mInfo
(
"app:%p:%p, vgId:%d, is created in sdb, db:%s replica:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pVgroup
->
vgId
,
pDb
->
name
,
pVgroup
->
numOfVnodes
);
pVgroup
->
status
=
TAOS_VG_STATUS_READY
;
SS
dbOper
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pVgroup
,
.
table
=
tsVgroupSdb
};
SS
WriteMsg
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pVgroup
,
.
table
=
tsVgroupSdb
};
(
void
)
sdbUpdateRow
(
&
desc
);
dnodeReprocessMWriteMsg
(
pMsg
);
...
...
@@ -535,7 +535,7 @@ static int32_t mnodeCreateVgroupCb(SMnodeMsg *pMsg, int32_t code) {
// mInfo("app:%p:%p, vgId:%d, is created in sdb, db:%s replica:%d", pMsg->rpcMsg.ahandle, pMsg, pVgroup->vgId,
// pDb->name, pVgroup->numOfVnodes);
// pVgroup->status = TAOS_VG_STATUS_READY;
// SS
dbOper
desc = {.type = SDB_OPER_GLOBAL, .pObj = pVgroup, .table = tsVgroupSdb};
// SS
WriteMsg
desc = {.type = SDB_OPER_GLOBAL, .pObj = pVgroup, .table = tsVgroupSdb};
// (void)sdbUpdateRow(&desc);
// dnodeReprocessMWriteMsg(pMsg);
// return TSDB_CODE_MND_ACTION_IN_PROGRESS;
...
...
@@ -571,7 +571,7 @@ int32_t mnodeCreateVgroup(SMnodeMsg *pMsg) {
pMsg
->
pVgroup
=
pVgroup
;
mnodeIncVgroupRef
(
pVgroup
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
,
...
...
@@ -595,7 +595,7 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle) {
}
else
{
mDebug
(
"vgId:%d, replica:%d is deleting from sdb"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
);
mnodeSendDropVgroupMsg
(
pVgroup
,
NULL
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
...
...
@@ -957,7 +957,7 @@ static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg) {
if
(
mnodeMsg
->
received
!=
mnodeMsg
->
expected
)
return
;
if
(
mnodeMsg
->
received
==
mnodeMsg
->
successed
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
,
...
...
@@ -973,7 +973,7 @@ static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg) {
dnodeSendRpcMWriteRsp
(
mnodeMsg
,
code
);
}
}
else
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
...
...
@@ -1031,7 +1031,7 @@ static void mnodeProcessDropVnodeRsp(SRpcMsg *rpcMsg) {
if
(
mnodeMsg
->
received
!=
mnodeMsg
->
expected
)
return
;
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
...
...
@@ -1084,7 +1084,7 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
if
(
pVgroup
->
vnodeGid
[
0
].
dnodeId
==
pDropDnode
->
dnodeId
)
{
mnodeDropAllChildTablesInVgroups
(
pVgroup
);
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
,
...
...
@@ -1135,7 +1135,7 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) {
if
(
pVgroup
==
NULL
)
break
;
if
(
pVgroup
->
pDb
==
pDropDb
)
{
SS
dbOper
oper
=
{
SS
WriteMsg
oper
=
{
.
type
=
SDB_OPER_LOCAL
,
.
table
=
tsVgroupSdb
,
.
pObj
=
pVgroup
,
...
...
src/plugins/http/inc/httpInt.h
浏览文件 @
f38b2182
...
...
@@ -118,7 +118,7 @@ typedef struct {
typedef
struct
{
char
*
module
;
bool
(
*
decodeFp
)(
struct
HttpContext
*
pContext
);
bool
(
*
fpDecode
)(
struct
HttpContext
*
pContext
);
}
HttpDecodeMethod
;
typedef
struct
{
...
...
src/plugins/http/src/httpHandle.c
浏览文件 @
f38b2182
...
...
@@ -21,11 +21,11 @@
#include "httpHandle.h"
bool
httpDecodeRequest
(
HttpContext
*
pContext
)
{
if
(
pContext
->
decodeMethod
->
decodeFp
==
NULL
)
{
if
(
pContext
->
decodeMethod
->
fpDecode
==
NULL
)
{
return
false
;
}
return
(
*
pContext
->
decodeMethod
->
decodeFp
)(
pContext
);
return
(
*
pContext
->
decodeMethod
->
fpDecode
)(
pContext
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录