fix bug
This commit is contained in:
parent
24844d2e26
commit
f7a5abf932
|
|
@ -74,9 +74,6 @@ float tsMinimalLogDirGB = 1.0f;
|
||||||
int64_t asyncLogLostLines = 0;
|
int64_t asyncLogLostLines = 0;
|
||||||
int32_t writeInterval = DEFAULT_LOG_INTERVAL;
|
int32_t writeInterval = DEFAULT_LOG_INTERVAL;
|
||||||
|
|
||||||
|
|
||||||
int64_t dbgPostN = 0;
|
|
||||||
int64_t dbgNoPostN = 0;
|
|
||||||
int64_t dbgEmptyW = 0;
|
int64_t dbgEmptyW = 0;
|
||||||
int64_t dbgWN = 0;
|
int64_t dbgWN = 0;
|
||||||
int64_t dbgSmallWN = 0;
|
int64_t dbgSmallWN = 0;
|
||||||
|
|
@ -562,12 +559,9 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
|
||||||
static int64_t lostLine = 0;
|
static int64_t lostLine = 0;
|
||||||
char tmpBuf[40] = {0};
|
char tmpBuf[40] = {0};
|
||||||
int32_t tmpBufLen = 0;
|
int32_t tmpBufLen = 0;
|
||||||
static int32_t waitLock = 0;
|
|
||||||
|
|
||||||
if (tLogBuff == NULL || tLogBuff->stop) return -1;
|
if (tLogBuff == NULL || tLogBuff->stop) return -1;
|
||||||
|
|
||||||
//atomic_add_fetch_32(&waitLock, 1);
|
|
||||||
|
|
||||||
pthread_mutex_lock(&LOG_BUF_MUTEX(tLogBuff));
|
pthread_mutex_lock(&LOG_BUF_MUTEX(tLogBuff));
|
||||||
start = LOG_BUF_START(tLogBuff);
|
start = LOG_BUF_START(tLogBuff);
|
||||||
end = LOG_BUF_END(tLogBuff);
|
end = LOG_BUF_END(tLogBuff);
|
||||||
|
|
@ -583,7 +577,6 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
|
||||||
lostLine++;
|
lostLine++;
|
||||||
asyncLogLostLines++;
|
asyncLogLostLines++;
|
||||||
pthread_mutex_unlock(&LOG_BUF_MUTEX(tLogBuff));
|
pthread_mutex_unlock(&LOG_BUF_MUTEX(tLogBuff));
|
||||||
atomic_sub_fetch_32(&waitLock, 1);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -642,19 +635,18 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
|
||||||
}
|
}
|
||||||
|
|
||||||
dbgWN++;
|
dbgWN++;
|
||||||
|
dbgWSize+=pollSize;
|
||||||
|
|
||||||
if (pollSize < 1048576) {
|
if (pollSize < LOG_BUF_SIZE(tLogBuff)/10) {
|
||||||
dbgSmallWN++;
|
dbgSmallWN++;
|
||||||
if (writeInterval < MAX_LOG_INTERVAL) {
|
if (writeInterval < MAX_LOG_INTERVAL) {
|
||||||
writeInterval += LOG_INTERVAL_STEP;
|
writeInterval += LOG_INTERVAL_STEP;
|
||||||
}
|
}
|
||||||
} else if (pollSize > 4 * 1048576) {
|
} else if (pollSize > LOG_BUF_SIZE(tLogBuff)/3) {
|
||||||
dbgBigWN++;
|
dbgBigWN++;
|
||||||
writeInterval = MIN_LOG_INTERVAL;
|
writeInterval = MIN_LOG_INTERVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbgWSize+=pollSize;
|
|
||||||
|
|
||||||
LOG_BUF_START(tLogBuff) = (LOG_BUF_START(tLogBuff) + pollSize) % LOG_BUF_SIZE(tLogBuff);
|
LOG_BUF_START(tLogBuff) = (LOG_BUF_START(tLogBuff) + pollSize) % LOG_BUF_SIZE(tLogBuff);
|
||||||
|
|
||||||
int32_t rsize = taosGetLogRemainSize(tLogBuff);
|
int32_t rsize = taosGetLogRemainSize(tLogBuff);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue