[TD-147]
This commit is contained in:
parent
f62e4b957a
commit
b345312f8b
|
@ -345,7 +345,6 @@ typedef struct {
|
||||||
} SMDDropTableMsg;
|
} SMDDropTableMsg;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t contLen;
|
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
int64_t uid;
|
int64_t uid;
|
||||||
char tableId[TSDB_TABLE_ID_LEN + 1];
|
char tableId[TSDB_TABLE_ID_LEN + 1];
|
||||||
|
|
|
@ -756,8 +756,26 @@ static void mgmtProcessCreateSuperTableMsg(SQueuedMsg *pMsg) {
|
||||||
static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) {
|
static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) {
|
||||||
SSuperTableObj *pStable = (SSuperTableObj *)pMsg->pTable;
|
SSuperTableObj *pStable = (SSuperTableObj *)pMsg->pTable;
|
||||||
if (pStable->numOfTables != 0) {
|
if (pStable->numOfTables != 0) {
|
||||||
mError("stable:%s, numOfTables:%d not 0", pStable->info.tableId, pStable->numOfTables);
|
mgmtDropAllChildTablesInStable(pStable);
|
||||||
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_OTHERS);
|
for (int32_t vg = 0; vg < pTable->vgLen; ++vg) {
|
||||||
|
int32_t vgId = pTable->vgList[vg];
|
||||||
|
if (vgId == 0) break;
|
||||||
|
|
||||||
|
SMDDropSTableMsg *pDrop = rpcMalloc(sizeof(SMDDropSTableMsg));
|
||||||
|
pDrop->vgId = htonl(vgId);
|
||||||
|
pDrop->uid = htobe64(pStable->uid);
|
||||||
|
mgmtExtractTableName(pStable->info.tableId, pDrop->tableId);
|
||||||
|
|
||||||
|
SVgObj *pVgroup = mgmtGetVgroup(vgId);
|
||||||
|
if (pVgroup != NULL) {
|
||||||
|
SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup);
|
||||||
|
SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE};
|
||||||
|
mgmtSendMsgToDnode(&ipSet, &rpcMsg);
|
||||||
|
mgmtDecVgroupRef(pVgroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//mError("stable:%s, numOfTables:%d not 0", pStable->info.tableId, pStable->numOfTables);
|
||||||
|
//mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_OTHERS);
|
||||||
} else {
|
} else {
|
||||||
SSdbOper oper = {
|
SSdbOper oper = {
|
||||||
.type = SDB_OPER_GLOBAL,
|
.type = SDB_OPER_GLOBAL,
|
||||||
|
|
|
@ -224,11 +224,10 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
dTrace("pVnode:%p vgId:%d, stable:%s, start to drop", pVnode, pVnode->vgId, pTable->tableId);
|
dTrace("pVnode:%p vgId:%d, stable:%s, start to drop", pVnode, pVnode->vgId, pTable->tableId);
|
||||||
// int64_t uid = htobe64(pTable->uid);
|
|
||||||
|
|
||||||
// TODO: drop stable in vvnode
|
// TODO: drop stable in vvnode
|
||||||
|
//int64_t uid = htobe64(pTable->uid);
|
||||||
//void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode);
|
//void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode);
|
||||||
//rpcRsp.code = tsdbDropSTable(pTsdb, pTable->uid);
|
//rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid);
|
||||||
|
|
||||||
code = TSDB_CODE_SUCCESS;
|
code = TSDB_CODE_SUCCESS;
|
||||||
dTrace("pVnode:%p vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code);
|
dTrace("pVnode:%p vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code);
|
||||||
|
|
Loading…
Reference in New Issue