Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
3e43a653
T
TDengine
项目概览
慢慢CG
/
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看板
提交
3e43a653
编写于
11月 21, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1983 change hash in mnode
上级
5f3797c1
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
139 addition
and
123 deletion
+139
-123
src/balance/src/balance.c
src/balance/src/balance.c
+15
-25
src/mnode/inc/mnodeAcct.h
src/mnode/inc/mnodeAcct.h
+1
-0
src/mnode/inc/mnodeDb.h
src/mnode/inc/mnodeDb.h
+1
-0
src/mnode/inc/mnodeDnode.h
src/mnode/inc/mnodeDnode.h
+1
-0
src/mnode/inc/mnodeMnode.h
src/mnode/inc/mnodeMnode.h
+1
-0
src/mnode/inc/mnodeSdb.h
src/mnode/inc/mnodeSdb.h
+3
-3
src/mnode/inc/mnodeShow.h
src/mnode/inc/mnodeShow.h
+2
-0
src/mnode/inc/mnodeTable.h
src/mnode/inc/mnodeTable.h
+2
-0
src/mnode/inc/mnodeUser.h
src/mnode/inc/mnodeUser.h
+1
-0
src/mnode/inc/mnodeVgroup.h
src/mnode/inc/mnodeVgroup.h
+1
-0
src/mnode/src/mnodeAcct.c
src/mnode/src/mnodeAcct.c
+4
-2
src/mnode/src/mnodeCluster.c
src/mnode/src/mnodeCluster.c
+7
-1
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+7
-5
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+11
-12
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+6
-3
src/mnode/src/mnodeProfile.c
src/mnode/src/mnodeProfile.c
+13
-11
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+15
-21
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+8
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+24
-23
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+6
-3
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+6
-9
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+4
-3
tests/script/basicSuite.sim
tests/script/basicSuite.sim
+0
-1
未找到文件。
src/balance/src/balance.c
浏览文件 @
3e43a653
...
...
@@ -162,7 +162,6 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
pDnode
->
openVnodes
,
pDnode
->
diskAvailable
,
pDnode
->
alternativeRole
);
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
if
(
mnodeGetOnlineDnodesNum
()
==
0
)
{
return
TSDB_CODE_MND_NOT_READY
;
...
...
@@ -377,15 +376,13 @@ static bool balanceMonitorBalance() {
srcScore
,
pDestDnode
->
score
,
destScore
);
balanceAddVnode
(
pVgroup
,
pSrcDnode
,
pDestDnode
);
mnodeDecVgroupRef
(
pVgroup
);
sdbFreeIter
(
pIter
);
mnodeCancelGetNextVgroup
(
pIter
);
return
true
;
}
}
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
}
return
false
;
...
...
@@ -413,8 +410,6 @@ void balanceReset() {
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
tsAccessSquence
=
0
;
}
...
...
@@ -443,12 +438,11 @@ static int32_t balanceMonitorVgroups() {
mnodeDecVgroupRef
(
pVgroup
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mnodeCancelGetNextVgroup
(
pIter
);
break
;
}
}
sdbFreeIter
(
pIter
);
return
hasUpdatingVgroup
;
}
...
...
@@ -465,11 +459,12 @@ static bool balanceMonitorDnodeDropping(SDnodeObj *pDnode) {
hasThisDnode
=
balanceCheckDnodeInVgroup
(
pDnode
,
pVgroup
);
mnodeDecVgroupRef
(
pVgroup
);
if
(
hasThisDnode
)
break
;
if
(
hasThisDnode
)
{
mnodeCancelGetNextVgroup
(
pIter
);
break
;
}
}
sdbFreeIter
(
pIter
);
if
(
!
hasThisDnode
)
{
mInfo
(
"dnode:%d, dropped for all vnodes are moving to other dnodes"
,
pDnode
->
dnodeId
);
mnodeDropDnode
(
pDnode
,
NULL
);
...
...
@@ -499,20 +494,18 @@ static bool balanceMontiorDropping() {
pDnode
->
status
=
TAOS_DN_STATUS_DROPPING
;
mnodeUpdateDnode
(
pDnode
);
mnodeDecDnodeRef
(
pDnode
);
sdbFreeIter
(
pIter
);
mnodeCancelGetNextDnode
(
pIter
);
return
true
;
}
if
(
pDnode
->
status
==
TAOS_DN_STATUS_DROPPING
)
{
bool
ret
=
balanceMonitorDnodeDropping
(
pDnode
);
mnodeDecDnodeRef
(
pDnode
);
sdbFreeIter
(
pIter
);
mnodeCancelGetNextDnode
(
pIter
);
return
ret
;
}
}
sdbFreeIter
(
pIter
);
return
false
;
}
...
...
@@ -556,8 +549,6 @@ static void balanceSetVgroupOffline(SDnodeObj* pDnode) {
}
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
}
static
void
balanceCheckDnodeAccess
()
{
...
...
@@ -578,8 +569,6 @@ static void balanceCheckDnodeAccess() {
}
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
}
static
void
balanceProcessBalanceTimer
(
void
*
handle
,
void
*
tmrId
)
{
...
...
@@ -630,6 +619,7 @@ void balanceAsyncNotify() {
int32_t
balanceInit
()
{
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_SCORES
,
balanceGetScoresMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_SCORES
,
balanceRetrieveScores
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_SCORES
,
mnodeCancelGetNextDnode
);
pthread_mutex_init
(
&
tsBalanceMutex
,
NULL
);
balanceInitDnodeList
();
...
...
@@ -667,8 +657,6 @@ int32_t balanceDropDnode(SDnodeObj *pDnode) {
mnodeDecDnodeRef
(
pTempDnode
);
}
sdbFreeIter
(
pIter
);
if
(
pDnode
->
openVnodes
>
totalFreeVnodes
)
{
mError
(
"dnode:%d, openVnodes:%d totalFreeVnodes:%d no enough dnodes"
,
pDnode
->
dnodeId
,
pDnode
->
openVnodes
,
totalFreeVnodes
);
return
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
...
...
@@ -780,8 +768,12 @@ void balanceAccquireDnodeList() {
SDnodeObj
*
pDnode
=
NULL
;
int32_t
dnodeIndex
=
0
;
while
(
1
)
{
if
(
dnodeIndex
>=
dnodesNum
)
break
;
while
(
1
)
{
if
(
dnodeIndex
>=
dnodesNum
)
{
mnodeCancelGetNextDnode
(
pIter
);
break
;
}
pIter
=
mnodeGetNextDnode
(
pIter
,
&
pDnode
);
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
->
status
==
TAOS_DN_STATUS_OFFLINE
)
{
...
...
@@ -802,8 +794,6 @@ void balanceAccquireDnodeList() {
dnodeIndex
++
;
}
sdbFreeIter
(
pIter
);
tsBalanceDnodeListSize
=
dnodeIndex
;
}
...
...
src/mnode/inc/mnodeAcct.h
浏览文件 @
3e43a653
...
...
@@ -27,6 +27,7 @@ void mnodeCleanupAccts();
void
mnodeGetStatOfAllAcct
(
SAcctInfo
*
pAcctInfo
);
void
*
mnodeGetAcct
(
char
*
acctName
);
void
*
mnodeGetNextAcct
(
void
*
pIter
,
SAcctObj
**
pAcct
);
void
mnodeCancelGetNextAcct
(
void
*
pIter
);
void
mnodeIncAcctRef
(
SAcctObj
*
pAcct
);
void
mnodeDecAcctRef
(
SAcctObj
*
pAcct
);
void
mnodeAddDbToAcct
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
...
...
src/mnode/inc/mnodeDb.h
浏览文件 @
3e43a653
...
...
@@ -34,6 +34,7 @@ int64_t mnodeGetDbNum();
SDbObj
*
mnodeGetDb
(
char
*
db
);
SDbObj
*
mnodeGetDbByTableId
(
char
*
db
);
void
*
mnodeGetNextDb
(
void
*
pIter
,
SDbObj
**
pDb
);
void
mnodeCancelGetNextDb
(
void
*
pIter
);
void
mnodeIncDbRef
(
SDbObj
*
pDb
);
void
mnodeDecDbRef
(
SDbObj
*
pDb
);
bool
mnodeCheckIsMonitorDB
(
char
*
db
,
char
*
monitordb
);
...
...
src/mnode/inc/mnodeDnode.h
浏览文件 @
3e43a653
...
...
@@ -65,6 +65,7 @@ int32_t mnodeGetDnodesNum();
int32_t
mnodeGetOnlinDnodesCpuCoreNum
();
int32_t
mnodeGetOnlineDnodesNum
();
void
*
mnodeGetNextDnode
(
void
*
pIter
,
SDnodeObj
**
pDnode
);
void
mnodeCancelGetNextDnode
(
void
*
pIter
);
void
mnodeIncDnodeRef
(
SDnodeObj
*
pDnode
);
void
mnodeDecDnodeRef
(
SDnodeObj
*
pDnode
);
void
*
mnodeGetDnode
(
int32_t
dnodeId
);
...
...
src/mnode/inc/mnodeMnode.h
浏览文件 @
3e43a653
...
...
@@ -38,6 +38,7 @@ void mnodeDropMnodeLocal(int32_t dnodeId);
void
*
mnodeGetMnode
(
int32_t
mnodeId
);
int32_t
mnodeGetMnodesNum
();
void
*
mnodeGetNextMnode
(
void
*
pIter
,
struct
SMnodeObj
**
pMnode
);
void
mnodeCancelGetNextMnode
(
void
*
pIter
);
void
mnodeIncMnodeRef
(
struct
SMnodeObj
*
pMnode
);
void
mnodeDecMnodeRef
(
struct
SMnodeObj
*
pMnode
);
...
...
src/mnode/inc/mnodeSdb.h
浏览文件 @
3e43a653
...
...
@@ -92,9 +92,9 @@ int32_t sdbDeleteRow(SSdbRow *pRow);
int32_t
sdbUpdateRow
(
SSdbRow
*
pRow
);
int32_t
sdbInsertRowToQueue
(
SSdbRow
*
pRow
);
void
*
sdbGetRow
(
void
*
pTable
,
void
*
key
);
void
*
sdbFetchRow
(
void
*
pTable
,
void
*
pIter
,
void
**
ppRow
);
void
sdbFreeIter
(
void
*
pIter
);
void
*
sdbGetRow
(
void
*
pTable
,
void
*
key
);
void
*
sdbFetchRow
(
void
*
pTable
,
void
*
pIter
,
void
**
ppRow
);
void
sdbFreeIter
(
void
*
p
Table
,
void
*
p
Iter
);
void
sdbIncRef
(
void
*
pTable
,
void
*
pRow
);
void
sdbDecRef
(
void
*
pTable
,
void
*
pRow
);
int64_t
sdbGetNumOfRows
(
void
*
pTable
);
...
...
src/mnode/inc/mnodeShow.h
浏览文件 @
3e43a653
...
...
@@ -26,8 +26,10 @@ void mnodeCleanUpShow();
typedef
int32_t
(
*
SShowMetaFp
)(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
typedef
int32_t
(
*
SShowRetrieveFp
)(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
typedef
void
(
*
SShowFreeIterFp
)(
void
*
pIter
);
void
mnodeAddShowMetaHandle
(
uint8_t
showType
,
SShowMetaFp
fp
);
void
mnodeAddShowRetrieveHandle
(
uint8_t
showType
,
SShowRetrieveFp
fp
);
void
mnodeAddShowFreeIterHandle
(
uint8_t
msgType
,
SShowFreeIterFp
fp
);
void
mnodeVacuumResult
(
char
*
data
,
int32_t
numOfCols
,
int32_t
rows
,
int32_t
capacity
,
SShowObj
*
pShow
);
#ifdef __cplusplus
...
...
src/mnode/inc/mnodeTable.h
浏览文件 @
3e43a653
...
...
@@ -31,6 +31,8 @@ void mnodeIncTableRef(void *pTable);
void
mnodeDecTableRef
(
void
*
pTable
);
void
*
mnodeGetNextChildTable
(
void
*
pIter
,
SCTableObj
**
pTable
);
void
*
mnodeGetNextSuperTable
(
void
*
pIter
,
SSTableObj
**
pTable
);
void
mnodeCancelGetNextChildTable
(
void
*
pIter
);
void
mnodeCancelGetNextSuperTable
(
void
*
pIter
);
void
mnodeDropAllChildTables
(
SDbObj
*
pDropDb
);
void
mnodeDropAllSuperTables
(
SDbObj
*
pDropDb
);
void
mnodeDropAllChildTablesInVgroups
(
SVgObj
*
pVgroup
);
...
...
src/mnode/inc/mnodeUser.h
浏览文件 @
3e43a653
...
...
@@ -25,6 +25,7 @@ int32_t mnodeInitUsers();
void
mnodeCleanupUsers
();
SUserObj
*
mnodeGetUser
(
char
*
name
);
void
*
mnodeGetNextUser
(
void
*
pIter
,
SUserObj
**
pUser
);
void
mnodeCancelGetNextUser
(
void
*
pIter
);
void
mnodeIncUserRef
(
SUserObj
*
pUser
);
void
mnodeDecUserRef
(
SUserObj
*
pUser
);
SUserObj
*
mnodeGetUserFromConn
(
void
*
pConn
);
...
...
src/mnode/inc/mnodeVgroup.h
浏览文件 @
3e43a653
...
...
@@ -34,6 +34,7 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode);
//void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb);
void
*
mnodeGetNextVgroup
(
void
*
pIter
,
SVgObj
**
pVgroup
);
void
mnodeCancelGetNextVgroup
(
void
*
pIter
);
void
mnodeUpdateVgroup
(
SVgObj
*
pVgroup
);
void
mnodeUpdateVgroupStatus
(
SVgObj
*
pVgroup
,
SDnodeObj
*
pDnode
,
SVnodeLoad
*
pVload
);
void
mnodeCheckUnCreatedVgroup
(
SDnodeObj
*
pDnode
,
SVnodeLoad
*
pVloads
,
int32_t
openVnodes
);
...
...
src/mnode/src/mnodeAcct.c
浏览文件 @
3e43a653
...
...
@@ -144,7 +144,6 @@ void mnodeGetStatOfAllAcct(SAcctInfo* pAcctInfo) {
pAcctInfo
->
numOfTimeSeries
+=
pAcct
->
acctInfo
.
numOfTimeSeries
;
mnodeDecAcctRef
(
pAcct
);
}
sdbFreeIter
(
pIter
);
SVgObj
*
pVgroup
=
NULL
;
pIter
=
NULL
;
...
...
@@ -158,7 +157,6 @@ void mnodeGetStatOfAllAcct(SAcctInfo* pAcctInfo) {
pAcctInfo
->
totalPoints
+=
pVgroup
->
pointsWritten
;
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
}
void
*
mnodeGetAcct
(
char
*
name
)
{
...
...
@@ -169,6 +167,10 @@ void *mnodeGetNextAcct(void *pIter, SAcctObj **pAcct) {
return
sdbFetchRow
(
tsAcctSdb
,
pIter
,
(
void
**
)
pAcct
);
}
void
mnodeCancelGetNextAcct
(
void
*
pIter
)
{
sdbFreeIter
(
tsAcctSdb
,
pIter
);
}
void
mnodeIncAcctRef
(
SAcctObj
*
pAcct
)
{
sdbIncRef
(
tsAcctSdb
,
pAcct
);
}
...
...
src/mnode/src/mnodeCluster.c
浏览文件 @
3e43a653
...
...
@@ -31,6 +31,7 @@ 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
void
mnodeCancelGetNextCluster
(
void
*
pIter
);
static
int32_t
mnodeClusterActionDestroy
(
SSdbRow
*
pRow
)
{
tfree
(
pRow
->
pObj
);
...
...
@@ -108,6 +109,7 @@ int32_t mnodeInitCluster() {
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_CLUSTER
,
mnodeGetClusterMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_CLUSTER
,
mnodeRetrieveClusters
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_CLUSTER
,
mnodeCancelGetNextCluster
);
mDebug
(
"table:%s, hash is created"
,
desc
.
name
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -122,6 +124,10 @@ void *mnodeGetNextCluster(void *pIter, SClusterObj **pCluster) {
return
sdbFetchRow
(
tsClusterSdb
,
pIter
,
(
void
**
)
pCluster
);
}
void
mnodeCancelGetNextCluster
(
void
*
pIter
)
{
sdbFreeIter
(
tsClusterSdb
,
pIter
);
}
void
mnodeIncClusterRef
(
SClusterObj
*
pCluster
)
{
sdbIncRef
(
tsClusterSdb
,
pCluster
);
}
...
...
@@ -167,7 +173,7 @@ void mnodeUpdateClusterId() {
}
mnodeDecClusterRef
(
pCluster
);
sdbFreeI
ter
(
pIter
);
mnodeCancelGetNextClus
ter
(
pIter
);
}
static
int32_t
mnodeGetClusterMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
3e43a653
...
...
@@ -171,6 +171,7 @@ int32_t mnodeInitDbs() {
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_DROP_DB
,
mnodeProcessDropDbMsg
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_DB
,
mnodeGetDbMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_DB
,
mnodeRetrieveDbs
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_DB
,
mnodeCancelGetNextDb
);
mDebug
(
"table:dbs table is created"
);
return
0
;
...
...
@@ -180,6 +181,10 @@ void *mnodeGetNextDb(void *pIter, SDbObj **pDb) {
return
sdbFetchRow
(
tsDbSdb
,
pIter
,
(
void
**
)
pDb
);
}
void
mnodeCancelGetNextDb
(
void
*
pIter
)
{
sdbFreeIter
(
tsDbSdb
,
pIter
);
}
SDbObj
*
mnodeGetDb
(
char
*
db
)
{
return
(
SDbObj
*
)
sdbGetRow
(
tsDbSdb
,
db
);
}
...
...
@@ -986,8 +991,8 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) {
SDbObj
*
pDb
=
pMsg
->
pDb
;
void
*
pIter
=
NULL
;
while
(
1
)
{
SVgObj
*
pVgroup
=
NULL
;
SVgObj
*
pVgroup
=
NULL
;
while
(
1
)
{
pIter
=
mnodeGetNextVgroup
(
pIter
,
&
pVgroup
);
if
(
pVgroup
==
NULL
)
break
;
if
(
pVgroup
->
pDb
==
pDb
)
{
...
...
@@ -995,7 +1000,6 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) {
}
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
mDebug
(
"db:%s, all vgroups is altered"
,
pDb
->
name
);
mLInfo
(
"db:%s, is alterd by %s"
,
pDb
->
name
,
mnodeGetUserFromMsg
(
pMsg
));
...
...
@@ -1146,7 +1150,5 @@ void mnodeDropAllDbs(SAcctObj *pAcct) {
mnodeDecDbRef
(
pDb
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"acct:%s, all dbs:%d is dropped from sdb"
,
pAcct
->
user
,
numOfDbs
);
}
src/mnode/src/mnodeDnode.c
浏览文件 @
3e43a653
...
...
@@ -206,6 +206,7 @@ int32_t mnodeInitDnodes() {
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_VNODES
,
mnodeRetrieveVnodes
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_DNODE
,
mnodeGetDnodeMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_DNODE
,
mnodeRetrieveDnodes
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_DNODE
,
mnodeCancelGetNextDnode
);
mDebug
(
"table:dnodes table is created"
);
return
0
;
...
...
@@ -223,6 +224,10 @@ void *mnodeGetNextDnode(void *pIter, SDnodeObj **pDnode) {
return
sdbFetchRow
(
tsDnodeSdb
,
pIter
,
(
void
**
)
pDnode
);
}
void
mnodeCancelGetNextDnode
(
void
*
pIter
)
{
sdbFreeIter
(
tsDnodeSdb
,
pIter
);
}
int32_t
mnodeGetDnodesNum
()
{
return
sdbGetNumOfRows
(
tsDnodeSdb
);
}
...
...
@@ -241,8 +246,6 @@ int32_t mnodeGetOnlinDnodesCpuCoreNum() {
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
if
(
cpuCores
<
2
)
cpuCores
=
2
;
return
cpuCores
;
}
...
...
@@ -259,8 +262,6 @@ int32_t mnodeGetOnlineDnodesNum() {
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
return
onlineDnodes
;
}
...
...
@@ -276,13 +277,12 @@ void *mnodeGetDnodeByEp(char *ep) {
pIter
=
mnodeGetNextDnode
(
pIter
,
&
pDnode
);
if
(
pDnode
==
NULL
)
break
;
if
(
strcmp
(
ep
,
pDnode
->
dnodeEp
)
==
0
)
{
sdbFreeIter
(
pIter
);
mnodeCancelGetNextDnode
(
pIter
);
return
pDnode
;
}
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
return
NULL
;
}
...
...
@@ -464,7 +464,10 @@ static void mnodeUpdateDnodeEps() {
while
(
1
)
{
pIter
=
mnodeGetNextDnode
(
pIter
,
&
pDnode
);
if
(
pDnode
==
NULL
)
break
;
if
(
dnodesNum
>=
totalDnodes
)
break
;
if
(
dnodesNum
>=
totalDnodes
)
{
mnodeCancelGetNextDnode
(
pIter
);
break
;
}
SDnodeEp
*
pEp
=
&
tsDnodeEps
->
dnodeEps
[
dnodesNum
];
dnodesNum
++
;
...
...
@@ -474,7 +477,6 @@ static void mnodeUpdateDnodeEps() {
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
pthread_mutex_unlock
(
&
tsDnodeEpsMutex
);
}
...
...
@@ -1100,7 +1102,7 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pDnode
=
mnodeGetDnodeByEp
(
pShow
->
payload
);
}
else
{
void
*
pIter
=
mnodeGetNextDnode
(
NULL
,
(
SDnodeObj
**
)
&
pDnode
);
sdbFreeIter
(
pIter
);
mnodeCancelGetNextDnode
(
pIter
);
}
if
(
pDnode
!=
NULL
)
{
...
...
@@ -1148,7 +1150,6 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
}
else
{
numOfRows
=
0
;
}
...
...
@@ -1217,8 +1218,6 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
mnodeDecDnodeRef
(
pDnode
);
}
sdbFreeIter
(
pIter
);
if
(
pSelDnode
==
NULL
)
{
mError
(
"failed to alloc vnode to vgroup"
);
return
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
3e43a653
...
...
@@ -123,7 +123,7 @@ static int32_t mnodeMnodeActionRestored() {
pMnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
mnodeDecMnodeRef
(
pMnode
);
}
sdbFreeIter
(
pIter
);
mnodeCancelGetNextMnode
(
pIter
);
}
mnodeUpdateMnodeEpSet
();
...
...
@@ -161,6 +161,7 @@ int32_t mnodeInitMnodes() {
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_MNODE
,
mnodeGetMnodeMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_MNODE
,
mnodeRetrieveMnodes
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_MNODE
,
mnodeCancelGetNextMnode
);
mDebug
(
"table:mnodes table is created"
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -192,6 +193,10 @@ void *mnodeGetNextMnode(void *pIter, SMnodeObj **pMnode) {
return
sdbFetchRow
(
tsMnodeSdb
,
pIter
,
(
void
**
)
pMnode
);
}
void
mnodeCancelGetNextMnode
(
void
*
pIter
)
{
sdbFreeIter
(
tsMnodeSdb
,
pIter
);
}
void
mnodeUpdateMnodeEpSet
()
{
mInfo
(
"update mnodes epSet, numOfEps:%d "
,
mnodeGetMnodesNum
());
...
...
@@ -239,8 +244,6 @@ void mnodeUpdateMnodeEpSet() {
tsMnodeEpSetForShell
.
numOfEps
=
index
;
tsMnodeEpSetForPeer
.
numOfEps
=
index
;
sdbFreeIter
(
pIter
);
mnodeMnodeUnLock
();
}
...
...
src/mnode/src/mnodeProfile.c
浏览文件 @
3e43a653
...
...
@@ -42,6 +42,7 @@ static int32_t mnodeGetQueryMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
static
int32_t
mnodeRetrieveQueries
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeGetConnsMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveConns
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
void
mnodeCancelGetNextConn
(
void
*
pIter
);
static
int32_t
mnodeGetStreamMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveStreams
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
void
mnodeFreeConn
(
void
*
data
);
...
...
@@ -52,10 +53,13 @@ static int32_t mnodeProcessKillConnectionMsg(SMnodeMsg *pMsg);
int32_t
mnodeInitProfile
()
{
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_QUERIES
,
mnodeGetQueryMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_QUERIES
,
mnodeRetrieveQueries
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_QUERIES
,
mnodeCancelGetNextConn
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_CONNS
,
mnodeGetConnsMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_CONNS
,
mnodeRetrieveConns
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_CONNS
,
mnodeCancelGetNextConn
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_STREAMS
,
mnodeGetStreamMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_STREAMS
,
mnodeRetrieveStreams
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_STREAMS
,
mnodeCancelGetNextConn
);
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_KILL_QUERY
,
mnodeProcessKillQueryMsg
);
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_KILL_STREAM
,
mnodeProcessKillStreamMsg
);
...
...
@@ -137,21 +141,15 @@ static void mnodeFreeConn(void *data) {
mDebug
(
"connId:%d, is destroyed"
,
pConn
->
connId
);
}
static
void
*
mnodeGetNextConn
(
SHashMutableIterator
*
pIter
,
SConnObj
**
pConn
)
{
static
void
*
mnodeGetNextConn
(
void
*
pIter
,
SConnObj
**
pConn
)
{
*
pConn
=
NULL
;
if
(
pIter
==
NULL
)
{
pIter
=
taosHashCreateIter
(
tsMnodeConnCache
->
pHashTable
);
}
if
(
!
taosHashIterNext
(
pIter
))
{
taosHashDestroyIter
(
pIter
);
return
NULL
;
}
pIter
=
taosHashIterate
(
tsMnodeConnCache
->
pHashTable
,
pIter
);
if
(
pIter
==
NULL
)
return
NULL
;
SCacheDataNode
**
pNode
=
taosHashIterGet
(
pIter
)
;
SCacheDataNode
**
pNode
=
pIter
;
if
(
pNode
==
NULL
||
*
pNode
==
NULL
)
{
taosHash
DestroyIter
(
pIter
);
taosHash
CancelIterate
(
tsMnodeConnCache
->
pHashTable
,
pIter
);
return
NULL
;
}
...
...
@@ -159,6 +157,10 @@ static void *mnodeGetNextConn(SHashMutableIterator *pIter, SConnObj **pConn) {
return
pIter
;
}
static
void
mnodeCancelGetNextConn
(
void
*
pIter
)
{
taosHashCancelIterate
(
tsMnodeConnCache
->
pHashTable
,
pIter
);
}
static
int32_t
mnodeGetConnsMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
3e43a653
...
...
@@ -325,7 +325,6 @@ void sdbUpdateSync(void *pMnodes) {
mnodeDecDnodeRef
(
pDnode
);
mnodeDecMnodeRef
(
pMnode
);
}
sdbFreeIter
(
pIter
);
syncCfg
.
replica
=
index
;
mDebug
(
"vgId:1, mnodes info not input, use infos in sdb, numOfMnodes:%d"
,
syncCfg
.
replica
);
}
else
{
...
...
@@ -756,24 +755,17 @@ int32_t sdbUpdateRow(SSdbRow *pRow) {
}
}
void
*
sdbFetchRow
(
void
*
tparam
,
void
*
p
Node
,
void
**
ppRow
)
{
void
*
sdbFetchRow
(
void
*
tparam
,
void
*
p
Iter
,
void
**
ppRow
)
{
SSdbTable
*
pTable
=
tparam
;
*
ppRow
=
NULL
;
if
(
pTable
==
NULL
)
return
NULL
;
SHashMutableIterator
*
pIter
=
pNode
;
if
(
pIter
==
NULL
)
{
pIter
=
taosHashCreateIter
(
pTable
->
iHandle
);
}
if
(
!
taosHashIterNext
(
pIter
))
{
taosHashDestroyIter
(
pIter
);
return
NULL
;
}
pIter
=
taosHashIterate
(
pTable
->
iHandle
,
pIter
);
if
(
pIter
==
NULL
)
return
NULL
;
void
**
ppMetaRow
=
taosHashIterGet
(
pIter
)
;
void
**
ppMetaRow
=
pIter
;
if
(
ppMetaRow
==
NULL
)
{
taosHash
DestroyIter
(
pIter
);
taosHash
CancelIterate
(
pTable
->
iHandle
,
pIter
);
return
NULL
;
}
...
...
@@ -783,10 +775,11 @@ void *sdbFetchRow(void *tparam, void *pNode, void **ppRow) {
return
pIter
;
}
void
sdbFreeIter
(
void
*
pIter
)
{
if
(
pIter
!=
NULL
)
{
taosHashDestroyIter
(
pIter
);
}
void
sdbFreeIter
(
void
*
tparam
,
void
*
pIter
)
{
SSdbTable
*
pTable
=
tparam
;
if
(
pTable
==
NULL
||
pIter
==
NULL
)
return
;
taosHashCancelIterate
(
pTable
->
iHandle
,
pIter
);
}
void
*
sdbOpenTable
(
SSdbTableDesc
*
pDesc
)
{
...
...
@@ -827,9 +820,10 @@ void sdbCloseTable(void *handle) {
tsSdbMgmt
.
numOfTables
--
;
tsSdbMgmt
.
tableList
[
pTable
->
id
]
=
NULL
;
SHashMutableIterator
*
pIter
=
taosHashCreateIter
(
pTable
->
iHandle
);
while
(
taosHashIterNext
(
pIter
))
{
void
**
ppRow
=
taosHashIterGet
(
pIter
);
void
*
pIter
=
taosHashIterate
(
pTable
->
iHandle
,
NULL
);
while
(
pIter
)
{
void
**
ppRow
=
pIter
;
pIter
=
taosHashIterate
(
pTable
->
iHandle
,
pIter
);
if
(
ppRow
==
NULL
)
continue
;
SSdbRow
row
=
{
...
...
@@ -840,7 +834,7 @@ void sdbCloseTable(void *handle) {
(
*
pTable
->
fpDestroy
)(
&
row
);
}
taosHash
DestroyIter
(
pIter
);
taosHash
CancelIterate
(
pTable
->
iHandle
,
pIter
);
taosHashCleanup
(
pTable
->
iHandle
);
pthread_mutex_destroy
(
&
pTable
->
mutex
);
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
3e43a653
...
...
@@ -57,6 +57,7 @@ static void *tsMnodeShowCache = NULL;
static
int32_t
tsShowObjIndex
=
0
;
static
SShowMetaFp
tsMnodeShowMetaFp
[
TSDB_MGMT_TABLE_MAX
]
=
{
0
};
static
SShowRetrieveFp
tsMnodeShowRetrieveFp
[
TSDB_MGMT_TABLE_MAX
]
=
{
0
};
static
SShowFreeIterFp
tsMnodeShowFreeIterFp
[
TSDB_MGMT_TABLE_MAX
]
=
{
0
};
int32_t
mnodeInitShow
()
{
mnodeAddReadMsgHandle
(
TSDB_MSG_TYPE_CM_SHOW
,
mnodeProcessShowMsg
);
...
...
@@ -85,6 +86,10 @@ void mnodeAddShowRetrieveHandle(uint8_t msgType, SShowRetrieveFp fp) {
tsMnodeShowRetrieveFp
[
msgType
]
=
fp
;
}
void
mnodeAddShowFreeIterHandle
(
uint8_t
msgType
,
SShowFreeIterFp
fp
)
{
tsMnodeShowFreeIterFp
[
msgType
]
=
fp
;
}
static
char
*
mnodeGetShowType
(
int32_t
showType
)
{
switch
(
showType
)
{
case
TSDB_MGMT_TABLE_ACCT
:
return
"show accounts"
;
...
...
@@ -412,7 +417,9 @@ static void* mnodePutShowObj(SShowObj *pShow) {
static
void
mnodeFreeShowObj
(
void
*
data
)
{
SShowObj
*
pShow
=
*
(
SShowObj
**
)
data
;
sdbFreeIter
(
pShow
->
pIter
);
if
(
tsMnodeShowFreeIterFp
[
pShow
->
type
]
!=
NULL
&&
pShow
->
pIter
!=
NULL
)
{
(
*
tsMnodeShowFreeIterFp
[
pShow
->
type
])(
pShow
->
pIter
);
}
mDebug
(
"%p, show is destroyed, data:%p index:%d"
,
pShow
,
data
,
pShow
->
index
);
tfree
(
pShow
);
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
3e43a653
...
...
@@ -342,8 +342,7 @@ static int32_t mnodeChildTableActionRestored() {
mnodeDecTableRef
(
pTable
);
}
sdbFreeIter
(
pIter
);
mnodeCancelGetNextChildTable
(
pIter
);
return
0
;
}
...
...
@@ -602,10 +601,13 @@ int32_t mnodeInitTables() {
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_TABLE
,
mnodeGetShowTableMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_TABLE
,
mnodeRetrieveShowTables
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_TABLE
,
mnodeCancelGetNextChildTable
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_METRIC
,
mnodeGetShowSuperTableMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_METRIC
,
mnodeRetrieveShowSuperTables
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_METRIC
,
mnodeCancelGetNextSuperTable
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_STREAMTABLES
,
mnodeGetStreamTableMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_STREAMTABLES
,
mnodeRetrieveStreamTables
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_STREAMTABLES
,
mnodeCancelGetNextChildTable
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -626,14 +628,12 @@ static void *mnodeGetSuperTableByUid(uint64_t uid) {
pIter
=
mnodeGetNextSuperTable
(
pIter
,
&
pStable
);
if
(
pStable
==
NULL
)
break
;
if
(
pStable
->
uid
==
uid
)
{
sdbFreeIter
(
pIter
);
mnodeCancelGetNextSuperTable
(
pIter
);
return
pStable
;
}
mnodeDecTableRef
(
pStable
);
}
sdbFreeIter
(
pIter
);
return
NULL
;
}
...
...
@@ -655,10 +655,18 @@ void *mnodeGetNextChildTable(void *pIter, SCTableObj **pTable) {
return
sdbFetchRow
(
tsChildTableSdb
,
pIter
,
(
void
**
)
pTable
);
}
void
mnodeCancelGetNextChildTable
(
void
*
pIter
)
{
sdbFreeIter
(
tsChildTableSdb
,
pIter
);
}
void
*
mnodeGetNextSuperTable
(
void
*
pIter
,
SSTableObj
**
pTable
)
{
return
sdbFetchRow
(
tsSuperTableSdb
,
pIter
,
(
void
**
)
pTable
);
}
void
mnodeCancelGetNextSuperTable
(
void
*
pIter
)
{
sdbFreeIter
(
tsSuperTableSdb
,
pIter
);
}
void
mnodeIncTableRef
(
void
*
p1
)
{
STableObj
*
pTable
=
(
STableObj
*
)
p1
;
if
(
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
...
...
@@ -914,10 +922,10 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
SSTableObj
*
pStable
=
(
SSTableObj
*
)
pMsg
->
pTable
;
if
(
pStable
->
vgHash
!=
NULL
/*pStable->numOfTables != 0*/
)
{
SHashMutableIterator
*
pIter
=
taosHashCreateIter
(
pStable
->
vgHash
);
while
(
taosHashIterNext
(
pIter
))
{
int32_t
*
pVgId
=
taosHashIterGet
(
pIter
);
int32_t
*
pVgId
=
taosHashIterate
(
pStable
->
vgHash
,
NULL
);
while
(
pVgId
)
{
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
*
pVgId
);
pVgId
=
taosHashIterate
(
pStable
->
vgHash
,
pVgId
);
if
(
pVgroup
==
NULL
)
break
;
SDropSTableMsg
*
pDrop
=
rpcMallocCont
(
sizeof
(
SDropSTableMsg
));
...
...
@@ -933,7 +941,8 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
dnodeSendMsgToDnode
(
&
epSet
,
&
rpcMsg
);
mnodeDecVgroupRef
(
pVgroup
);
}
taosHashDestroyIter
(
pIter
);
taosHashCancelIterate
(
pStable
->
vgHash
,
pVgId
);
mnodeDropAllChildTablesInStable
(
pStable
);
}
...
...
@@ -1430,8 +1439,6 @@ void mnodeDropAllSuperTables(SDbObj *pDropDb) {
mnodeDecTableRef
(
pTable
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"db:%s, all super tables:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfTables
);
}
...
...
@@ -1523,11 +1530,11 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
}
else
{
SVgroupsMsg
*
pVgroupMsg
=
(
SVgroupsMsg
*
)
msg
;
SHashMutableIterator
*
pIter
=
taosHashCreateIter
(
pTable
->
vgHash
);
int32_t
vgSize
=
0
;
while
(
taosHashIterNext
(
pIter
)
)
{
int32_t
*
pVgId
=
taosHashIterGet
(
pIter
);
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
*
pVgId
);
int32_t
*
pVgId
=
taosHashIterate
(
pTable
->
vgHash
,
NULL
);
int32_t
vgSize
=
0
;
while
(
pVgId
)
{
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
*
pVgId
);
pVgId
=
taosHashIterate
(
pTable
->
vgHash
,
pVgId
);
if
(
pVgroup
==
NULL
)
continue
;
pVgroupMsg
->
vgroups
[
vgSize
].
vgId
=
htonl
(
pVgroup
->
vgId
);
...
...
@@ -1547,7 +1554,7 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
mnodeDecVgroupRef
(
pVgroup
);
}
taosHash
DestroyIter
(
pIter
);
taosHash
CancelIterate
(
pTable
->
vgHash
,
pVgId
);
mnodeDecTableRef
(
pTable
);
pVgroupMsg
->
numOfVgroups
=
htonl
(
vgSize
);
...
...
@@ -2230,8 +2237,6 @@ void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup) {
mnodeDecTableRef
(
pTable
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"vgId:%d, all child tables is dropped from sdb"
,
pVgroup
->
vgId
);
}
...
...
@@ -2263,8 +2268,6 @@ void mnodeDropAllChildTables(SDbObj *pDropDb) {
mnodeDecTableRef
(
pTable
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"db:%s, all child tables:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfTables
);
}
...
...
@@ -2293,8 +2296,6 @@ static void mnodeDropAllChildTablesInStable(SSTableObj *pStable) {
mnodeDecTableRef
(
pTable
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"stable:%s, all child tables:%d is dropped from sdb"
,
pStable
->
info
.
tableId
,
numOfTables
);
}
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
3e43a653
...
...
@@ -123,7 +123,6 @@ static void mnodePrintUserAuth() {
}
fflush
(
fp
);
sdbFreeIter
(
pIter
);
fclose
(
fp
);
}
...
...
@@ -177,6 +176,8 @@ int32_t mnodeInitUsers() {
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_DROP_USER
,
mnodeProcessDropUserMsg
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_USER
,
mnodeGetUserMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_USER
,
mnodeRetrieveUsers
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_USER
,
mnodeCancelGetNextUser
);
mnodeAddPeerMsgHandle
(
TSDB_MSG_TYPE_DM_AUTH
,
mnodeProcessAuthMsg
);
mDebug
(
"table:%s, hash is created"
,
desc
.
name
);
...
...
@@ -196,6 +197,10 @@ void *mnodeGetNextUser(void *pIter, SUserObj **pUser) {
return
sdbFetchRow
(
tsUserSdb
,
pIter
,
(
void
**
)
pUser
);
}
void
mnodeCancelGetNextUser
(
void
*
pIter
)
{
sdbFreeIter
(
tsUserSdb
,
pIter
);
}
void
mnodeIncUserRef
(
SUserObj
*
pUser
)
{
return
sdbIncRef
(
tsUserSdb
,
pUser
);
}
...
...
@@ -574,8 +579,6 @@ void mnodeDropAllUsers(SAcctObj *pAcct) {
mnodeDecUserRef
(
pUser
);
}
sdbFreeIter
(
pIter
);
mDebug
(
"acct:%s, all users:%d is dropped from sdb"
,
pAcct
->
user
,
numOfUsers
);
}
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
3e43a653
...
...
@@ -230,6 +230,7 @@ int32_t mnodeInitVgroups() {
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_VGROUP
,
mnodeGetVgroupMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_VGROUP
,
mnodeRetrieveVgroups
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_VGROUP
,
mnodeCancelGetNextVgroup
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP
,
mnodeProcessCreateVnodeRsp
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP
,
mnodeProcessAlterVnodeRsp
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_DROP_VNODE_RSP
,
mnodeProcessDropVnodeRsp
);
...
...
@@ -304,7 +305,7 @@ void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t o
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
mnodeCancelGetNextVgroup
(
pIter
);
}
void
mnodeUpdateVgroupStatus
(
SVgObj
*
pVgroup
,
SDnodeObj
*
pDnode
,
SVnodeLoad
*
pVload
)
{
...
...
@@ -491,6 +492,10 @@ void *mnodeGetNextVgroup(void *pIter, SVgObj **pVgroup) {
return
sdbFetchRow
(
tsVgroupSdb
,
pIter
,
(
void
**
)
pVgroup
);
}
void
mnodeCancelGetNextVgroup
(
void
*
pIter
)
{
sdbFreeIter
(
tsVgroupSdb
,
pIter
);
}
static
int32_t
mnodeCreateVgroupFp
(
SMnodeMsg
*
pMsg
)
{
SVgObj
*
pVgroup
=
pMsg
->
pVgroup
;
SDbObj
*
pDb
=
pMsg
->
pDb
;
...
...
@@ -1095,8 +1100,6 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"dnode:%d, all vgroups:%d is dropped from sdb"
,
pDropDnode
->
dnodeId
,
numOfVgroups
);
}
...
...
@@ -1118,8 +1121,6 @@ void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb) {
mnodeDecVgroupRef(pVgroup);
}
sdbFreeIter(pIter);
mInfo("db:%s, all vgroups is updated in sdb", pAlterDb->name);
}
#endif
...
...
@@ -1147,8 +1148,6 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) {
mnodeDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
mInfo
(
"db:%s, all vgroups:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfVgroups
);
}
...
...
@@ -1170,7 +1169,5 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) {
numOfVgroups
++
;
}
sdbFreeIter
(
pIter
);
mInfo
(
"db:%s, all vgroups:%d drop msg is sent to dnode"
,
pDropDb
->
name
,
numOfVgroups
);
}
src/vnode/src/vnodeMain.c
浏览文件 @
3e43a653
...
...
@@ -542,10 +542,11 @@ void vnodeBuildStatusMsg(void *param) {
void
*
pIter
=
taosHashIterate
(
tsVnodesHash
,
NULL
);
while
(
pIter
)
{
SVnodeObj
**
pVnode
=
pIter
;
if
(
*
pVnode
)
{
vnodeBuildVloadMsg
(
*
pVnode
,
pStatus
);
SVnodeObj
**
pVnode
=
pIter
;
if
(
*
pVnode
)
{
vnodeBuildVloadMsg
(
*
pVnode
,
pStatus
);
}
pIter
=
taosHashIterate
(
tsVnodesHash
,
pIter
);
}
}
...
...
tests/script/basicSuite.sim
浏览文件 @
3e43a653
...
...
@@ -14,7 +14,6 @@ run general/table/vgroup.sim
run general/user/authority.sim
run general/vector/metrics_mix.sim
run general/vector/table_field.sim
run general/user/authority.sim
run general/tag/set.sim
run general/table/delete_writing.sim
run general/stable/disk.sim
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录