enh: erase dup notification

This commit is contained in:
kailixu 2023-09-21 16:12:46 +08:00
parent 677e938851
commit be3438fc5b
3 changed files with 22 additions and 8 deletions

View File

@ -151,6 +151,7 @@ typedef struct STscObj {
char sDetailVer[128];
int8_t sysInfo;
int8_t connType;
int8_t dropped;
int32_t acctId;
uint32_t connId;
int64_t id; // ref ID returned by taosAddRef

View File

@ -96,7 +96,8 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat
}
}
if (pRsp->dropped == 1) {
if (pRsp->dropped == 1 && pTscObj->dropped == 0) {
pTscObj->dropped = 1;
if (pTscObj->userDroppedInfo.fp) {
SPassInfo *dropInfo = &pTscObj->userDroppedInfo;
if (dropInfo->fp) {
@ -779,6 +780,16 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
SHbParam *hbParam = (SHbParam *)param;
SCatalog *pCatalog = NULL;
STscObj *pTscObj = (STscObj *)acquireTscObj(connKey->tscRid);
if (!pTscObj) {
tscWarn("tscObj rid %" PRIx64 " not exist", connKey->tscRid);
return TSDB_CODE_APP_ERROR;
} else if (pTscObj->dropped) {
tscDebug("tscObj rid %" PRIx64 " user:%s dropped", connKey->tscRid, pTscObj->user);
releaseTscObj(connKey->tscRid);
return TSDB_CODE_SUCCESS;
}
if (hbParam->reqCnt == 0) {
code = catalogGetHandle(hbParam->clusterId, &pCatalog);
if (code != TSDB_CODE_SUCCESS) {

View File

@ -298,11 +298,12 @@ void passVerTestMulti(const char *host, char *qstr) {
}
fprintf(stderr, "######## %s #########\n", __func__);
if (nPassVerNotified >= nConn) {
fprintf(stderr, ">>> succeed to get passVer notification since nNotify %d >= nConn %d\n", nPassVerNotified,
if (nPassVerNotified == nConn) {
fprintf(stderr, ">>> succeed to get passVer notification since nNotify %d == nConn %d\n", nPassVerNotified,
nConn);
} else {
fprintf(stderr, ">>> failed to get passVer notification since nNotify %d < nConn %d\n", nPassVerNotified, nConn);
fprintf(stderr, ">>> failed to get passVer notification since nNotify %d != nConn %d\n", nPassVerNotified, nConn);
exit(1);
}
fprintf(stderr, "######## %s #########\n", __func__);
// sleep(300);
@ -416,7 +417,7 @@ void userDroppedTest(TAOS *taos, const char *host, char *qstr) {
int nConn = nTestUsers;
for (int i = 0; i < 15; ++i) {
printf("%s:%d [%d] second(s) elasped, passVer notification received:%d, total:%d\n", __func__, __LINE__, i,
printf("%s:%d [%d] second(s) elasped, user dropped notification received:%d, total:%d\n", __func__, __LINE__, i,
nUserDropped, nConn);
if (nUserDropped >= nConn) break;
sleep(1);
@ -429,10 +430,11 @@ void userDroppedTest(TAOS *taos, const char *host, char *qstr) {
}
fprintf(stderr, "######## %s #########\n", __func__);
if (nUserDropped >= nConn) {
fprintf(stderr, ">>> succeed to get user dropped notification since nNotify %d >= nConn %d\n", nUserDropped, nConn);
if (nUserDropped == nConn) {
fprintf(stderr, ">>> succeed to get user dropped notification since nNotify %d == nConn %d\n", nUserDropped, nConn);
} else {
fprintf(stderr, ">>> failed to get user dropped notification since nNotify %d < nConn %d\n", nUserDropped, nConn);
fprintf(stderr, ">>> failed to get user dropped notification since nNotify %d != nConn %d\n", nUserDropped, nConn);
exit(1);
}
fprintf(stderr, "######## %s #########\n", __func__);
// sleep(300);