提交 3f96f0ed 编写于 作者: A Alex Duan

feat(mnode): modify keyword status to alive, conflict with log.dn fields

上级 0912aa64
......@@ -4099,7 +4099,7 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SShowInfo* pShowInfo = &pInfo->pMiscInfo->showOpt;
int16_t showType = pShowInfo->showType;
if (showType == TSDB_MGMT_TABLE_TABLE || showType == TSDB_MGMT_TABLE_METRIC || showType == TSDB_MGMT_TABLE_VGROUP ||
showType == TSDB_MGMT_STATUS_DB) {
showType == TSDB_MGMT_ALIVE_DB) {
// db prefix in tagCond, show table conds in payload
SStrToken* pDbPrefixToken = &pShowInfo->prefix;
if (pDbPrefixToken->type != 0) {
......
......@@ -163,8 +163,8 @@ enum _mgmt_table {
TSDB_MGMT_TABLE_CLUSTER,
TSDB_MGMT_TABLE_TP,
TSDB_MGMT_TABLE_FUNCTION,
TSDB_MGMT_STATUS_DB, // show database status
TSDB_MGMT_STATUS_CLUSTER, // show cluster status
TSDB_MGMT_ALIVE_DB, // show database status
TSDB_MGMT_ALIVE_CLUSTER, // show cluster status
TSDB_MGMT_TABLE_MAX,
};
......
......@@ -88,7 +88,7 @@
#define TK_TABLES 70
#define TK_STABLES 71
#define TK_VGROUPS 72
#define TK_STATUS 73
#define TK_ALIVE 73
#define TK_CLUSTER 74
#define TK_DROP 75
#define TK_TOPIC 76
......
......@@ -110,8 +110,8 @@ static char *mnodeGetShowType(int32_t showType) {
case TSDB_MGMT_TABLE_CLUSTER: return "show clusters";
case TSDB_MGMT_TABLE_STREAMTABLES : return "show streamtables";
case TSDB_MGMT_TABLE_TP: return "show topics";
case TSDB_MGMT_STATUS_DB: return "show database status";
case TSDB_MGMT_STATUS_CLUSTER: return "show cluster status";
case TSDB_MGMT_ALIVE_DB: return "show database status";
case TSDB_MGMT_ALIVE_CLUSTER: return "show cluster status";
default: return "undefined";
}
}
......
......@@ -59,9 +59,9 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup);
static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pConn);
// status
static int32_t mnodeGetStatusMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
static int32_t mnodeRetrieveStatusDb(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static int32_t mnodeRetrieveStatusCluster(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static int32_t mnodeGetAliveMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
static int32_t mnodeRetrieveAliveDb(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static int32_t mnodeRetrieveAliveCluster(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg);
static void mnodeProcessAlterVnodeRsp(SRpcMsg *rpcMsg);
......@@ -241,13 +241,13 @@ int32_t mnodeInitVgroups() {
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mnodeRetrieveVgroups);
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_VGROUP, mnodeCancelGetNextVgroup);
// cluster status
mnodeAddShowMetaHandle(TSDB_MGMT_STATUS_CLUSTER, mnodeGetStatusMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_STATUS_CLUSTER, mnodeRetrieveStatusCluster);
mnodeAddShowFreeIterHandle(TSDB_MGMT_STATUS_CLUSTER, mnodeCancelGetNextVgroup);
mnodeAddShowMetaHandle(TSDB_MGMT_ALIVE_CLUSTER, mnodeGetAliveMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_ALIVE_CLUSTER, mnodeRetrieveAliveCluster);
mnodeAddShowFreeIterHandle(TSDB_MGMT_ALIVE_CLUSTER, mnodeCancelGetNextVgroup);
// db status
mnodeAddShowMetaHandle(TSDB_MGMT_STATUS_DB, mnodeGetStatusMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_STATUS_DB, mnodeRetrieveStatusDb);
mnodeAddShowFreeIterHandle(TSDB_MGMT_STATUS_DB, mnodeCancelGetNextVgroup);
mnodeAddShowMetaHandle(TSDB_MGMT_ALIVE_DB, mnodeGetAliveMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_ALIVE_DB, mnodeRetrieveAliveDb);
mnodeAddShowFreeIterHandle(TSDB_MGMT_ALIVE_DB, mnodeCancelGetNextVgroup);
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mnodeProcessCreateVnodeRsp);
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP, mnodeProcessAlterVnodeRsp);
......@@ -793,7 +793,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
return 0;
}
static int32_t mnodeGetStatusMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
static int32_t mnodeGetAliveMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
SSchema *pSchema = pMeta->schema;
pShow->bytes[0] = sizeof(int32_t);
pSchema[0].type = TSDB_DATA_TYPE_INT;
......@@ -808,7 +808,7 @@ static int32_t mnodeGetStatusMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
return 0;
}
static int32_t mnodeRetrieveStatus(SShowObj *pShow, char *data, int32_t rows, void *pConn, SDbObj* pDb) {
static int32_t mnodeRetrieveAlive(SShowObj *pShow, char *data, int32_t rows, void *pConn, SDbObj* pDb) {
SVgObj *pVgroup = NULL;
int32_t nAvailble = 0;
int32_t nUnAvailble = 0;
......@@ -865,11 +865,11 @@ static int32_t mnodeRetrieveStatus(SShowObj *pShow, char *data, int32_t rows, vo
return 1;
}
static int32_t mnodeRetrieveStatusCluster(SShowObj *pShow, char *data, int32_t rows, void *pConn) {
return mnodeRetrieveStatus(pShow, data, rows, pConn, NULL);
static int32_t mnodeRetrieveAliveCluster(SShowObj *pShow, char *data, int32_t rows, void *pConn) {
return mnodeRetrieveAlive(pShow, data, rows, pConn, NULL);
}
static int32_t mnodeRetrieveStatusDb(SShowObj *pShow, char *data, int32_t rows, void *pConn) {
static int32_t mnodeRetrieveAliveDb(SShowObj *pShow, char *data, int32_t rows, void *pConn) {
SDbObj *pDb = mnodeGetDb(pShow->db);
if (pDb == NULL) return 0;
......@@ -880,7 +880,7 @@ static int32_t mnodeRetrieveStatusDb(SShowObj *pShow, char *data, int32_t rows,
return 0;
}
int32_t numOfRows = mnodeRetrieveStatus(pShow, data, rows, pConn, pDb);
int32_t numOfRows = mnodeRetrieveAlive(pShow, data, rows, pConn, pDb);
mnodeDecDbRef(pDb);
return numOfRows;
......
......@@ -127,17 +127,17 @@ cmd ::= SHOW dbPrefix(X) VGROUPS. {
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
// show db.status
cmd ::= SHOW dbPrefix(X) STATUS. {
// show db.alive
cmd ::= SHOW dbPrefix(X) ALIVE. {
SStrToken token;
tSetDbName(&token, &X);
setShowOptions(pInfo, TSDB_MGMT_STATUS_DB, &token, 0);
setShowOptions(pInfo, TSDB_MGMT_ALIVE_DB, &token, 0);
}
// show cluster status
cmd ::= SHOW CLUSTER STATUS. {
// show cluster alive
cmd ::= SHOW CLUSTER ALIVE. {
SStrToken token;
setShowOptions(pInfo, TSDB_MGMT_STATUS_CLUSTER, &token, 0);
setShowOptions(pInfo, TSDB_MGMT_ALIVE_CLUSTER, &token, 0);
}
//drop configure for tables
......
......@@ -632,7 +632,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* TABLES => nothing */
0, /* STABLES => nothing */
0, /* VGROUPS => nothing */
0, /* STATUS => nothing */
0, /* ALIVE => nothing */
1, /* CLUSTER => ID */
0, /* DROP => nothing */
0, /* TOPIC => nothing */
......@@ -925,7 +925,7 @@ static const char *const yyTokenName[] = {
/* 70 */ "TABLES",
/* 71 */ "STABLES",
/* 72 */ "VGROUPS",
/* 73 */ "STATUS",
/* 73 */ "ALIVE",
/* 74 */ "CLUSTER",
/* 75 */ "DROP",
/* 76 */ "TOPIC",
......@@ -1182,8 +1182,8 @@ static const char *const yyRuleName[] = {
/* 26 */ "cmd ::= SHOW dbPrefix STABLES",
/* 27 */ "cmd ::= SHOW dbPrefix STABLES LIKE STRING",
/* 28 */ "cmd ::= SHOW dbPrefix VGROUPS",
/* 29 */ "cmd ::= SHOW dbPrefix STATUS",
/* 30 */ "cmd ::= SHOW CLUSTER STATUS",
/* 29 */ "cmd ::= SHOW dbPrefix ALIVE",
/* 30 */ "cmd ::= SHOW CLUSTER ALIVE",
/* 31 */ "cmd ::= DROP TABLE ifexists ids cpxName",
/* 32 */ "cmd ::= DROP STABLE ifexists ids cpxName",
/* 33 */ "cmd ::= DROP DATABASE ifexists ids",
......@@ -1978,8 +1978,8 @@ static const struct {
{ 209, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */
{ 209, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE STRING */
{ 209, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
{ 209, -3 }, /* (29) cmd ::= SHOW dbPrefix STATUS */
{ 209, -3 }, /* (30) cmd ::= SHOW CLUSTER STATUS */
{ 209, -3 }, /* (29) cmd ::= SHOW dbPrefix ALIVE */
{ 209, -3 }, /* (30) cmd ::= SHOW CLUSTER ALIVE */
{ 209, -5 }, /* (31) cmd ::= DROP TABLE ifexists ids cpxName */
{ 209, -5 }, /* (32) cmd ::= DROP STABLE ifexists ids cpxName */
{ 209, -4 }, /* (33) cmd ::= DROP DATABASE ifexists ids */
......@@ -2473,17 +2473,17 @@ static void yy_reduce(
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
break;
case 29: /* cmd ::= SHOW dbPrefix STATUS */
case 29: /* cmd ::= SHOW dbPrefix ALIVE */
{
SStrToken token;
tSetDbName(&token, &yymsp[-1].minor.yy0);
setShowOptions(pInfo, TSDB_MGMT_STATUS_DB, &token, 0);
setShowOptions(pInfo, TSDB_MGMT_ALIVE_DB, &token, 0);
}
break;
case 30: /* cmd ::= SHOW CLUSTER STATUS */
case 30: /* cmd ::= SHOW CLUSTER ALIVE */
{
SStrToken token;
setShowOptions(pInfo, TSDB_MGMT_STATUS_CLUSTER, &token, 0);
setShowOptions(pInfo, TSDB_MGMT_ALIVE_CLUSTER, &token, 0);
}
break;
case 31: /* cmd ::= DROP TABLE ifexists ids cpxName */
......
......@@ -230,7 +230,7 @@ static SKeyword keywordTable[] = {
{"CONTAINS", TK_CONTAINS},
{"TO", TK_TO},
{"SPLIT", TK_SPLIT},
{"STATUS", TK_STATUS},
{"ALIVE", TK_ALIVE},
{"CLUSTER", TK_CLUSTER},
{"DELETE", TK_DELETE}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册