From 0d7de8f433f91454af255cd9e987e96eff8f7f86 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 2 Dec 2020 09:28:26 +0800 Subject: [PATCH] Revert "TD-1843" --- src/mnode/src/mnodeMain.c | 3 ++- src/rpc/src/rpcMain.c | 17 ++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/mnode/src/mnodeMain.c b/src/mnode/src/mnodeMain.c index b4c63c05e6..05ea0b93a1 100644 --- a/src/mnode/src/mnodeMain.c +++ b/src/mnode/src/mnodeMain.c @@ -55,6 +55,7 @@ typedef struct { } SMnodeComponent; void *tsMnodeTmr = NULL; +static bool tsMgmtIsRunning = false; static EMndStatus tsMgmtStatus = TSDB_MND_STATUS_NOT_RUNNING; static const SMnodeComponent tsMnodeComponents[] = { @@ -138,7 +139,7 @@ int32_t mnodeInitSystem() { } void mnodeCleanupSystem() { - if (mnodeIsRunning()) { + if (tsMgmtIsRunning) { mInfo("starting to clean up mnode"); tsMgmtStatus = TSDB_MND_STATUS_CLEANING; diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index c8f6a031d0..044fe8c204 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -1559,18 +1559,13 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) { if ( !rpcIsReq(pHead->msgType) ) { // for response, if code is auth failure, it shall bypass the auth process code = htonl(pHead->code); -#if 0 - if (code != 0) { -#else - if (code == TSDB_CODE_RPC_INVALID_TIME_STAMP || code == TSDB_CODE_RPC_AUTH_FAILURE || - code == TSDB_CODE_RPC_AUTH_REQUIRED || code == TSDB_CODE_MND_INVALID_USER || code == TSDB_CODE_RPC_NOT_READY) { -#endif - // tTrace("%s, dont check authentication since code is:0x%x", pConn->info, code); - pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen); - return 0; + if (code != 0) { + // tTrace("%s, dont check authentication since code is:0x%x", pConn->info, code); + pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen); + return 0; + } } - } - + code = 0; if (pHead->spi == pConn->spi) { // authentication