|
|
@ -13,15 +13,15 @@
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "trpc.h"
|
|
|
|
|
|
|
|
#include "query.h"
|
|
|
|
|
|
|
|
#include "tname.h"
|
|
|
|
|
|
|
|
#include "catalogInt.h"
|
|
|
|
#include "catalogInt.h"
|
|
|
|
|
|
|
|
#include "query.h"
|
|
|
|
#include "systable.h"
|
|
|
|
#include "systable.h"
|
|
|
|
|
|
|
|
#include "tname.h"
|
|
|
|
#include "tref.h"
|
|
|
|
#include "tref.h"
|
|
|
|
|
|
|
|
#include "trpc.h"
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetTbMetaTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetTbMetaTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SName *name = (SName*)param;
|
|
|
|
SName* name = (SName*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_TB_META;
|
|
|
|
task.type = CTG_TASK_GET_TB_META;
|
|
|
@ -45,13 +45,14 @@ int32_t ctgInitGetTbMetaTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetTbMetasTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetTbMetasTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SName *name = (SName*)param;
|
|
|
|
SName* name = (SName*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_TB_META_BATCH;
|
|
|
|
task.type = CTG_TASK_GET_TB_META_BATCH;
|
|
|
@ -69,14 +70,14 @@ int32_t ctgInitGetTbMetasTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%d, tbNum:%d",
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%d, tbNum:%d", pJob->queryId, taskIdx,
|
|
|
|
pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->tbMetaNum);
|
|
|
|
ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->tbMetaNum);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetDbVgTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetDbVgTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
char *dbFName = (char*)param;
|
|
|
|
char* dbFName = (char*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_DB_VGROUP;
|
|
|
|
task.type = CTG_TASK_GET_DB_VGROUP;
|
|
|
@ -94,13 +95,14 @@ int32_t ctgInitGetDbVgTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), dbFName);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), dbFName);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetDbCfgTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetDbCfgTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
char *dbFName = (char*)param;
|
|
|
|
char* dbFName = (char*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_DB_CFG;
|
|
|
|
task.type = CTG_TASK_GET_DB_CFG;
|
|
|
@ -118,13 +120,14 @@ int32_t ctgInitGetDbCfgTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), dbFName);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), dbFName);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetDbInfoTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetDbInfoTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
char *dbFName = (char*)param;
|
|
|
|
char* dbFName = (char*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_DB_INFO;
|
|
|
|
task.type = CTG_TASK_GET_DB_INFO;
|
|
|
@ -142,14 +145,14 @@ int32_t ctgInitGetDbInfoTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), dbFName);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), dbFName);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetTbHashTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetTbHashTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
SName* name = (SName*)param;
|
|
|
|
SName *name = (SName*)param;
|
|
|
|
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_TB_HASH;
|
|
|
|
task.type = CTG_TASK_GET_TB_HASH;
|
|
|
@ -173,13 +176,14 @@ int32_t ctgInitGetTbHashTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tableName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tableName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetTbHashsTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetTbHashsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SName *name = (SName*)param;
|
|
|
|
SName* name = (SName*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_TB_HASH_BATCH;
|
|
|
|
task.type = CTG_TASK_GET_TB_HASH_BATCH;
|
|
|
@ -197,14 +201,13 @@ int32_t ctgInitGetTbHashsTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%d, tbNum:%d",
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%d, tbNum:%d", pJob->queryId, taskIdx,
|
|
|
|
pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->tbHashNum);
|
|
|
|
ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->tbHashNum);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetQnodeTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetQnodeTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_QNODE;
|
|
|
|
task.type = CTG_TASK_GET_QNODE;
|
|
|
@ -219,7 +222,7 @@ int32_t ctgInitGetQnodeTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetDnodeTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetDnodeTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_DNODE;
|
|
|
|
task.type = CTG_TASK_GET_DNODE;
|
|
|
@ -234,8 +237,8 @@ int32_t ctgInitGetDnodeTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetIndexTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetIndexTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
char *name = (char*)param;
|
|
|
|
char* name = (char*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_INDEX;
|
|
|
|
task.type = CTG_TASK_GET_INDEX;
|
|
|
@ -253,13 +256,14 @@ int32_t ctgInitGetIndexTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, indexFName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), name);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, indexFName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), name);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetUdfTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetUdfTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
char *name = (char*)param;
|
|
|
|
char* name = (char*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_UDF;
|
|
|
|
task.type = CTG_TASK_GET_UDF;
|
|
|
@ -277,13 +281,14 @@ int32_t ctgInitGetUdfTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, udfName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), name);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, udfName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), name);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetUserTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetUserTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SUserAuthInfo *user = (SUserAuthInfo*)param;
|
|
|
|
SUserAuthInfo* user = (SUserAuthInfo*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_USER;
|
|
|
|
task.type = CTG_TASK_GET_USER;
|
|
|
@ -301,12 +306,13 @@ int32_t ctgInitGetUserTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, user:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), user->user);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, user:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), user->user);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetSvrVerTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetSvrVerTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_SVR_VER;
|
|
|
|
task.type = CTG_TASK_GET_SVR_VER;
|
|
|
@ -320,8 +326,8 @@ int32_t ctgInitGetSvrVerTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetTbIndexTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetTbIndexTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SName *name = (SName*)param;
|
|
|
|
SName* name = (SName*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_TB_INDEX;
|
|
|
|
task.type = CTG_TASK_GET_TB_INDEX;
|
|
|
@ -344,13 +350,14 @@ int32_t ctgInitGetTbIndexTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitGetTbCfgTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
int32_t ctgInitGetTbCfgTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|
|
|
SName *name = (SName*)param;
|
|
|
|
SName* name = (SName*)param;
|
|
|
|
SCtgTask task = {0};
|
|
|
|
SCtgTask task = {0};
|
|
|
|
|
|
|
|
|
|
|
|
task.type = CTG_TASK_GET_TB_CFG;
|
|
|
|
task.type = CTG_TASK_GET_TB_CFG;
|
|
|
@ -373,13 +380,13 @@ int32_t ctgInitGetTbCfgTask(SCtgJob *pJob, int32_t taskIdx, void* param) {
|
|
|
|
|
|
|
|
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
taosArrayPush(pJob->pTasks, &task);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
|
|
|
|
|
|
|
ctgTaskTypeStr(task.type), name->tname);
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleForceUpdate(SCatalog* pCtg, int32_t taskNum, SCtgJob* pJob, const SCatalogReq* pReq) {
|
|
|
|
int32_t ctgHandleForceUpdate(SCatalog* pCtg, int32_t taskNum, SCtgJob *pJob, const SCatalogReq* pReq) {
|
|
|
|
|
|
|
|
SHashObj* pDb = taosHashInit(taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
|
|
|
SHashObj* pDb = taosHashInit(taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
|
|
|
SHashObj* pTb = taosHashInit(taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
|
|
|
SHashObj* pTb = taosHashInit(taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
|
|
|
if (NULL == pDb || NULL == pTb) {
|
|
|
|
if (NULL == pDb || NULL == pTb) {
|
|
|
@ -455,7 +462,6 @@ int32_t ctgHandleForceUpdate(SCatalog* pCtg, int32_t taskNum, SCtgJob *pJob, con
|
|
|
|
|
|
|
|
|
|
|
|
taosHashCleanup(pTb);
|
|
|
|
taosHashCleanup(pTb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int32_t i = 0; i < pJob->tbIndexNum; ++i) {
|
|
|
|
for (int32_t i = 0; i < pJob->tbIndexNum; ++i) {
|
|
|
|
SName* name = taosArrayGet(pReq->pTableIndex, i);
|
|
|
|
SName* name = taosArrayGet(pReq->pTableIndex, i);
|
|
|
|
ctgDropTbIndexEnqueue(pCtg, name, true);
|
|
|
|
ctgDropTbIndexEnqueue(pCtg, name, true);
|
|
|
@ -464,7 +470,7 @@ int32_t ctgHandleForceUpdate(SCatalog* pCtg, int32_t taskNum, SCtgJob *pJob, con
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitTask(SCtgJob *pJob, CTG_TASK_TYPE type, void* param, int32_t *taskId) {
|
|
|
|
int32_t ctgInitTask(SCtgJob* pJob, CTG_TASK_TYPE type, void* param, int32_t* taskId) {
|
|
|
|
int32_t tid = atomic_fetch_add_32(&pJob->taskIdx, 1);
|
|
|
|
int32_t tid = atomic_fetch_add_32(&pJob->taskIdx, 1);
|
|
|
|
|
|
|
|
|
|
|
|
CTG_LOCK(CTG_WRITE, &pJob->taskLock);
|
|
|
|
CTG_LOCK(CTG_WRITE, &pJob->taskLock);
|
|
|
@ -478,7 +484,8 @@ int32_t ctgInitTask(SCtgJob *pJob, CTG_TASK_TYPE type, void* param, int32_t *tas
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, const SCatalogReq* pReq, catalogCallback fp, void* param) {
|
|
|
|
int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const SCatalogReq* pReq, catalogCallback fp,
|
|
|
|
|
|
|
|
void* param) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t tbMetaNum = (int32_t)ctgGetTablesReqNum(pReq->pTableMeta);
|
|
|
|
int32_t tbMetaNum = (int32_t)ctgGetTablesReqNum(pReq->pTableMeta);
|
|
|
|
int32_t dbVgNum = (int32_t)taosArrayGetSize(pReq->pDbVgroup);
|
|
|
|
int32_t dbVgNum = (int32_t)taosArrayGetSize(pReq->pDbVgroup);
|
|
|
@ -494,7 +501,8 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, const
|
|
|
|
int32_t tbIndexNum = (int32_t)taosArrayGetSize(pReq->pTableIndex);
|
|
|
|
int32_t tbIndexNum = (int32_t)taosArrayGetSize(pReq->pTableIndex);
|
|
|
|
int32_t tbCfgNum = (int32_t)taosArrayGetSize(pReq->pTableCfg);
|
|
|
|
int32_t tbCfgNum = (int32_t)taosArrayGetSize(pReq->pTableCfg);
|
|
|
|
|
|
|
|
|
|
|
|
int32_t taskNum = tbMetaNum + dbVgNum + udfNum + tbHashNum + qnodeNum + dnodeNum + svrVerNum + dbCfgNum + indexNum + userNum + dbInfoNum + tbIndexNum + tbCfgNum;
|
|
|
|
int32_t taskNum = tbMetaNum + dbVgNum + udfNum + tbHashNum + qnodeNum + dnodeNum + svrVerNum + dbCfgNum + indexNum +
|
|
|
|
|
|
|
|
userNum + dbInfoNum + tbIndexNum + tbCfgNum;
|
|
|
|
|
|
|
|
|
|
|
|
*job = taosMemoryCalloc(1, sizeof(SCtgJob));
|
|
|
|
*job = taosMemoryCalloc(1, sizeof(SCtgJob));
|
|
|
|
if (NULL == *job) {
|
|
|
|
if (NULL == *job) {
|
|
|
@ -502,7 +510,7 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, const
|
|
|
|
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
|
|
|
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCtgJob *pJob = *job;
|
|
|
|
SCtgJob* pJob = *job;
|
|
|
|
|
|
|
|
|
|
|
|
pJob->subTaskNum = taskNum;
|
|
|
|
pJob->subTaskNum = taskNum;
|
|
|
|
pJob->queryId = pConn->requestId;
|
|
|
|
pJob->queryId = pConn->requestId;
|
|
|
@ -526,7 +534,8 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, const
|
|
|
|
pJob->svrVerNum = svrVerNum;
|
|
|
|
pJob->svrVerNum = svrVerNum;
|
|
|
|
|
|
|
|
|
|
|
|
#if CTG_BATCH_FETCH
|
|
|
|
#if CTG_BATCH_FETCH
|
|
|
|
pJob->pBatchs = taosHashInit(CTG_DEFAULT_BATCH_NUM, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
|
|
|
|
pJob->pBatchs =
|
|
|
|
|
|
|
|
taosHashInit(CTG_DEFAULT_BATCH_NUM, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
|
|
|
|
if (NULL == pJob->pBatchs) {
|
|
|
|
if (NULL == pJob->pBatchs) {
|
|
|
|
ctgError("taosHashInit %d batch failed", CTG_DEFAULT_BATCH_NUM);
|
|
|
|
ctgError("taosHashInit %d batch failed", CTG_DEFAULT_BATCH_NUM);
|
|
|
|
CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
|
|
|
CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
|
|
@ -625,10 +634,10 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, const
|
|
|
|
|
|
|
|
|
|
|
|
taosAcquireRef(gCtgMgmt.jobPool, pJob->refId);
|
|
|
|
taosAcquireRef(gCtgMgmt.jobPool, pJob->refId);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 ", jobId: 0x%" PRIx64 " initialized, task num %d, forceUpdate %d", pJob->queryId, pJob->refId, taskNum, pReq->forceUpdate);
|
|
|
|
qDebug("QID:0x%" PRIx64 ", jobId: 0x%" PRIx64 " initialized, task num %d, forceUpdate %d", pJob->queryId, pJob->refId,
|
|
|
|
|
|
|
|
taskNum, pReq->forceUpdate);
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_return:
|
|
|
|
_return:
|
|
|
|
|
|
|
|
|
|
|
|
ctgFreeJob(*job);
|
|
|
|
ctgFreeJob(*job);
|
|
|
@ -658,7 +667,6 @@ int32_t ctgDumpTbMetasRes(SCtgTask* pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgDumpDbVgRes(SCtgTask* pTask) {
|
|
|
|
int32_t ctgDumpDbVgRes(SCtgTask* pTask) {
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
if (NULL == pJob->jobRes.pDbVgroup) {
|
|
|
|
if (NULL == pJob->jobRes.pDbVgroup) {
|
|
|
@ -772,7 +780,6 @@ int32_t ctgDumpDnodeRes(SCtgTask* pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgDumpDbCfgRes(SCtgTask* pTask) {
|
|
|
|
int32_t ctgDumpDbCfgRes(SCtgTask* pTask) {
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
if (NULL == pJob->jobRes.pDbCfg) {
|
|
|
|
if (NULL == pJob->jobRes.pDbCfg) {
|
|
|
@ -848,14 +855,14 @@ int32_t ctgDumpSvrVer(SCtgTask* pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgCallSubCb(SCtgTask *pTask) {
|
|
|
|
int32_t ctgCallSubCb(SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
|
|
|
|
|
|
|
|
CTG_LOCK(CTG_WRITE, &pTask->lock);
|
|
|
|
CTG_LOCK(CTG_WRITE, &pTask->lock);
|
|
|
|
|
|
|
|
|
|
|
|
int32_t parentNum = taosArrayGetSize(pTask->pParents);
|
|
|
|
int32_t parentNum = taosArrayGetSize(pTask->pParents);
|
|
|
|
for (int32_t i = 0; i < parentNum; ++i) {
|
|
|
|
for (int32_t i = 0; i < parentNum; ++i) {
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgTask* pParent = taosArrayGetP(pTask->pParents, i);
|
|
|
|
SCtgTask* pParent = taosArrayGetP(pTask->pParents, i);
|
|
|
|
|
|
|
|
|
|
|
|
pParent->subRes.code = pTask->code;
|
|
|
|
pParent->subRes.code = pTask->code;
|
|
|
@ -866,7 +873,7 @@ int32_t ctgCallSubCb(SCtgTask *pTask) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCtgMsgCtx *pParMsgCtx = CTG_GET_TASK_MSGCTX(pParent, -1);
|
|
|
|
SCtgMsgCtx* pParMsgCtx = CTG_GET_TASK_MSGCTX(pParent, -1);
|
|
|
|
|
|
|
|
|
|
|
|
pParMsgCtx->pBatchs = pMsgCtx->pBatchs;
|
|
|
|
pParMsgCtx->pBatchs = pMsgCtx->pBatchs;
|
|
|
|
CTG_ERR_JRET(pParent->subRes.fp(pParent));
|
|
|
|
CTG_ERR_JRET(pParent->subRes.fp(pParent));
|
|
|
@ -910,7 +917,8 @@ int32_t ctgHandleTaskEnd(SCtgTask* pTask, int32_t rspCode) {
|
|
|
|
|
|
|
|
|
|
|
|
int32_t taskDone = atomic_add_fetch_32(&pJob->taskDone, 1);
|
|
|
|
int32_t taskDone = atomic_add_fetch_32(&pJob->taskDone, 1);
|
|
|
|
if (taskDone < taosArrayGetSize(pJob->pTasks)) {
|
|
|
|
if (taskDone < taosArrayGetSize(pJob->pTasks)) {
|
|
|
|
qDebug("QID:0x%" PRIx64 " task done: %d, total: %d", pJob->queryId, taskDone, (int32_t)taosArrayGetSize(pJob->pTasks));
|
|
|
|
qDebug("QID:0x%" PRIx64 " task done: %d, total: %d", pJob->queryId, taskDone,
|
|
|
|
|
|
|
|
(int32_t)taosArrayGetSize(pJob->pTasks));
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -920,17 +928,17 @@ _return:
|
|
|
|
|
|
|
|
|
|
|
|
pJob->jobResCode = code;
|
|
|
|
pJob->jobResCode = code;
|
|
|
|
|
|
|
|
|
|
|
|
//taosSsleep(2);
|
|
|
|
// taosSsleep(2);
|
|
|
|
//qDebug("QID:0x%" PRIx64 " ctg after sleep", pJob->queryId);
|
|
|
|
// qDebug("QID:0x%" PRIx64 " ctg after sleep", pJob->queryId);
|
|
|
|
|
|
|
|
|
|
|
|
taosAsyncExec(ctgCallUserCb, pJob, NULL);
|
|
|
|
taosAsyncExec(ctgCallUserCb, pJob, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetTbMetaRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetTbMetaRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
@ -1057,7 +1065,7 @@ int32_t ctgHandleGetTbMetaRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
else if (CTG_IS_META_CTABLE(pOut->metaType)) {
|
|
|
|
else if (CTG_IS_META_CTABLE(pOut->metaType)) {
|
|
|
|
SName stbName = *pName;
|
|
|
|
SName stbName = *pName;
|
|
|
|
strcpy(stbName.tname, pOut->tbName);
|
|
|
|
strcpy(stbName.tname, pOut->tbName);
|
|
|
@ -1075,7 +1083,7 @@ int32_t ctgHandleGetTbMetaRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
TSWAP(pTask->res, pOut->tbMeta);
|
|
|
|
TSWAP(pTask->res, pOut->tbMeta);
|
|
|
|
|
|
|
|
|
|
|
@ -1092,10 +1100,9 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
@ -1225,7 +1232,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
else if (CTG_IS_META_CTABLE(pOut->metaType)) {
|
|
|
|
else if (CTG_IS_META_CTABLE(pOut->metaType)) {
|
|
|
|
SName stbName = *pName;
|
|
|
|
SName stbName = *pName;
|
|
|
|
strcpy(stbName.tname, pOut->tbName);
|
|
|
|
strcpy(stbName.tname, pOut->tbName);
|
|
|
@ -1243,7 +1250,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
memcpy(pOut->tbMeta, &pOut->ctbMeta, sizeof(pOut->ctbMeta));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
SMetaRes* pRes = taosArrayGet(ctx->pResList, pFetch->resIdx);
|
|
|
|
SMetaRes* pRes = taosArrayGet(ctx->pResList, pFetch->resIdx);
|
|
|
|
pRes->code = 0;
|
|
|
|
pRes->code = 0;
|
|
|
@ -1277,8 +1284,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetDbVgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetDbVgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgDbVgCtx* ctx = (SCtgDbVgCtx*)pTask->taskCtx;
|
|
|
|
SCtgDbVgCtx* ctx = (SCtgDbVgCtx*)pTask->taskCtx;
|
|
|
@ -1304,7 +1310,6 @@ int32_t ctgHandleGetDbVgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_return:
|
|
|
|
_return:
|
|
|
|
|
|
|
|
|
|
|
|
ctgHandleTaskEnd(pTask, code);
|
|
|
|
ctgHandleTaskEnd(pTask, code);
|
|
|
@ -1312,7 +1317,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetTbHashRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetTbHashRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTbHashCtx* ctx = (SCtgTbHashCtx*)pTask->taskCtx;
|
|
|
|
SCtgTbHashCtx* ctx = (SCtgTbHashCtx*)pTask->taskCtx;
|
|
|
@ -1342,7 +1347,6 @@ int32_t ctgHandleGetTbHashRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_return:
|
|
|
|
_return:
|
|
|
|
|
|
|
|
|
|
|
|
ctgHandleTaskEnd(pTask, code);
|
|
|
|
ctgHandleTaskEnd(pTask, code);
|
|
|
@ -1350,7 +1354,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetTbHashsRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetTbHashsRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTbHashsCtx* ctx = (SCtgTbHashsCtx*)pTask->taskCtx;
|
|
|
|
SCtgTbHashsCtx* ctx = (SCtgTbHashsCtx*)pTask->taskCtx;
|
|
|
@ -1390,7 +1394,7 @@ _return:
|
|
|
|
STablesReq* pReq = taosArrayGet(ctx->pNames, pFetch->dbIdx);
|
|
|
|
STablesReq* pReq = taosArrayGet(ctx->pNames, pFetch->dbIdx);
|
|
|
|
int32_t num = taosArrayGetSize(pReq->pTables);
|
|
|
|
int32_t num = taosArrayGetSize(pReq->pTables);
|
|
|
|
for (int32_t i = 0; i < num; ++i) {
|
|
|
|
for (int32_t i = 0; i < num; ++i) {
|
|
|
|
SMetaRes *pRes = taosArrayGet(ctx->pResList, pFetch->resIdx + i);
|
|
|
|
SMetaRes* pRes = taosArrayGet(ctx->pResList, pFetch->resIdx + i);
|
|
|
|
pRes->code = code;
|
|
|
|
pRes->code = code;
|
|
|
|
pRes->pRes = NULL;
|
|
|
|
pRes->pRes = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1408,8 +1412,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetTbIndexRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetTbIndexRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1432,7 +1435,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetTbCfgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetTbCfgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(&pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(&pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1446,7 +1449,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetDbCfgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetDbCfgRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1460,12 +1463,11 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetDbInfoRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetDbInfoRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
CTG_RET(TSDB_CODE_APP_ERROR);
|
|
|
|
CTG_RET(TSDB_CODE_APP_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetQnodeRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetQnodeRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1479,7 +1481,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetDnodeRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetDnodeRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(&pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(&pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1493,7 +1495,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetIndexRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetIndexRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1507,7 +1509,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetUdfRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetUdfRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
|
CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target));
|
|
|
@ -1521,7 +1523,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetUserRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetUserRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgUserCtx* ctx = (SCtgUserCtx*)pTask->taskCtx;
|
|
|
|
SCtgUserCtx* ctx = (SCtgUserCtx*)pTask->taskCtx;
|
|
|
@ -1541,9 +1543,11 @@ int32_t ctgHandleGetUserRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *
|
|
|
|
goto _return;
|
|
|
|
goto _return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ctx->user.type == AUTH_TYPE_READ && pOut->readDbs && taosHashGet(pOut->readDbs, ctx->user.dbFName, strlen(ctx->user.dbFName))) {
|
|
|
|
if (ctx->user.type == AUTH_TYPE_READ && pOut->readDbs &&
|
|
|
|
|
|
|
|
taosHashGet(pOut->readDbs, ctx->user.dbFName, strlen(ctx->user.dbFName))) {
|
|
|
|
pass = true;
|
|
|
|
pass = true;
|
|
|
|
} else if (ctx->user.type == AUTH_TYPE_WRITE && pOut->writeDbs && taosHashGet(pOut->writeDbs, ctx->user.dbFName, strlen(ctx->user.dbFName))) {
|
|
|
|
} else if (ctx->user.type == AUTH_TYPE_WRITE && pOut->writeDbs &&
|
|
|
|
|
|
|
|
taosHashGet(pOut->writeDbs, ctx->user.dbFName, strlen(ctx->user.dbFName))) {
|
|
|
|
pass = true;
|
|
|
|
pass = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1566,7 +1570,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgHandleGetSvrVerRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) {
|
|
|
|
int32_t ctgHandleGetSvrVerRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf* pMsg, int32_t rspCode) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
|
|
|
|
|
|
|
@ -1581,7 +1585,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgAsyncRefreshTbMeta(SCtgTaskReq *tReq, int32_t flag, SName* pName, int32_t* vgId) {
|
|
|
|
int32_t ctgAsyncRefreshTbMeta(SCtgTaskReq* tReq, int32_t flag, SName* pName, int32_t* vgId) {
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCtgTask* pTask = tReq->pTask;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
@ -1590,7 +1594,7 @@ int32_t ctgAsyncRefreshTbMeta(SCtgTaskReq *tReq, int32_t flag, SName* pName, int
|
|
|
|
if (CTG_FLAG_IS_SYS_DB(flag)) {
|
|
|
|
if (CTG_FLAG_IS_SYS_DB(flag)) {
|
|
|
|
ctgDebug("will refresh sys db tbmeta, tbName:%s", tNameGetTableName(pName));
|
|
|
|
ctgDebug("will refresh sys db tbmeta, tbName:%s", tNameGetTableName(pName));
|
|
|
|
|
|
|
|
|
|
|
|
CTG_RET(ctgGetTbMetaFromMnodeImpl(pCtg, pConn, (char *)pName->dbname, (char *)pName->tname, NULL, tReq));
|
|
|
|
CTG_RET(ctgGetTbMetaFromMnodeImpl(pCtg, pConn, (char*)pName->dbname, (char*)pName->tname, NULL, tReq));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (CTG_FLAG_IS_STB(flag)) {
|
|
|
|
if (CTG_FLAG_IS_STB(flag)) {
|
|
|
@ -1600,7 +1604,7 @@ int32_t ctgAsyncRefreshTbMeta(SCtgTaskReq *tReq, int32_t flag, SName* pName, int
|
|
|
|
CTG_RET(ctgGetTbMetaFromMnode(pCtg, pConn, pName, NULL, tReq));
|
|
|
|
CTG_RET(ctgGetTbMetaFromMnode(pCtg, pConn, pName, NULL, tReq));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
char dbFName[TSDB_DB_FNAME_LEN] = {0};
|
|
|
|
char dbFName[TSDB_DB_FNAME_LEN] = {0};
|
|
|
|
tNameGetFullDbName(pName, dbFName);
|
|
|
|
tNameGetFullDbName(pName, dbFName);
|
|
|
|
|
|
|
|
|
|
|
@ -1631,11 +1635,11 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetTbMetaTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetTbMetaTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1655,7 +1659,7 @@ int32_t ctgLaunchGetTbMetaTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetTbMetasTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetTbMetasTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgTbMetasCtx* pCtx = (SCtgTbMetasCtx*)pTask->taskCtx;
|
|
|
|
SCtgTbMetasCtx* pCtx = (SCtgTbMetasCtx*)pTask->taskCtx;
|
|
|
@ -1685,7 +1689,7 @@ int32_t ctgLaunchGetTbMetasTask(SCtgTask *pTask) {
|
|
|
|
for (int32_t i = 0; i < pCtx->fetchNum; ++i) {
|
|
|
|
for (int32_t i = 0; i < pCtx->fetchNum; ++i) {
|
|
|
|
SCtgFetch* pFetch = taosArrayGet(pCtx->pFetchs, i);
|
|
|
|
SCtgFetch* pFetch = taosArrayGet(pCtx->pFetchs, i);
|
|
|
|
SName* pName = ctgGetFetchName(pCtx->pNames, pFetch);
|
|
|
|
SName* pName = ctgGetFetchName(pCtx->pNames, pFetch);
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, i);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, i);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1699,14 +1703,14 @@ int32_t ctgLaunchGetTbMetasTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetDbVgTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetDbVgTask(SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
SCtgDbVgCtx* pCtx = (SCtgDbVgCtx*)pTask->taskCtx;
|
|
|
|
SCtgDbVgCtx* pCtx = (SCtgDbVgCtx*)pTask->taskCtx;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1740,14 +1744,14 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetTbHashTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetTbHashTask(SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
SCtgTbHashCtx* pCtx = (SCtgTbHashCtx*)pTask->taskCtx;
|
|
|
|
SCtgTbHashCtx* pCtx = (SCtgTbHashCtx*)pTask->taskCtx;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1785,11 +1789,11 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetTbHashsTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetTbHashsTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgTbHashsCtx* pCtx = (SCtgTbHashsCtx*)pTask->taskCtx;
|
|
|
|
SCtgTbHashsCtx* pCtx = (SCtgTbHashsCtx*)pTask->taskCtx;
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
int32_t dbNum = taosArrayGetSize(pCtx->pNames);
|
|
|
|
int32_t dbNum = taosArrayGetSize(pCtx->pNames);
|
|
|
|
int32_t fetchIdx = 0;
|
|
|
|
int32_t fetchIdx = 0;
|
|
|
@ -1805,7 +1809,8 @@ int32_t ctgLaunchGetTbHashsTask(SCtgTask *pTask) {
|
|
|
|
SCtgTaskReq tReq;
|
|
|
|
SCtgTaskReq tReq;
|
|
|
|
tReq.pTask = pTask;
|
|
|
|
tReq.pTask = pTask;
|
|
|
|
tReq.msgIdx = -1;
|
|
|
|
tReq.msgIdx = -1;
|
|
|
|
CTG_ERR_JRET(ctgGetVgInfosFromHashValue(pCtg, &tReq, dbCache->vgCache.vgInfo, pCtx, pReq->dbFName, pReq->pTables, false));
|
|
|
|
CTG_ERR_JRET(
|
|
|
|
|
|
|
|
ctgGetVgInfosFromHashValue(pCtg, &tReq, dbCache->vgCache.vgInfo, pCtx, pReq->dbFName, pReq->pTables, false));
|
|
|
|
|
|
|
|
|
|
|
|
ctgReleaseVgInfoToCache(pCtg, dbCache);
|
|
|
|
ctgReleaseVgInfoToCache(pCtg, dbCache);
|
|
|
|
dbCache = NULL;
|
|
|
|
dbCache = NULL;
|
|
|
@ -1833,7 +1838,7 @@ int32_t ctgLaunchGetTbHashsTask(SCtgTask *pTask) {
|
|
|
|
for (int32_t i = 0; i < pCtx->fetchNum; ++i) {
|
|
|
|
for (int32_t i = 0; i < pCtx->fetchNum; ++i) {
|
|
|
|
SCtgFetch* pFetch = taosArrayGet(pCtx->pFetchs, i);
|
|
|
|
SCtgFetch* pFetch = taosArrayGet(pCtx->pFetchs, i);
|
|
|
|
STablesReq* pReq = taosArrayGet(pCtx->pNames, pFetch->dbIdx);
|
|
|
|
STablesReq* pReq = taosArrayGet(pCtx->pNames, pFetch->dbIdx);
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, i);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, i);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1858,15 +1863,14 @@ _return:
|
|
|
|
return code;
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetTbIndexTask(SCtgTask* pTask) {
|
|
|
|
int32_t ctgLaunchGetTbIndexTask(SCtgTask *pTask) {
|
|
|
|
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgTbIndexCtx* pCtx = (SCtgTbIndexCtx*)pTask->taskCtx;
|
|
|
|
SCtgTbIndexCtx* pCtx = (SCtgTbIndexCtx*)pTask->taskCtx;
|
|
|
|
SArray* pRes = NULL;
|
|
|
|
SArray* pRes = NULL;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1883,7 +1887,7 @@ int32_t ctgLaunchGetTbIndexTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetTbCfgTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetTbCfgTask(SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
@ -1892,7 +1896,7 @@ int32_t ctgLaunchGetTbCfgTask(SCtgTask *pTask) {
|
|
|
|
char dbFName[TSDB_DB_FNAME_LEN];
|
|
|
|
char dbFName[TSDB_DB_FNAME_LEN];
|
|
|
|
tNameGetFullDbName(pCtx->pName, dbFName);
|
|
|
|
tNameGetFullDbName(pCtx->pName, dbFName);
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1930,12 +1934,11 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetQnodeTask(SCtgTask* pTask) {
|
|
|
|
int32_t ctgLaunchGetQnodeTask(SCtgTask *pTask) {
|
|
|
|
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1944,11 +1947,11 @@ int32_t ctgLaunchGetQnodeTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetDnodeTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetDnodeTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1957,13 +1960,12 @@ int32_t ctgLaunchGetDnodeTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetDbCfgTask(SCtgTask* pTask) {
|
|
|
|
int32_t ctgLaunchGetDbCfgTask(SCtgTask *pTask) {
|
|
|
|
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgDbCfgCtx* pCtx = (SCtgDbCfgCtx*)pTask->taskCtx;
|
|
|
|
SCtgDbCfgCtx* pCtx = (SCtgDbCfgCtx*)pTask->taskCtx;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1973,13 +1975,13 @@ int32_t ctgLaunchGetDbCfgTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetDbInfoTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetDbInfoTask(SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCtgDBCache *dbCache = NULL;
|
|
|
|
SCtgDBCache* dbCache = NULL;
|
|
|
|
SCtgDbInfoCtx* pCtx = (SCtgDbInfoCtx*)pTask->taskCtx;
|
|
|
|
SCtgDbInfoCtx* pCtx = (SCtgDbInfoCtx*)pTask->taskCtx;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2013,12 +2015,12 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetIndexTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetIndexTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgIndexCtx* pCtx = (SCtgIndexCtx*)pTask->taskCtx;
|
|
|
|
SCtgIndexCtx* pCtx = (SCtgIndexCtx*)pTask->taskCtx;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2028,12 +2030,12 @@ int32_t ctgLaunchGetIndexTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetUdfTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetUdfTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgUdfCtx* pCtx = (SCtgUdfCtx*)pTask->taskCtx;
|
|
|
|
SCtgUdfCtx* pCtx = (SCtgUdfCtx*)pTask->taskCtx;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2043,14 +2045,14 @@ int32_t ctgLaunchGetUdfTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetUserTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetUserTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgUserCtx* pCtx = (SCtgUserCtx*)pTask->taskCtx;
|
|
|
|
SCtgUserCtx* pCtx = (SCtgUserCtx*)pTask->taskCtx;
|
|
|
|
bool inCache = false;
|
|
|
|
bool inCache = false;
|
|
|
|
bool pass = false;
|
|
|
|
bool pass = false;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2072,11 +2074,11 @@ int32_t ctgLaunchGetUserTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchGetSvrVerTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgLaunchGetSvrVerTask(SCtgTask* pTask) {
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SCatalog* pCtg = pTask->pJob->pCtg;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SRequestConnInfo* pConn = &pTask->pJob->conn;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
if (NULL == pMsgCtx->pBatchs) {
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pJob->pBatchs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2086,7 +2088,7 @@ int32_t ctgLaunchGetSvrVerTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgRelaunchGetTbMetaTask(SCtgTask *pTask) {
|
|
|
|
int32_t ctgRelaunchGetTbMetaTask(SCtgTask* pTask) {
|
|
|
|
ctgResetTbMetaTask(pTask);
|
|
|
|
ctgResetTbMetaTask(pTask);
|
|
|
|
|
|
|
|
|
|
|
|
CTG_ERR_RET(ctgLaunchGetTbMetaTask(pTask));
|
|
|
|
CTG_ERR_RET(ctgLaunchGetTbMetaTask(pTask));
|
|
|
@ -2094,7 +2096,7 @@ int32_t ctgRelaunchGetTbMetaTask(SCtgTask *pTask) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgGetTbCfgCb(SCtgTask *pTask) {
|
|
|
|
int32_t ctgGetTbCfgCb(SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
|
|
|
|
|
|
|
|
CTG_ERR_JRET(pTask->subRes.code);
|
|
|
|
CTG_ERR_JRET(pTask->subRes.code);
|
|
|
@ -2124,7 +2126,6 @@ int32_t ctgCompDbVgTasks(SCtgTask* pTask, void* param, bool* equal) {
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgCompTbMetaTasks(SCtgTask* pTask, void* param, bool* equal) {
|
|
|
|
int32_t ctgCompTbMetaTasks(SCtgTask* pTask, void* param, bool* equal) {
|
|
|
|
SCtgTbMetaCtx* ctx = pTask->taskCtx;
|
|
|
|
SCtgTbMetaCtx* ctx = pTask->taskCtx;
|
|
|
|
|
|
|
|
|
|
|
@ -2145,14 +2146,14 @@ int32_t ctgCloneDbVg(SCtgTask* pTask, void** pRes) {
|
|
|
|
CTG_RET(cloneDbVgInfo(pOut->dbVgroup, (SDBVgInfo**)pRes));
|
|
|
|
CTG_RET(cloneDbVgInfo(pOut->dbVgroup, (SDBVgInfo**)pRes));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCtgAsyncFps gCtgAsyncFps[] = {
|
|
|
|
SCtgAsyncFps gCtgAsyncFps[] = {
|
|
|
|
{ctgInitGetQnodeTask, ctgLaunchGetQnodeTask, ctgHandleGetQnodeRsp, ctgDumpQnodeRes, NULL, NULL},
|
|
|
|
{ctgInitGetQnodeTask, ctgLaunchGetQnodeTask, ctgHandleGetQnodeRsp, ctgDumpQnodeRes, NULL, NULL},
|
|
|
|
{ctgInitGetDnodeTask, ctgLaunchGetDnodeTask, ctgHandleGetDnodeRsp, ctgDumpDnodeRes, NULL, NULL},
|
|
|
|
{ctgInitGetDnodeTask, ctgLaunchGetDnodeTask, ctgHandleGetDnodeRsp, ctgDumpDnodeRes, NULL, NULL},
|
|
|
|
{ctgInitGetDbVgTask, ctgLaunchGetDbVgTask, ctgHandleGetDbVgRsp, ctgDumpDbVgRes, ctgCompDbVgTasks, ctgCloneDbVg},
|
|
|
|
{ctgInitGetDbVgTask, ctgLaunchGetDbVgTask, ctgHandleGetDbVgRsp, ctgDumpDbVgRes, ctgCompDbVgTasks, ctgCloneDbVg},
|
|
|
|
{ctgInitGetDbCfgTask, ctgLaunchGetDbCfgTask, ctgHandleGetDbCfgRsp, ctgDumpDbCfgRes, NULL, NULL},
|
|
|
|
{ctgInitGetDbCfgTask, ctgLaunchGetDbCfgTask, ctgHandleGetDbCfgRsp, ctgDumpDbCfgRes, NULL, NULL},
|
|
|
|
{ctgInitGetDbInfoTask, ctgLaunchGetDbInfoTask, ctgHandleGetDbInfoRsp, ctgDumpDbInfoRes, NULL, NULL},
|
|
|
|
{ctgInitGetDbInfoTask, ctgLaunchGetDbInfoTask, ctgHandleGetDbInfoRsp, ctgDumpDbInfoRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbMetaTask, ctgLaunchGetTbMetaTask, ctgHandleGetTbMetaRsp, ctgDumpTbMetaRes, ctgCompTbMetaTasks, ctgCloneTbMeta},
|
|
|
|
{ctgInitGetTbMetaTask, ctgLaunchGetTbMetaTask, ctgHandleGetTbMetaRsp, ctgDumpTbMetaRes, ctgCompTbMetaTasks,
|
|
|
|
|
|
|
|
ctgCloneTbMeta},
|
|
|
|
{ctgInitGetTbHashTask, ctgLaunchGetTbHashTask, ctgHandleGetTbHashRsp, ctgDumpTbHashRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbHashTask, ctgLaunchGetTbHashTask, ctgHandleGetTbHashRsp, ctgDumpTbHashRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbIndexTask, ctgLaunchGetTbIndexTask, ctgHandleGetTbIndexRsp, ctgDumpTbIndexRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbIndexTask, ctgLaunchGetTbIndexTask, ctgHandleGetTbIndexRsp, ctgDumpTbIndexRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbCfgTask, ctgLaunchGetTbCfgTask, ctgHandleGetTbCfgRsp, ctgDumpTbCfgRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbCfgTask, ctgLaunchGetTbCfgTask, ctgHandleGetTbCfgRsp, ctgDumpTbCfgRes, NULL, NULL},
|
|
|
@ -2164,19 +2165,19 @@ SCtgAsyncFps gCtgAsyncFps[] = {
|
|
|
|
{ctgInitGetTbHashsTask, ctgLaunchGetTbHashsTask, ctgHandleGetTbHashsRsp, ctgDumpTbHashsRes, NULL, NULL},
|
|
|
|
{ctgInitGetTbHashsTask, ctgLaunchGetTbHashsTask, ctgHandleGetTbHashsRsp, ctgDumpTbHashsRes, NULL, NULL},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgMakeAsyncRes(SCtgJob *pJob) {
|
|
|
|
int32_t ctgMakeAsyncRes(SCtgJob* pJob) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t taskNum = taosArrayGetSize(pJob->pTasks);
|
|
|
|
int32_t taskNum = taosArrayGetSize(pJob->pTasks);
|
|
|
|
|
|
|
|
|
|
|
|
for (int32_t i = 0; i < taskNum; ++i) {
|
|
|
|
for (int32_t i = 0; i < taskNum; ++i) {
|
|
|
|
SCtgTask *pTask = taosArrayGet(pJob->pTasks, i);
|
|
|
|
SCtgTask* pTask = taosArrayGet(pJob->pTasks, i);
|
|
|
|
CTG_ERR_RET((*gCtgAsyncFps[pTask->type].dumpResFp)(pTask));
|
|
|
|
CTG_ERR_RET((*gCtgAsyncFps[pTask->type].dumpResFp)(pTask));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgSearchExistingTask(SCtgJob *pJob, CTG_TASK_TYPE type, void* param, int32_t* taskId) {
|
|
|
|
int32_t ctgSearchExistingTask(SCtgJob* pJob, CTG_TASK_TYPE type, void* param, int32_t* taskId) {
|
|
|
|
bool equal = false;
|
|
|
|
bool equal = false;
|
|
|
|
SCtgTask* pTask = NULL;
|
|
|
|
SCtgTask* pTask = NULL;
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
@ -2206,15 +2207,15 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgSetSubTaskCb(SCtgTask *pSub, SCtgTask *pTask) {
|
|
|
|
int32_t ctgSetSubTaskCb(SCtgTask* pSub, SCtgTask* pTask) {
|
|
|
|
int32_t code = 0;
|
|
|
|
int32_t code = 0;
|
|
|
|
|
|
|
|
|
|
|
|
CTG_LOCK(CTG_WRITE, &pSub->lock);
|
|
|
|
CTG_LOCK(CTG_WRITE, &pSub->lock);
|
|
|
|
if (CTG_TASK_DONE == pSub->status) {
|
|
|
|
if (CTG_TASK_DONE == pSub->status) {
|
|
|
|
pTask->subRes.code = pSub->code;
|
|
|
|
pTask->subRes.code = pSub->code;
|
|
|
|
CTG_ERR_JRET((*gCtgAsyncFps[pTask->type].cloneFp)(pSub, &pTask->subRes.res));
|
|
|
|
CTG_ERR_JRET((*gCtgAsyncFps[pTask->type].cloneFp)(pSub, &pTask->subRes.res));
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx *pSubMsgCtx = CTG_GET_TASK_MSGCTX(pSub, -1);
|
|
|
|
SCtgMsgCtx* pSubMsgCtx = CTG_GET_TASK_MSGCTX(pSub, -1);
|
|
|
|
pMsgCtx->pBatchs = pSubMsgCtx->pBatchs;
|
|
|
|
pMsgCtx->pBatchs = pSubMsgCtx->pBatchs;
|
|
|
|
|
|
|
|
|
|
|
|
CTG_ERR_JRET(pTask->subRes.fp(pTask));
|
|
|
|
CTG_ERR_JRET(pTask->subRes.fp(pTask));
|
|
|
@ -2233,8 +2234,7 @@ _return:
|
|
|
|
CTG_RET(code);
|
|
|
|
CTG_RET(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchSubTask(SCtgTask* pTask, CTG_TASK_TYPE type, ctgSubTaskCbFp fp, void* param) {
|
|
|
|
int32_t ctgLaunchSubTask(SCtgTask *pTask, CTG_TASK_TYPE type, ctgSubTaskCbFp fp, void* param) {
|
|
|
|
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
SCtgJob* pJob = pTask->pJob;
|
|
|
|
int32_t subTaskId = -1;
|
|
|
|
int32_t subTaskId = -1;
|
|
|
|
bool newTask = false;
|
|
|
|
bool newTask = false;
|
|
|
@ -2254,8 +2254,8 @@ int32_t ctgLaunchSubTask(SCtgTask *pTask, CTG_TASK_TYPE type, ctgSubTaskCbFp fp,
|
|
|
|
CTG_ERR_RET(ctgSetSubTaskCb(pSub, pTask));
|
|
|
|
CTG_ERR_RET(ctgSetSubTaskCb(pSub, pTask));
|
|
|
|
|
|
|
|
|
|
|
|
if (newTask) {
|
|
|
|
if (newTask) {
|
|
|
|
SCtgMsgCtx *pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
|
|
|
SCtgMsgCtx *pSubMsgCtx = CTG_GET_TASK_MSGCTX(pSub, -1);
|
|
|
|
SCtgMsgCtx* pSubMsgCtx = CTG_GET_TASK_MSGCTX(pSub, -1);
|
|
|
|
pSubMsgCtx->pBatchs = pMsgCtx->pBatchs;
|
|
|
|
pSubMsgCtx->pBatchs = pMsgCtx->pBatchs;
|
|
|
|
|
|
|
|
|
|
|
|
CTG_ERR_RET((*gCtgAsyncFps[pSub->type].launchFp)(pSub));
|
|
|
|
CTG_ERR_RET((*gCtgAsyncFps[pSub->type].launchFp)(pSub));
|
|
|
@ -2265,11 +2265,11 @@ int32_t ctgLaunchSubTask(SCtgTask *pTask, CTG_TASK_TYPE type, ctgSubTaskCbFp fp,
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ctgLaunchJob(SCtgJob *pJob) {
|
|
|
|
int32_t ctgLaunchJob(SCtgJob* pJob) {
|
|
|
|
int32_t taskNum = taosArrayGetSize(pJob->pTasks);
|
|
|
|
int32_t taskNum = taosArrayGetSize(pJob->pTasks);
|
|
|
|
|
|
|
|
|
|
|
|
for (int32_t i = 0; i < taskNum; ++i) {
|
|
|
|
for (int32_t i = 0; i < taskNum; ++i) {
|
|
|
|
SCtgTask *pTask = taosArrayGet(pJob->pTasks, i);
|
|
|
|
SCtgTask* pTask = taosArrayGet(pJob->pTasks, i);
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("QID:0x%" PRIx64 " ctg launch [%dth] task", pJob->queryId, pTask->taskId);
|
|
|
|
qDebug("QID:0x%" PRIx64 " ctg launch [%dth] task", pJob->queryId, pTask->taskId);
|
|
|
|
CTG_ERR_RET((*gCtgAsyncFps[pTask->type].launchFp)(pTask));
|
|
|
|
CTG_ERR_RET((*gCtgAsyncFps[pTask->type].launchFp)(pTask));
|
|
|
@ -2289,6 +2289,3 @@ int32_t ctgLaunchJob(SCtgJob *pJob) {
|
|
|
|
|
|
|
|
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
return TSDB_CODE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|