chore: more code
This commit is contained in:
parent
9da0df1469
commit
a04ba65817
|
@ -87,6 +87,10 @@ extern int64_t tsMndLogRetention;
|
||||||
extern int8_t tsGrant;
|
extern int8_t tsGrant;
|
||||||
extern bool tsMndSkipGrant;
|
extern bool tsMndSkipGrant;
|
||||||
|
|
||||||
|
// dnode
|
||||||
|
extern int64_t tsDndStart;
|
||||||
|
extern int64_t tsDndUpTime;
|
||||||
|
|
||||||
// monitor
|
// monitor
|
||||||
extern bool tsEnableMonitor;
|
extern bool tsEnableMonitor;
|
||||||
extern int32_t tsMonitorInterval;
|
extern int32_t tsMonitorInterval;
|
||||||
|
|
|
@ -79,6 +79,10 @@ int64_t tsMndLogRetention = 2000;
|
||||||
int8_t tsGrant = 1;
|
int8_t tsGrant = 1;
|
||||||
bool tsMndSkipGrant = false;
|
bool tsMndSkipGrant = false;
|
||||||
|
|
||||||
|
// dnode
|
||||||
|
int64_t tsDndStart = 0;
|
||||||
|
int64_t tsDndUpTime = 0;
|
||||||
|
|
||||||
// monitor
|
// monitor
|
||||||
bool tsEnableMonitor = true;
|
bool tsEnableMonitor = true;
|
||||||
int32_t tsMonitorInterval = 30;
|
int32_t tsMonitorInterval = 30;
|
||||||
|
|
|
@ -373,6 +373,7 @@ int mainWindows(int argc, char **argv) {
|
||||||
|
|
||||||
dInfo("start to init service");
|
dInfo("start to init service");
|
||||||
dmSetSignalHandle();
|
dmSetSignalHandle();
|
||||||
|
tsDndStart = taosGetTimestampMs();
|
||||||
int32_t code = dmRun();
|
int32_t code = dmRun();
|
||||||
dInfo("shutting down the service");
|
dInfo("shutting down the service");
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ static void *dmStatusThreadFp(void *param) {
|
||||||
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
||||||
|
|
||||||
int64_t curTime = taosGetTimestampMs();
|
int64_t curTime = taosGetTimestampMs();
|
||||||
|
int64_t cost = 0;
|
||||||
float interval = (curTime - lastTime) / 1000.0f;
|
float interval = (curTime - lastTime) / 1000.0f;
|
||||||
if (interval >= tsStatusInterval) {
|
if (interval >= tsStatusInterval) {
|
||||||
dmSendStatusReq(pMgmt);
|
dmSendStatusReq(pMgmt);
|
||||||
|
@ -38,7 +39,10 @@ static void *dmStatusThreadFp(void *param) {
|
||||||
if (trimCount == 0) {
|
if (trimCount == 0) {
|
||||||
taosMemoryTrim(0);
|
taosMemoryTrim(0);
|
||||||
}
|
}
|
||||||
|
cost = taosGetTimestampMs() - curTime;
|
||||||
}
|
}
|
||||||
|
tsDndUpTime += 200;
|
||||||
|
if (cost > 0) tsDndUpTime += cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -156,6 +156,7 @@ static void mndPullupTelem(SMnode *pMnode) {
|
||||||
|
|
||||||
static void mndPullupGrant(SMnode *pMnode) {
|
static void mndPullupGrant(SMnode *pMnode) {
|
||||||
mTrace("pullup grant msg");
|
mTrace("pullup grant msg");
|
||||||
|
printf("%s:%d @@@@@@@@@@@ mndPullupGrant @@@@@@@@@@@ %d \n", __func__, __LINE__, taosGetTimestampSec());
|
||||||
int32_t contLen = 0;
|
int32_t contLen = 0;
|
||||||
void *pReq = mndBuildTimerMsg(&contLen);
|
void *pReq = mndBuildTimerMsg(&contLen);
|
||||||
if (pReq != NULL) {
|
if (pReq != NULL) {
|
||||||
|
@ -248,8 +249,9 @@ static void *mndThreadFp(void *param) {
|
||||||
setThreadName("mnode-timer");
|
setThreadName("mnode-timer");
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
printf("%s:%d =========== mndThreadFp =========== %d\n", __func__, __LINE__, taosGetTimestampSec());
|
||||||
lastTime++;
|
lastTime++;
|
||||||
taosMsleep(100);
|
taosMsleep(300);
|
||||||
if (mndGetStop(pMnode)) break;
|
if (mndGetStop(pMnode)) break;
|
||||||
if (lastTime % 10 != 0) continue;
|
if (lastTime % 10 != 0) continue;
|
||||||
|
|
||||||
|
|
|
@ -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 ctgChkAuthFromCache(SCatalog *pCtg, SUserAuthInfo *pReq, bool *inCache, SCtgAuthRsp *pRes) {
|
||||||
int32_t code = 0;
|
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));
|
SCtgUserAuth *pUser = (SCtgUserAuth *)taosHashGet(pCtg->userCache, pReq->user, strlen(pReq->user));
|
||||||
if (NULL == pUser) {
|
if (NULL == pUser) {
|
||||||
|
|
|
@ -1589,6 +1589,12 @@ int32_t ctgChkSetAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
|
||||||
return TSDB_CODE_SUCCESS;
|
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];
|
char dbFName[TSDB_DB_FNAME_LEN];
|
||||||
tNameGetFullDbName(&pReq->tbName, dbFName);
|
tNameGetFullDbName(&pReq->tbName, dbFName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue