From 7ee81346e272ab20a3bb66a751b86755149a4c09 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 3 Mar 2021 22:01:43 +0800 Subject: [PATCH 1/2] [TD-3043]: allow monitor db table to be dropped & altered --- src/mnode/src/mnodeTable.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 4fcedd82e3..b1ae118b4b 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -916,11 +916,13 @@ static int32_t mnodeProcessDropTableMsg(SMnodeMsg *pMsg) { return TSDB_CODE_MND_DB_IN_DROPPING; } +#if 0 if (mnodeCheckIsMonitorDB(pMsg->pDb->name, tsMonitorDbName)) { mError("msg:%p, app:%p table:%s, failed to drop table, in monitor database", pMsg, pMsg->rpcMsg.ahandle, pDrop->name); return TSDB_CODE_MND_MONITOR_DB_FORBIDDEN; } +#endif if (pMsg->pTable == NULL) pMsg->pTable = mnodeGetTable(pDrop->name); if (pMsg->pTable == NULL) { @@ -3020,10 +3022,12 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) { return TSDB_CODE_MND_DB_IN_DROPPING; } +#if 0 if (mnodeCheckIsMonitorDB(pMsg->pDb->name, tsMonitorDbName)) { mError("msg:%p, app:%p table:%s, failed to alter table, its log db", pMsg, pMsg->rpcMsg.ahandle, pAlter->tableFname); return TSDB_CODE_MND_MONITOR_DB_FORBIDDEN; } +#endif if (pMsg->pTable == NULL) pMsg->pTable = mnodeGetTable(pAlter->tableFname); if (pMsg->pTable == NULL) { From 60d8315431adc4763dbd3d6d2fca73b054553146 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 3 Mar 2021 22:26:31 +0800 Subject: [PATCH 2/2] monitor: update test cases to allow drop & alter monit tables --- tests/script/general/user/monitor.sim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/script/general/user/monitor.sim b/tests/script/general/user/monitor.sim index fe12df9baa..016848c06d 100644 --- a/tests/script/general/user/monitor.sim +++ b/tests/script/general/user/monitor.sim @@ -15,18 +15,18 @@ print ========== step2 # return -1 #step21: sql drop table log.dn -x step22 - return -1 +# return -1 step22: sql drop user log -x step23 - return -1 +# return -1 step23: print ========== step3 sleep 2000 -sql select * from log.dn -if $rows == 0 then - return -1 -endi +#sql select * from log.dn +#if $rows == 0 then +# return -1 +#endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT