chore: more code

This commit is contained in:
kailixu 2023-07-19 15:30:14 +08:00
parent 9da0df1469
commit a04ba65817
7 changed files with 22 additions and 7 deletions

View File

@ -87,6 +87,10 @@ extern int64_t tsMndLogRetention;
extern int8_t tsGrant;
extern bool tsMndSkipGrant;
// dnode
extern int64_t tsDndStart;
extern int64_t tsDndUpTime;
// monitor
extern bool tsEnableMonitor;
extern int32_t tsMonitorInterval;

View File

@ -79,6 +79,10 @@ int64_t tsMndLogRetention = 2000;
int8_t tsGrant = 1;
bool tsMndSkipGrant = false;
// dnode
int64_t tsDndStart = 0;
int64_t tsDndUpTime = 0;
// monitor
bool tsEnableMonitor = true;
int32_t tsMonitorInterval = 30;

View File

@ -373,6 +373,7 @@ int mainWindows(int argc, char **argv) {
dInfo("start to init service");
dmSetSignalHandle();
tsDndStart = taosGetTimestampMs();
int32_t code = dmRun();
dInfo("shutting down the service");

View File

@ -29,6 +29,7 @@ static void *dmStatusThreadFp(void *param) {
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
int64_t curTime = taosGetTimestampMs();
int64_t cost = 0;
float interval = (curTime - lastTime) / 1000.0f;
if (interval >= tsStatusInterval) {
dmSendStatusReq(pMgmt);
@ -38,7 +39,10 @@ static void *dmStatusThreadFp(void *param) {
if (trimCount == 0) {
taosMemoryTrim(0);
}
cost = taosGetTimestampMs() - curTime;
}
tsDndUpTime += 200;
if (cost > 0) tsDndUpTime += cost;
}
return NULL;

View File

@ -156,6 +156,7 @@ static void mndPullupTelem(SMnode *pMnode) {
static void mndPullupGrant(SMnode *pMnode) {
mTrace("pullup grant msg");
printf("%s:%d @@@@@@@@@@@ mndPullupGrant @@@@@@@@@@@ %d \n", __func__, __LINE__, taosGetTimestampSec());
int32_t contLen = 0;
void *pReq = mndBuildTimerMsg(&contLen);
if (pReq != NULL) {
@ -248,8 +249,9 @@ static void *mndThreadFp(void *param) {
setThreadName("mnode-timer");
while (1) {
printf("%s:%d =========== mndThreadFp =========== %d\n", __func__, __LINE__, taosGetTimestampSec());
lastTime++;
taosMsleep(100);
taosMsleep(300);
if (mndGetStop(pMnode)) break;
if (lastTime % 10 != 0) continue;

View File

@ -773,12 +773,6 @@ int32_t ctgGetCachedStbNameFromSuid(SCatalog* pCtg, char* dbFName, uint64_t suid
int32_t ctgChkAuthFromCache(SCatalog *pCtg, SUserAuthInfo *pReq, bool *inCache, SCtgAuthRsp *pRes) {
int32_t code = 0;
if (IS_SYS_DBNAME(pReq->tbName.dbname)) {
*inCache = true;
pRes->pRawRes->pass = true;
ctgDebug("sysdb %s, pass", pReq->tbName.dbname);
return TSDB_CODE_SUCCESS;
}
SCtgUserAuth *pUser = (SCtgUserAuth *)taosHashGet(pCtg->userCache, pReq->user, strlen(pReq->user));
if (NULL == pUser) {

View File

@ -1589,6 +1589,12 @@ int32_t ctgChkSetAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
return TSDB_CODE_SUCCESS;
}
if (IS_SYS_DBNAME(pReq->tbName.dbname)) {
pRes->pass = true;
ctgDebug("sysdb %s, pass", pReq->tbName.dbname);
return TSDB_CODE_SUCCESS;
}
char dbFName[TSDB_DB_FNAME_LEN];
tNameGetFullDbName(&pReq->tbName, dbFName);