Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_50753323
TDengine
提交
e068bf33
T
TDengine
项目概览
qq_50753323
/
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,发现更多精彩内容 >>
提交
e068bf33
编写于
4月 03, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-93] add ref to sdb
上级
61b2342b
变更
17
展开全部
显示空白变更内容
内联
并排
Showing
17 changed file
with
1979 addition
and
2024 deletion
+1979
-2024
src/inc/mnode.h
src/inc/mnode.h
+1
-2
src/mnode/inc/mgmtAcct.h
src/mnode/inc/mgmtAcct.h
+4
-4
src/mnode/inc/mgmtChildTable.h
src/mnode/inc/mgmtChildTable.h
+0
-43
src/mnode/inc/mgmtDb.h
src/mnode/inc/mgmtDb.h
+2
-0
src/mnode/inc/mgmtSdb.h
src/mnode/inc/mgmtSdb.h
+2
-0
src/mnode/inc/mgmtSuperTable.h
src/mnode/inc/mgmtSuperTable.h
+0
-43
src/mnode/inc/mgmtTable.h
src/mnode/inc/mgmtTable.h
+4
-1
src/mnode/inc/mgmtUser.h
src/mnode/inc/mgmtUser.h
+2
-0
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+4
-12
src/mnode/src/mgmtChildTable.c
src/mnode/src/mgmtChildTable.c
+0
-1226
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+8
-3
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+32
-3
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+1
-2
src/mnode/src/mgmtSuperTable.c
src/mnode/src/mgmtSuperTable.c
+0
-672
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+1904
-7
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+10
-0
src/mnode/src/mgmtVgroup.c
src/mnode/src/mgmtVgroup.c
+5
-6
未找到文件。
src/inc/mnode.h
浏览文件 @
e068bf33
...
...
@@ -102,9 +102,8 @@ typedef struct {
}
SVnodeGid
;
typedef
struct
{
char
tableId
[
TSDB_TABLE_ID_LEN
];
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
int8_t
type
;
int8_t
dirty
;
}
STableInfo
;
typedef
struct
SSuperTableObj
{
...
...
src/mnode/inc/mgmtAcct.h
浏览文件 @
e068bf33
...
...
@@ -32,10 +32,10 @@ void acctCleanUp();
SAcctObj
*
acctGetAcct
(
char
*
acctName
);
int32_t
acctCheck
(
SAcctObj
*
pAcct
,
EAcctGrantType
type
);
int32_t
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
int32_t
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
int32_t
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
);
int32_t
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
);
void
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
void
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
void
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
);
void
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
);
#ifdef __cplusplus
}
...
...
src/mnode/inc/mgmtChildTable.h
已删除
100644 → 0
浏览文件 @
61b2342b
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TBASE_MNODE_CHILD_TABLE_H
#define TBASE_MNODE_CHILD_TABLE_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdint.h>
#include <stdbool.h>
#include "taosdef.h"
#include "mnode.h"
int32_t
mgmtInitChildTables
();
void
mgmtCleanUpChildTables
();
void
*
mgmtGetChildTable
(
char
*
tableId
);
void
mgmtCreateChildTable
(
SQueuedMsg
*
pMsg
);
void
mgmtDropChildTable
(
SQueuedMsg
*
pMsg
,
SChildTableObj
*
pTable
);
void
mgmtGetChildTableMeta
(
SQueuedMsg
*
pMsg
,
SChildTableObj
*
pTable
);
void
mgmtAlterChildTable
(
SQueuedMsg
*
pMsg
,
SChildTableObj
*
pTable
);
void
mgmtDropAllChildTables
(
SDbObj
*
pDropDb
);
void
mgmtDropAllChildTablesInStable
(
SSuperTableObj
*
pStable
);
#ifdef __cplusplus
}
#endif
#endif
src/mnode/inc/mgmtDb.h
浏览文件 @
e068bf33
...
...
@@ -27,6 +27,8 @@ int32_t mgmtInitDbs();
void
mgmtCleanUpDbs
();
SDbObj
*
mgmtGetDb
(
char
*
db
);
SDbObj
*
mgmtGetDbByTableId
(
char
*
db
);
void
mgmtIncDbRef
(
SDbObj
*
pDb
);
void
mgmtDecDbRef
(
SDbObj
*
pDb
)
bool
mgmtCheckIsMonitorDB
(
char
*
db
,
char
*
monitordb
);
void
mgmtDropAllDbs
(
SAcctObj
*
pAcct
);
...
...
src/mnode/inc/mgmtSdb.h
浏览文件 @
e068bf33
...
...
@@ -62,6 +62,8 @@ int32_t sdbUpdateRow(SSdbOperDesc *pOper);
void
*
sdbGetRow
(
void
*
handle
,
void
*
key
);
void
*
sdbFetchRow
(
void
*
handle
,
void
*
pNode
,
void
**
ppRow
);
void
sdbIncRef
(
void
*
thandle
,
void
*
pRow
);
void
sdbDecRef
(
void
*
thandle
,
void
*
pRow
);
int64_t
sdbGetNumOfRows
(
void
*
handle
);
int64_t
sdbGetId
(
void
*
handle
);
uint64_t
sdbGetVersion
();
...
...
src/mnode/inc/mgmtSuperTable.h
已删除
100644 → 0
浏览文件 @
61b2342b
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TBASE_MNODE_SUPER_TABLE_H
#define TBASE_MNODE_SUPER_TABLE_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdint.h>
#include <stdbool.h>
#include "taosdef.h"
#include "mnode.h"
int32_t
mgmtInitSuperTables
();
void
mgmtCleanUpSuperTables
();
void
*
mgmtGetSuperTable
(
char
*
tableId
);
void
mgmtCreateSuperTable
(
SQueuedMsg
*
pMsg
);
void
mgmtDropSuperTable
(
SQueuedMsg
*
pMsg
,
SSuperTableObj
*
pTable
);
void
mgmtGetSuperTableMeta
(
SQueuedMsg
*
pMsg
,
SSuperTableObj
*
pTable
);
void
mgmtAlterSuperTable
(
SQueuedMsg
*
pMsg
,
SSuperTableObj
*
pTable
);
void
mgmtDropAllSuperTables
(
SDbObj
*
pDropDb
);
int32_t
mgmtSetSchemaFromSuperTable
(
SSchema
*
pSchema
,
SSuperTableObj
*
pTable
);
#ifdef __cplusplus
}
#endif
#endif
src/mnode/inc/mgmtTable.h
浏览文件 @
e068bf33
...
...
@@ -28,7 +28,10 @@ extern "C" {
int32_t
mgmtInitTables
();
void
mgmtCleanUpTables
();
STableInfo
*
mgmtGetTable
(
char
*
tableId
);
void
mgmtExtractTableName
(
char
*
tableId
,
char
*
tableName
);
void
mgmtIncTableRef
(
STableInfo
*
pTable
);
void
mgmtDecTableRef
(
STableInfo
*
pTable
);
void
mgmtDropAllChildTables
(
SDbObj
*
pDropDb
);
void
mgmtDropAllSuperTables
(
SDbObj
*
pDropDb
);
#ifdef __cplusplus
}
...
...
src/mnode/inc/mgmtUser.h
浏览文件 @
e068bf33
...
...
@@ -24,6 +24,8 @@ extern "C" {
int32_t
mgmtInitUsers
();
void
mgmtCleanUpUsers
();
SUserObj
*
mgmtGetUser
(
char
*
name
);
void
mgmtIncUserRef
(
SUserObj
*
pUser
);
void
mgmtDecUserRef
(
SUserObj
*
pUser
);
SUserObj
*
mgmtGetUserFromConn
(
void
*
pConn
,
bool
*
usePublicIp
);
int32_t
mgmtCreateUser
(
SAcctObj
*
pAcct
,
char
*
name
,
char
*
pass
);
void
mgmtDropAllUsers
(
SAcctObj
*
pAcct
);
...
...
src/mnode/src/mgmtAcct.c
浏览文件 @
e068bf33
...
...
@@ -33,7 +33,7 @@ SAcctObj *acctGetAcct(char *acctName) { return &tsAcctObj; }
int32_t
acctCheck
(
SAcctObj
*
pAcct
,
EAcctGrantType
type
)
{
return
TSDB_CODE_SUCCESS
;
}
#endif
int32_t
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
void
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
pDb
->
next
=
pAcct
->
pHead
;
pDb
->
prev
=
NULL
;
...
...
@@ -46,11 +46,9 @@ int32_t acctAddDb(SAcctObj *pAcct, SDbObj *pDb) {
pAcct
->
pHead
=
pDb
;
pAcct
->
acctInfo
.
numOfDbs
++
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
int32_t
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
void
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
if
(
pDb
->
prev
)
{
pDb
->
prev
->
next
=
pDb
->
next
;
...
...
@@ -66,11 +64,9 @@ int32_t acctRemoveDb(SAcctObj *pAcct, SDbObj *pDb) {
pAcct
->
acctInfo
.
numOfDbs
--
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
int32_t
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
void
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
pUser
->
next
=
pAcct
->
pUser
;
pUser
->
prev
=
NULL
;
...
...
@@ -83,11 +79,9 @@ int32_t acctAddUser(SAcctObj *pAcct, SUserObj *pUser) {
pAcct
->
acctInfo
.
numOfUsers
++
;
pUser
->
pAcct
=
pAcct
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
int32_t
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
void
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
if
(
pUser
->
prev
)
{
pUser
->
prev
->
next
=
pUser
->
next
;
...
...
@@ -103,6 +97,4 @@ int32_t acctRemoveUser(SAcctObj *pAcct, SUserObj *pUser) {
pAcct
->
acctInfo
.
numOfUsers
--
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
\ No newline at end of file
src/mnode/src/mgmtChildTable.c
已删除
100644 → 0
浏览文件 @
61b2342b
此差异已折叠。
点击以展开。
src/mnode/src/mgmtDb.c
浏览文件 @
e068bf33
...
...
@@ -22,15 +22,12 @@
#include "mnode.h"
#include "mgmtAcct.h"
#include "mgmtBalance.h"
#include "mgmtChildTable.h"
#include "mgmtDb.h"
#include "mgmtDnode.h"
#include "mgmtGrant.h"
#include "mgmtShell.h"
#include "mgmtMnode.h"
#include "mgmtChildTable.h"
#include "mgmtSdb.h"
#include "mgmtSuperTable.h"
#include "mgmtTable.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
...
...
@@ -149,6 +146,14 @@ SDbObj *mgmtGetDb(char *db) {
return
(
SDbObj
*
)
sdbGetRow
(
tsDbSdb
,
db
);
}
void
mgmtIncDbRef
(
SDbObj
*
pDb
)
{
return
sdbIncRef
(
tsDbSdb
,
pDb
);
}
void
mgmtDecDbRef
(
SDbObj
*
pDb
)
{
return
sdbDecRef
(
tsDbSdb
,
pDb
);
}
SDbObj
*
mgmtGetDbByTableId
(
char
*
tableId
)
{
char
db
[
TSDB_TABLE_ID_LEN
],
*
pos
;
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
e068bf33
...
...
@@ -24,6 +24,7 @@
#include "tutil.h"
#include "hashint.h"
#include "hashstr.h"
#include "mgmtSdb.h"
#define abs(x) (((x) < 0) ? -(x) : (x))
...
...
@@ -65,6 +66,7 @@ typedef struct {
int64_t
version
;
int64_t
offset
;
int32_t
rowSize
;
int32_t
refCount
;
void
*
row
;
}
SRowMeta
;
...
...
@@ -322,6 +324,7 @@ static int32_t sdbInitTableByFile(SSdbTable *pTable) {
.
table
=
pTable
,
.
pObj
=
pMetaRow
};
sdbDecRef
(
pTable
,
pMetaRow
);
(
*
pTable
->
destroyFp
)(
&
oper
);
(
*
sdbDeleteIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
rowHead
->
data
);
pTable
->
numOfRows
--
;
...
...
@@ -338,13 +341,14 @@ static int32_t sdbInitTableByFile(SSdbTable *pTable) {
.
rowSize
=
rowHead
->
rowSize
,
.
pObj
=
pMetaRow
};
sdbDecRef
(
pTable
,
pMetaRow
);
(
*
pTable
->
destroyFp
)(
&
oper
);
(
*
sdbDeleteIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
rowHead
->
data
);
int32_t
code
=
(
*
pTable
->
decodeFp
)(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
rowMeta
.
row
=
oper
.
pObj
;
sdbIncRef
(
pTable
,
pMetaRow
);
(
*
sdbAddIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
rowMeta
.
row
,
&
rowMeta
);
sdbTrace
(
"table:%s, version:%"
PRId64
" numOfRows:%d, read updated record:%s"
,
pTable
->
tableName
,
pTable
->
version
,
pTable
->
numOfRows
,
sdbGetkeyStr
(
pTable
,
rowHead
->
data
));
...
...
@@ -433,6 +437,28 @@ static SRowMeta *sdbGetRowMeta(void *handle, void *key) {
return
pMeta
;
}
void
sdbIncRef
(
void
*
handle
,
void
*
pRow
)
{
if
(
pRow
)
{
SSdbTable
*
pTable
=
handle
;
SRowMeta
*
pMeta
=
(
pRow
-
4
);
atomic_add_fetch_32
(
&
pMeta
->
refCount
,
1
);
sdbTrace
(
"table:%s, add ref:%d to record:%s"
,
pTable
->
tableName
,
pMeta
->
refCount
,
sdbGetkeyStr
(
pTable
,
pRow
));
}
}
void
sdbDecRef
(
void
*
handle
,
void
*
pRow
)
{
if
(
pRow
)
{
SSdbTable
*
pTable
=
handle
;
SRowMeta
*
pMeta
=
(
pRow
-
4
);
int32_t
refCount
=
atomic_sub_fetch_32
(
&
pMeta
->
refCount
,
1
);
sdbTrace
(
"table:%s, def ref:%d from record:%s"
,
pTable
->
tableName
,
pMeta
->
refCount
,
sdbGetkeyStr
(
pTable
,
pRow
));
if
(
refCount
<=
0
)
{
SSdbOperDesc
oper
=
{.
pObj
=
pRow
};
(
*
pTable
->
destroyFp
)(
&
oper
);
}
}
}
void
*
sdbGetRow
(
void
*
handle
,
void
*
key
)
{
SSdbTable
*
pTable
=
(
SSdbTable
*
)
handle
;
SRowMeta
*
pMeta
;
...
...
@@ -441,6 +467,7 @@ void *sdbGetRow(void *handle, void *key) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
pMeta
=
(
*
sdbGetIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
key
);
if
(
pMeta
)
sdbIncRef
(
pTable
,
pMeta
->
row
);
pthread_mutex_unlock
(
&
pTable
->
mutex
);
if
(
pMeta
==
NULL
)
{
...
...
@@ -459,6 +486,7 @@ int32_t sdbInsertRow(SSdbOperDesc *pOper) {
if
(
sdbGetRow
(
pTable
,
pOper
->
pObj
))
{
sdbError
(
"table:%s, failed to insert record:%s, already exist"
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pOper
->
pObj
));
sdbDecRef
(
pTable
,
pOper
->
pObj
);
return
TSDB_CODE_ALREADY_THERE
;
}
...
...
@@ -526,6 +554,7 @@ int32_t sdbInsertRow(SSdbOperDesc *pOper) {
rowMeta
.
rowSize
=
pOper
->
rowSize
;
rowMeta
.
row
=
pOper
->
pObj
;
(
*
sdbAddIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
pOper
->
pObj
,
&
rowMeta
);
sdbIncRef
(
pTable
,
pOper
->
pObj
);
pTable
->
numOfRows
++
;
...
...
@@ -626,8 +655,7 @@ int32_t sdbDeleteRow(SSdbOperDesc *pOper) {
pthread_mutex_unlock
(
&
pTable
->
mutex
);
(
*
pTable
->
deleteFp
)(
pOper
);
(
*
pTable
->
destroyFp
)(
pOper
);
sdbDecRef
(
pTable
,
pOper
->
pObj
);
return
0
;
}
...
...
@@ -762,6 +790,7 @@ void *sdbFetchRow(void *handle, void *pNode, void **ppRow) {
if
(
pMeta
==
NULL
)
return
NULL
;
*
ppRow
=
pMeta
->
row
;
sdbIncRef
(
handle
,
pMeta
->
row
);
return
pNode
;
}
src/mnode/src/mgmtShell.c
浏览文件 @
e068bf33
...
...
@@ -25,7 +25,6 @@
#include "mnode.h"
#include "mgmtAcct.h"
#include "mgmtBalance.h"
#include "mgmtChildTable.h"
#include "mgmtDb.h"
#include "mgmtDnode.h"
#include "mgmtGrant.h"
...
...
@@ -33,7 +32,6 @@
#include "mgmtProfile.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtSuperTable.h"
#include "mgmtTable.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
...
...
@@ -449,6 +447,7 @@ static bool mgmtCheckMeterMetaMsgType(void *pMsg) {
mTrace
(
"table:%s auto created task added"
,
pInfo
->
tableId
);
}
mgmtDecTableRef
(
pTable
);
return
addIntoTranQueue
;
}
...
...
src/mnode/src/mgmtSuperTable.c
已删除
100644 → 0
浏览文件 @
61b2342b
此差异已折叠。
点击以展开。
src/mnode/src/mgmtTable.c
浏览文件 @
e068bf33
此差异已折叠。
点击以展开。
src/mnode/src/mgmtUser.c
浏览文件 @
e068bf33
...
...
@@ -48,6 +48,7 @@ static int32_t mgmtUserActionInsert(SSdbOperDesc *pOper) {
if
(
pAcct
!=
NULL
)
{
acctAddUser
(
pAcct
,
pUser
);
mgmtIncUserRef
(
pUser
);
}
else
{
mError
(
"user:%s, acct:%s info not exist in sdb"
,
pUser
->
user
,
pUser
->
acct
);
...
...
@@ -63,6 +64,7 @@ static int32_t mgmtUserActionDelete(SSdbOperDesc *pOper) {
if
(
pAcct
!=
NULL
)
{
acctRemoveUser
(
pAcct
,
pUser
);
mgmtDecUserRef
(
pUser
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -139,6 +141,14 @@ SUserObj *mgmtGetUser(char *name) {
return
(
SUserObj
*
)
sdbGetRow
(
tsUserSdb
,
name
);
}
void
mgmtIncUserRef
(
SUserObj
*
pUser
)
{
return
sdbIncRef
(
tsUserSdb
,
pUser
);
}
void
mgmtDecUserRef
(
SUserObj
*
pUser
)
{
return
sdbDecRef
(
tsUserSdb
,
pUser
);
}
static
int32_t
mgmtUpdateUser
(
SUserObj
*
pUser
)
{
SSdbOperDesc
oper
=
{
.
type
=
SDB_OPER_TYPE_GLOBAL
,
...
...
src/mnode/src/mgmtVgroup.c
浏览文件 @
e068bf33
...
...
@@ -20,7 +20,6 @@
#include "tstatus.h"
#include "mnode.h"
#include "mgmtBalance.h"
#include "mgmtChildTable.h"
#include "mgmtDb.h"
#include "mgmtDClient.h"
#include "mgmtDnode.h"
...
...
@@ -278,16 +277,16 @@ int32_t mgmtGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
int32_t
maxReplica
=
0
;
SVgObj
*
pVgroup
=
NULL
;
S
ChildTableObj
*
pTable
=
NULL
;
S
TableInfo
*
pTable
=
NULL
;
if
(
pShow
->
payloadLen
>
0
)
{
pTable
=
mgmtGet
Child
Table
(
pShow
->
payload
);
if
(
NULL
==
pTable
)
{
pTable
=
mgmtGetTable
(
pShow
->
payload
);
if
(
NULL
==
pTable
||
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
return
TSDB_CODE_INVALID_TABLE_ID
;
}
pVgroup
=
mgmtGetVgroup
(
pTable
->
vgId
);
pVgroup
=
mgmtGetVgroup
(
((
SChildTableObj
*
)
pTable
)
->
vgId
);
if
(
NULL
==
pVgroup
)
return
TSDB_CODE_INVALID_TABLE_ID
;
mgmtDecTableRef
(
pTable
);
maxReplica
=
pVgroup
->
numOfVnodes
>
maxReplica
?
pVgroup
->
numOfVnodes
:
maxReplica
;
}
else
{
SVgObj
*
pVgroup
=
pDb
->
pHead
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录