Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
888aa70b
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
888aa70b
编写于
3月 11, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/scheduler
上级
f17d4fb9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
131 addition
and
111 deletion
+131
-111
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+128
-110
source/util/src/terror.c
source/util/src/terror.c
+2
-1
未找到文件。
include/util/taoserror.h
浏览文件 @
888aa70b
...
@@ -453,6 +453,7 @@ int32_t* taosGetErrno();
...
@@ -453,6 +453,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_CTG_SYS_ERROR TAOS_DEF_ERROR_CODE(0, 0x2404)
#define TSDB_CODE_CTG_SYS_ERROR TAOS_DEF_ERROR_CODE(0, 0x2404)
#define TSDB_CODE_CTG_DB_DROPPED TAOS_DEF_ERROR_CODE(0, 0x2405)
#define TSDB_CODE_CTG_DB_DROPPED TAOS_DEF_ERROR_CODE(0, 0x2405)
#define TSDB_CODE_CTG_OUT_OF_SERVICE TAOS_DEF_ERROR_CODE(0, 0x2406)
#define TSDB_CODE_CTG_OUT_OF_SERVICE TAOS_DEF_ERROR_CODE(0, 0x2406)
#define TSDB_CODE_CTG_VG_META_MISMATCH TAOS_DEF_ERROR_CODE(0, 0x2407)
//scheduler
//scheduler
#define TSDB_CODE_SCH_STATUS_ERROR TAOS_DEF_ERROR_CODE(0, 0x2501)
#define TSDB_CODE_SCH_STATUS_ERROR TAOS_DEF_ERROR_CODE(0, 0x2501)
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
888aa70b
...
@@ -484,6 +484,31 @@ _return:
...
@@ -484,6 +484,31 @@ _return:
CTG_RET
(
code
);
CTG_RET
(
code
);
}
}
int32_t
ctgPushUpdateTblMsgInQueue
(
SCatalog
*
pCtg
,
STableMetaOutput
*
output
,
bool
syncReq
)
{
int32_t
code
=
0
;
SCtgMetaAction
action
=
{.
act
=
CTG_ACT_UPDATE_TBL
};
SCtgUpdateTblMsg
*
msg
=
malloc
(
sizeof
(
SCtgUpdateTblMsg
));
if
(
NULL
==
msg
)
{
ctgError
(
"malloc %d failed"
,
(
int32_t
)
sizeof
(
SCtgUpdateTblMsg
));
CTG_ERR_RET
(
TSDB_CODE_CTG_MEM_ERROR
);
}
msg
->
pCtg
=
pCtg
;
msg
->
output
=
output
;
action
.
data
=
msg
;
CTG_ERR_JRET
(
ctgPushAction
(
pCtg
,
&
action
));
return
TSDB_CODE_SUCCESS
;
_return:
tfree
(
msg
);
CTG_RET
(
code
);
}
int32_t
ctgAcquireVgInfo
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
,
bool
*
inCache
)
{
int32_t
ctgAcquireVgInfo
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
,
bool
*
inCache
)
{
CTG_LOCK
(
CTG_READ
,
&
dbCache
->
vgLock
);
CTG_LOCK
(
CTG_READ
,
&
dbCache
->
vgLock
);
...
@@ -1367,8 +1392,6 @@ int32_t ctgRemoveDB(SCatalog* pCtg, SCtgDBCache *dbCache, const char* dbFName) {
...
@@ -1367,8 +1392,6 @@ int32_t ctgRemoveDB(SCatalog* pCtg, SCtgDBCache *dbCache, const char* dbFName) {
ctgFreeDbCache
(
dbCache
);
ctgFreeDbCache
(
dbCache
);
ctgInfo
(
"db removed from cache, dbFName:%s, dbId:%"
PRIx64
,
dbFName
,
dbCache
->
dbId
);
CTG_ERR_RET
(
ctgMetaRentRemove
(
&
pCtg
->
dbRent
,
dbCache
->
dbId
,
ctgDbVgVersionSortCompare
,
ctgDbVgVersionSearchCompare
));
CTG_ERR_RET
(
ctgMetaRentRemove
(
&
pCtg
->
dbRent
,
dbCache
->
dbId
,
ctgDbVgVersionSortCompare
,
ctgDbVgVersionSearchCompare
));
ctgDebug
(
"db removed from rent, dbFName:%s, dbId:%"
PRIx64
,
dbFName
,
dbCache
->
dbId
);
ctgDebug
(
"db removed from rent, dbFName:%s, dbId:%"
PRIx64
,
dbFName
,
dbCache
->
dbId
);
...
@@ -1431,7 +1454,8 @@ int32_t ctgUpdateDBVgInfo(SCatalog* pCtg, const char* dbFName, uint64_t dbId, SD
...
@@ -1431,7 +1454,8 @@ int32_t ctgUpdateDBVgInfo(SCatalog* pCtg, const char* dbFName, uint64_t dbId, SD
SDBVgInfo
*
dbInfo
=
*
pDbInfo
;
SDBVgInfo
*
dbInfo
=
*
pDbInfo
;
if
(
NULL
==
dbInfo
->
vgHash
||
dbInfo
->
vgVersion
<
0
||
taosHashGetSize
(
dbInfo
->
vgHash
)
<=
0
)
{
if
(
NULL
==
dbInfo
->
vgHash
||
dbInfo
->
vgVersion
<
0
||
taosHashGetSize
(
dbInfo
->
vgHash
)
<=
0
)
{
ctgError
(
"invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d"
,
dbFName
,
dbInfo
->
vgHash
,
dbInfo
->
vgVersion
);
ctgError
(
"invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d"
,
dbFName
,
dbInfo
->
vgHash
,
dbInfo
->
vgVersion
,
taosHashGetSize
(
dbInfo
->
vgHash
));
CTG_ERR_RET
(
TSDB_CODE_CTG_MEM_ERROR
);
CTG_ERR_RET
(
TSDB_CODE_CTG_MEM_ERROR
);
}
}
...
@@ -1655,21 +1679,21 @@ _return:
...
@@ -1655,21 +1679,21 @@ _return:
int32_t
ctgRefreshDBVgInfo
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
dbFName
)
{
int32_t
ctgRefreshDBVgInfo
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
dbFName
)
{
bool
inCache
=
false
;
bool
inCache
=
false
;
int32_t
code
=
0
;
int32_t
code
=
0
;
SCtgDBCache
*
*
dbCache
=
NULL
;
SCtgDBCache
*
dbCache
=
NULL
;
CTG_ERR_RET
(
ctgAcquireVgInfoFromCache
(
pCtg
,
dbFName
,
dbCache
,
&
inCache
));
CTG_ERR_RET
(
ctgAcquireVgInfoFromCache
(
pCtg
,
dbFName
,
&
dbCache
,
&
inCache
));
SUseDbOutput
DbOut
=
{
0
};
SUseDbOutput
DbOut
=
{
0
};
SBuildUseDBInput
input
=
{
0
};
SBuildUseDBInput
input
=
{
0
};
tstrncpy
(
input
.
db
,
dbFName
,
tListLen
(
input
.
db
));
tstrncpy
(
input
.
db
,
dbFName
,
tListLen
(
input
.
db
));
if
(
inCache
)
{
if
(
inCache
)
{
input
.
dbId
=
(
*
dbCache
)
->
dbId
;
input
.
dbId
=
dbCache
->
dbId
;
input
.
vgVersion
=
(
*
dbCache
)
->
vgInfo
->
vgVersion
;
input
.
vgVersion
=
dbCache
->
vgInfo
->
vgVersion
;
input
.
numOfTable
=
(
*
dbCache
)
->
vgInfo
->
numOfTable
;
input
.
numOfTable
=
dbCache
->
vgInfo
->
numOfTable
;
ctgReleaseVgInfo
(
*
dbCache
);
ctgReleaseVgInfo
(
dbCache
);
ctgReleaseDBCache
(
pCtg
,
*
dbCache
);
ctgReleaseDBCache
(
pCtg
,
dbCache
);
}
else
{
}
else
{
input
.
vgVersion
=
CTG_DEFAULT_INVALID_VERSION
;
input
.
vgVersion
=
CTG_DEFAULT_INVALID_VERSION
;
}
}
...
@@ -1717,7 +1741,7 @@ int32_t ctgCloneMetaOutput(STableMetaOutput *output, STableMetaOutput **pOutput)
...
@@ -1717,7 +1741,7 @@ int32_t ctgCloneMetaOutput(STableMetaOutput *output, STableMetaOutput **pOutput)
int32_t
ctgRefreshTblMeta
(
SCatalog
*
pCtg
,
void
*
pTrans
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
int32_t
flag
,
STableMetaOutput
**
pOutput
)
{
int32_t
ctgRefreshTblMeta
(
SCatalog
*
pCtg
,
void
*
pTrans
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
int32_t
flag
,
STableMetaOutput
**
pOutput
,
bool
syncReq
)
{
if
(
NULL
==
pCtg
||
NULL
==
pTrans
||
NULL
==
pMgmtEps
||
NULL
==
pTableName
)
{
if
(
NULL
==
pCtg
||
NULL
==
pTrans
||
NULL
==
pMgmtEps
||
NULL
==
pTableName
)
{
CTG_ERR_RET
(
TSDB_CODE_CTG_INVALID_INPUT
);
CTG_ERR_RET
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
}
...
@@ -1729,7 +1753,6 @@ int32_t ctgRefreshTblMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps,
...
@@ -1729,7 +1753,6 @@ int32_t ctgRefreshTblMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps,
CTG_ERR_RET
(
catalogGetTableHashVgroup
(
pCtg
,
pTrans
,
pMgmtEps
,
pTableName
,
&
vgroupInfo
));
CTG_ERR_RET
(
catalogGetTableHashVgroup
(
pCtg
,
pTrans
,
pMgmtEps
,
pTableName
,
&
vgroupInfo
));
}
}
SCtgUpdateTblMsg
*
msg
=
NULL
;
STableMetaOutput
moutput
=
{
0
};
STableMetaOutput
moutput
=
{
0
};
STableMetaOutput
*
output
=
calloc
(
1
,
sizeof
(
STableMetaOutput
));
STableMetaOutput
*
output
=
calloc
(
1
,
sizeof
(
STableMetaOutput
));
if
(
NULL
==
output
)
{
if
(
NULL
==
output
)
{
...
@@ -1801,19 +1824,7 @@ int32_t ctgRefreshTblMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps,
...
@@ -1801,19 +1824,7 @@ int32_t ctgRefreshTblMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps,
CTG_ERR_JRET
(
ctgCloneMetaOutput
(
output
,
pOutput
));
CTG_ERR_JRET
(
ctgCloneMetaOutput
(
output
,
pOutput
));
}
}
SCtgMetaAction
action
=
{.
act
=
CTG_ACT_UPDATE_TBL
};
CTG_ERR_JRET
(
ctgPushUpdateTblMsgInQueue
(
pCtg
,
output
,
syncReq
));
msg
=
malloc
(
sizeof
(
SCtgUpdateTblMsg
));
if
(
NULL
==
msg
)
{
ctgError
(
"malloc %d failed"
,
(
int32_t
)
sizeof
(
SCtgUpdateTblMsg
));
CTG_ERR_JRET
(
TSDB_CODE_CTG_MEM_ERROR
);
}
msg
->
pCtg
=
pCtg
;
msg
->
output
=
output
;
action
.
data
=
msg
;
CTG_ERR_JRET
(
ctgPushAction
(
pCtg
,
&
action
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -1821,7 +1832,6 @@ _return:
...
@@ -1821,7 +1832,6 @@ _return:
tfree
(
output
->
tbMeta
);
tfree
(
output
->
tbMeta
);
tfree
(
output
);
tfree
(
output
);
tfree
(
msg
);
CTG_RET
(
code
);
CTG_RET
(
code
);
}
}
...
@@ -1862,7 +1872,7 @@ int32_t ctgGetTableMeta(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmtEps, cons
...
@@ -1862,7 +1872,7 @@ int32_t ctgGetTableMeta(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmtEps, cons
while
(
true
)
{
while
(
true
)
{
CTG_ERR_JRET
(
ctgRefreshTblMeta
(
pCtg
,
pRpc
,
pMgmtEps
,
pTableName
,
flag
,
&
output
));
CTG_ERR_JRET
(
ctgRefreshTblMeta
(
pCtg
,
pRpc
,
pMgmtEps
,
pTableName
,
flag
,
&
output
,
false
));
if
(
CTG_IS_META_TABLE
(
output
->
metaType
))
{
if
(
CTG_IS_META_TABLE
(
output
->
metaType
))
{
*
pTableMeta
=
output
->
tbMeta
;
*
pTableMeta
=
output
->
tbMeta
;
...
@@ -2155,6 +2165,82 @@ int32_t ctgStartUpdateThread() {
...
@@ -2155,6 +2165,82 @@ int32_t ctgStartUpdateThread() {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
ctgGetTableDistVgInfo
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
SArray
**
pVgList
)
{
STableMeta
*
tbMeta
=
NULL
;
int32_t
code
=
0
;
SVgroupInfo
vgroupInfo
=
{
0
};
SCtgDBCache
*
dbCache
=
NULL
;
SArray
*
vgList
=
NULL
;
SDBVgInfo
*
vgInfo
=
NULL
;
*
pVgList
=
NULL
;
CTG_ERR_JRET
(
ctgGetTableMeta
(
pCtg
,
pRpc
,
pMgmtEps
,
pTableName
,
&
tbMeta
,
CTG_FLAG_UNKNOWN_STB
));
char
db
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
tNameGetFullDbName
(
pTableName
,
db
);
SHashObj
*
vgHash
=
NULL
;
CTG_ERR_JRET
(
ctgGetDBVgInfo
(
pCtg
,
pRpc
,
pMgmtEps
,
db
,
false
,
&
dbCache
,
&
vgInfo
));
if
(
dbCache
)
{
vgHash
=
dbCache
->
vgInfo
->
vgHash
;
}
else
{
vgHash
=
vgInfo
->
vgHash
;
}
if
(
tbMeta
->
tableType
==
TSDB_SUPER_TABLE
)
{
CTG_ERR_JRET
(
ctgGenerateVgList
(
pCtg
,
vgHash
,
pVgList
));
}
else
{
// USE HASH METHOD INSTEAD OF VGID IN TBMETA
ctgError
(
"invalid method to get none stb vgInfo, tbType:%d"
,
tbMeta
->
tableType
);
CTG_ERR_JRET
(
TSDB_CODE_CTG_INVALID_INPUT
);
#if 0
int32_t vgId = tbMeta->vgId;
if (taosHashGetDup(vgHash, &vgId, sizeof(vgId), &vgroupInfo) != 0) {
ctgWarn("table's vgId not found in vgroup list, vgId:%d, tbName:%s", vgId, tNameGetTableName(pTableName));
CTG_ERR_JRET(TSDB_CODE_CTG_VG_META_MISMATCH);
}
vgList = taosArrayInit(1, sizeof(SVgroupInfo));
if (NULL == vgList) {
ctgError("taosArrayInit %d failed", (int32_t)sizeof(SVgroupInfo));
CTG_ERR_JRET(TSDB_CODE_CTG_MEM_ERROR);
}
if (NULL == taosArrayPush(vgList, &vgroupInfo)) {
ctgError("taosArrayPush vgroupInfo to array failed, vgId:%d, tbName:%s", vgId, tNameGetTableName(pTableName));
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
}
*pVgList = vgList;
vgList = NULL;
#endif
}
_return:
if
(
dbCache
)
{
ctgReleaseVgInfo
(
dbCache
);
ctgReleaseDBCache
(
pCtg
,
dbCache
);
}
tfree
(
tbMeta
);
if
(
vgInfo
)
{
taosHashCleanup
(
vgInfo
->
vgHash
);
tfree
(
vgInfo
);
}
if
(
vgList
)
{
taosArrayDestroy
(
vgList
);
vgList
=
NULL
;
}
CTG_RET
(
code
);
}
int32_t
catalogInit
(
SCatalogCfg
*
cfg
)
{
int32_t
catalogInit
(
SCatalogCfg
*
cfg
)
{
if
(
gCtgMgmt
.
pCluster
)
{
if
(
gCtgMgmt
.
pCluster
)
{
...
@@ -2502,19 +2588,7 @@ int32_t catalogUpdateSTableMeta(SCatalog* pCtg, STableMetaRsp *rspMsg) {
...
@@ -2502,19 +2588,7 @@ int32_t catalogUpdateSTableMeta(SCatalog* pCtg, STableMetaRsp *rspMsg) {
CTG_ERR_JRET
(
queryCreateTableMetaFromMsg
(
rspMsg
,
true
,
&
output
->
tbMeta
));
CTG_ERR_JRET
(
queryCreateTableMetaFromMsg
(
rspMsg
,
true
,
&
output
->
tbMeta
));
SCtgMetaAction
action
=
{.
act
=
CTG_ACT_UPDATE_TBL
};
CTG_ERR_JRET
(
ctgPushUpdateTblMsgInQueue
(
pCtg
,
output
));
SCtgUpdateTblMsg
*
msg
=
malloc
(
sizeof
(
SCtgUpdateTblMsg
));
if
(
NULL
==
msg
)
{
ctgError
(
"malloc %d failed"
,
(
int32_t
)
sizeof
(
SCtgUpdateTblMsg
));
CTG_ERR_JRET
(
TSDB_CODE_CTG_MEM_ERROR
);
}
msg
->
pCtg
=
pCtg
;
msg
->
output
=
output
;
action
.
data
=
msg
;
CTG_ERR_JRET
(
ctgPushAction
(
pCtg
,
&
action
));
CTG_API_LEAVE
(
code
);
CTG_API_LEAVE
(
code
);
...
@@ -2522,7 +2596,6 @@ _return:
...
@@ -2522,7 +2596,6 @@ _return:
tfree
(
output
->
tbMeta
);
tfree
(
output
->
tbMeta
);
tfree
(
output
);
tfree
(
output
);
tfree
(
msg
);
CTG_API_LEAVE
(
code
);
CTG_API_LEAVE
(
code
);
}
}
...
@@ -2544,7 +2617,7 @@ int32_t catalogRefreshTableMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
...
@@ -2544,7 +2617,7 @@ int32_t catalogRefreshTableMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
CTG_API_LEAVE
(
TSDB_CODE_CTG_INVALID_INPUT
);
CTG_API_LEAVE
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
}
CTG_API_LEAVE
(
ctgRefreshTblMeta
(
pCtg
,
pTrans
,
pMgmtEps
,
pTableName
,
CTG_FLAG_FORCE_UPDATE
|
CTG_FLAG_MAKE_STB
(
isSTable
),
NULL
));
CTG_API_LEAVE
(
ctgRefreshTblMeta
(
pCtg
,
pTrans
,
pMgmtEps
,
pTableName
,
CTG_FLAG_FORCE_UPDATE
|
CTG_FLAG_MAKE_STB
(
isSTable
),
NULL
,
false
));
}
}
int32_t
catalogRefreshGetTableMeta
(
SCatalog
*
pCtg
,
void
*
pTrans
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
STableMeta
**
pTableMeta
,
int32_t
isSTable
)
{
int32_t
catalogRefreshGetTableMeta
(
SCatalog
*
pCtg
,
void
*
pTrans
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
STableMeta
**
pTableMeta
,
int32_t
isSTable
)
{
...
@@ -2565,82 +2638,27 @@ int32_t catalogGetTableDistVgInfo(SCatalog* pCtg, void *pRpc, const SEpSet* pMgm
...
@@ -2565,82 +2638,27 @@ int32_t catalogGetTableDistVgInfo(SCatalog* pCtg, void *pRpc, const SEpSet* pMgm
CTG_API_LEAVE
(
TSDB_CODE_CTG_INVALID_INPUT
);
CTG_API_LEAVE
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
}
STableMeta
*
tbMeta
=
NULL
;
int32_t
code
=
0
;
int32_t
code
=
0
;
SVgroupInfo
vgroupInfo
=
{
0
};
SCtgDBCache
*
dbCache
=
NULL
;
SArray
*
vgList
=
NULL
;
SDBVgInfo
*
vgInfo
=
NULL
;
*
pVgList
=
NULL
;
CTG_ERR_JRET
(
ctgGetTableMeta
(
pCtg
,
pRpc
,
pMgmtEps
,
pTableName
,
&
tbMeta
,
CTG_FLAG_UNKNOWN_STB
));
char
db
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
tNameGetFullDbName
(
pTableName
,
db
);
SHashObj
*
vgHash
=
NULL
;
CTG_ERR_JRET
(
ctgGetDBVgInfo
(
pCtg
,
pRpc
,
pMgmtEps
,
db
,
false
,
&
dbCache
,
&
vgInfo
));
if
(
dbCache
)
{
while
(
true
)
{
vgHash
=
dbCache
->
vgInfo
->
vgHash
;
code
=
ctgGetTableDistVgInfo
(
pCtg
,
pRpc
,
pMgmtEps
,
pTableName
,
pVgList
);
}
else
{
if
(
code
)
{
vgHash
=
vgInfo
->
vgHash
;
if
(
TSDB_CODE_CTG_VG_META_MISMATCH
==
code
)
{
}
CTG_ERR_JRET
(
ctgRefreshTblMeta
(
pCtg
,
pRpc
,
pMgmtEps
,
pTableName
,
CTG_FLAG_FORCE_UPDATE
|
CTG_FLAG_MAKE_STB
(
CTG_FLAG_UNKNOWN_STB
),
NULL
,
true
));
/* TODO REMOEV THIS ....
if (0 == tbMeta->vgId) {
SVgroupInfo vgroup = {0};
catalogGetTableHashVgroup(pCtg, pRpc, pMgmtEps, pTableName, &vgroup);
tbMeta->vgId = vgroup.vgId;
}
// TODO REMOVE THIS ....*/
if
(
tbMeta
->
tableType
==
TSDB_SUPER_TABLE
)
{
char
dbFName
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
CTG_ERR_JRET
(
ctgGenerateVgList
(
pCtg
,
vgHash
,
pVgList
));
tNameGetFullDbName
(
pTableName
,
dbFName
);
}
else
{
CTG_ERR_JRET
(
ctgRefreshDBVgInfo
(
pCtg
,
pRpc
,
pMgmtEps
,
dbFName
));
int32_t
vgId
=
tbMeta
->
vgId
;
if
(
taosHashGetDup
(
vgHash
,
&
vgId
,
sizeof
(
vgId
),
&
vgroupInfo
)
!=
0
)
{
ctgError
(
"table's vgId not found in vgroup list, vgId:%d, tbName:%s"
,
vgId
,
tNameGetTableName
(
pTableName
));
CTG_ERR_JRET
(
TSDB_CODE_CTG_INTERNAL_ERROR
);
}
vgList
=
taosArrayInit
(
1
,
sizeof
(
SVgroupInfo
));
continue
;
if
(
NULL
==
vgList
)
{
ctgError
(
"taosArrayInit %d failed"
,
(
int32_t
)
sizeof
(
SVgroupInfo
));
CTG_ERR_JRET
(
TSDB_CODE_CTG_MEM_ERROR
);
}
}
if
(
NULL
==
taosArrayPush
(
vgList
,
&
vgroupInfo
))
{
ctgError
(
"taosArrayPush vgroupInfo to array failed, vgId:%d, tbName:%s"
,
vgId
,
tNameGetTableName
(
pTableName
));
CTG_ERR_JRET
(
TSDB_CODE_CTG_INTERNAL_ERROR
);
}
}
*
pVgList
=
vgList
;
break
;
vgList
=
NULL
;
}
}
_return:
_return:
if
(
dbCache
)
{
ctgReleaseVgInfo
(
dbCache
);
ctgReleaseDBCache
(
pCtg
,
dbCache
);
}
tfree
(
tbMeta
);
if
(
vgInfo
)
{
taosHashCleanup
(
vgInfo
->
vgHash
);
tfree
(
vgInfo
);
}
if
(
vgList
)
{
taosArrayDestroy
(
vgList
);
vgList
=
NULL
;
}
CTG_API_LEAVE
(
code
);
CTG_API_LEAVE
(
code
);
}
}
...
...
source/util/src/terror.c
浏览文件 @
888aa70b
...
@@ -433,6 +433,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_CTG_MEM_ERROR, "catalog memory error"
...
@@ -433,6 +433,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_CTG_MEM_ERROR, "catalog memory error"
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_SYS_ERROR
,
"catalog system error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_SYS_ERROR
,
"catalog system error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_DB_DROPPED
,
"Database is dropped"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_DB_DROPPED
,
"Database is dropped"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_OUT_OF_SERVICE
,
"catalog is out of service"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_OUT_OF_SERVICE
,
"catalog is out of service"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_VG_META_MISMATCH
,
"table meta and vgroup mismatch"
)
//scheduler
//scheduler
TAOS_DEFINE_ERROR
(
TSDB_CODE_SCH_STATUS_ERROR
,
"scheduler status error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SCH_STATUS_ERROR
,
"scheduler status error"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录