提交 5706dc8c 编写于 作者: S Shengliang Guan

[TD-526] add debug option for log

上级 abb55ed0
...@@ -23,12 +23,17 @@ extern "C" { ...@@ -23,12 +23,17 @@ extern "C" {
#include "tlog.h" #include "tlog.h"
extern int32_t cDebugFlag; extern int32_t cDebugFlag;
extern int32_t tscEmbedded;
#define tscError(...) { if (cDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR TSC ", cDebugFlag, __VA_ARGS__); }} #define tscFatal(...) { if (cDebugFlag & DEBUG_FATAL) { taosPrintLog("TSC FATAL ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscWarn(...) { if (cDebugFlag & DEBUG_WARN) { taosPrintLog("WARN TSC ", cDebugFlag, __VA_ARGS__); }} #define tscError(...) { if (cDebugFlag & DEBUG_ERROR) { taosPrintLog("TSC ERROR ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscTrace(...) { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", cDebugFlag, __VA_ARGS__); }} #define tscWarn(...) { if (cDebugFlag & DEBUG_WARN) { taosPrintLog("TSC WARN ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscDump(...) { if (cDebugFlag & DEBUG_TRACE) { taosPrintLongString("TSC ", cDebugFlag, __VA_ARGS__); }} #define tscInfo(...) { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC INFO ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscPrint(...) { taosPrintLog("TSC ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); } #define tscDebug(...) { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC DEBUG ", cDebugFlag, __VA_ARGS__); }}
#define tscTrace(...) { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC TRACE ", cDebugFlag, __VA_ARGS__); }}
#define tscDebugDump(...) { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC DEBUG ", cDebugFlag, __VA_ARGS__); }}
#define tscTraceDump(...) { if (cDebugFlag & DEBUG_TRACE) { taosPrintLongString("TSC TRACE ", cDebugFlag, __VA_ARGS__); }}
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -22,26 +22,15 @@ ...@@ -22,26 +22,15 @@
#include "com_taosdata_jdbc_TSDBJNIConnector.h" #include "com_taosdata_jdbc_TSDBJNIConnector.h"
#define jniError(...) \ #define jniFatal(...) { if (jniDebugFlag & DEBUG_FATAL) { taosPrintLog("JNI FATAL ", tscEmbedded ? 255 : jniDebugFlag, __VA_ARGS__); }}
{ \ #define jniError(...) { if (jniDebugFlag & DEBUG_ERROR) { taosPrintLog("JNI ERROR ", tscEmbedded ? 255 : jniDebugFlag, __VA_ARGS__); }}
if (jniDebugFlag & DEBUG_ERROR) { \ #define jniWarn(...) { if (jniDebugFlag & DEBUG_WARN) { taosPrintLog("JNI WARN ", tscEmbedded ? 255 : jniDebugFlag, __VA_ARGS__); }}
taosPrintLog("ERROR JNI ", jniDebugFlag, __VA_ARGS__); \ #define jniInfo(...) { if (jniDebugFlag & DEBUG_INFO) { taosPrintLog("JNI INFO ", tscEmbedded ? 255 : jniDebugFlag, __VA_ARGS__); }}
} \ #define jniDebug(...) { if (jniDebugFlag & DEBUG_DEBUG) { taosPrintLog("JNI DEBUG ", jniDebugFlag, __VA_ARGS__); }}
} #define jniTrace(...) { if (jniDebugFlag & DEBUG_TRACE) { taosPrintLog("JNI TRACE ", jniDebugFlag, __VA_ARGS__); }}
#define jniWarn(...) \
{ \ #define jniDebugDump(...) { if (jniDebugFlag & DEBUG_DEBUG) { taosPrintLongString("JNI DEBUG ", jniDebugFlag, __VA_ARGS__); }}
if (jniDebugFlag & DEBUG_WARN) { \ #define jniTraceDump(...) { if (jniDebugFlag & DEBUG_TRACE) { taosPrintLongString("JNI DEBUG ", jniDebugFlag, __VA_ARGS__); }}
taosPrintLog("WARN JNI ", jniDebugFlag, __VA_ARGS__); \
} \
}
#define jniTrace(...) \
{ \
if (jniDebugFlag & DEBUG_TRACE) { \
taosPrintLog("JNI ", jniDebugFlag, __VA_ARGS__); \
} \
}
#define jniPrint(...) \
{ taosPrintLog("JNI ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }
int __init = 0; int __init = 0;
...@@ -130,7 +119,7 @@ void jniGetGlobalMethod(JNIEnv *env) { ...@@ -130,7 +119,7 @@ void jniGetGlobalMethod(JNIEnv *env) {
(*env)->DeleteLocalRef(env, rowdataClass); (*env)->DeleteLocalRef(env, rowdataClass);
atomic_store_32(&__init, 2); atomic_store_32(&__init, 2);
jniTrace("native method register finished"); jniDebug("native method register finished");
} }
JNIEXPORT void JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setAllocModeImp(JNIEnv *env, jobject jobj, jint jMode, JNIEXPORT void JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setAllocModeImp(JNIEnv *env, jobject jobj, jint jMode,
...@@ -158,13 +147,13 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_initImp(JNIEnv *e ...@@ -158,13 +147,13 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_initImp(JNIEnv *e
} }
jniGetGlobalMethod(env); jniGetGlobalMethod(env);
jniTrace("jni initialized successfully, config directory: %s", configDir); jniDebug("jni initialized successfully, config directory: %s", configDir);
} }
JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv *env, jobject jobj, jint optionIndex, JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv *env, jobject jobj, jint optionIndex,
jstring optionValue) { jstring optionValue) {
if (optionValue == NULL) { if (optionValue == NULL) {
jniTrace("option index:%d value is null", optionIndex); jniDebug("option index:%d value is null", optionIndex);
return 0; return 0;
} }
...@@ -174,27 +163,27 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv ...@@ -174,27 +163,27 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv
const char *locale = (*env)->GetStringUTFChars(env, optionValue, NULL); const char *locale = (*env)->GetStringUTFChars(env, optionValue, NULL);
if (locale && strlen(locale) != 0) { if (locale && strlen(locale) != 0) {
res = taos_options(TSDB_OPTION_LOCALE, locale); res = taos_options(TSDB_OPTION_LOCALE, locale);
jniTrace("set locale to %s, result:%d", locale, res); jniDebug("set locale to %s, result:%d", locale, res);
} else { } else {
jniTrace("input locale is empty"); jniDebug("input locale is empty");
} }
(*env)->ReleaseStringUTFChars(env, optionValue, locale); (*env)->ReleaseStringUTFChars(env, optionValue, locale);
} else if (optionIndex == TSDB_OPTION_CHARSET) { } else if (optionIndex == TSDB_OPTION_CHARSET) {
const char *charset = (*env)->GetStringUTFChars(env, optionValue, NULL); const char *charset = (*env)->GetStringUTFChars(env, optionValue, NULL);
if (charset && strlen(charset) != 0) { if (charset && strlen(charset) != 0) {
res = taos_options(TSDB_OPTION_CHARSET, charset); res = taos_options(TSDB_OPTION_CHARSET, charset);
jniTrace("set character encoding to %s, result:%d", charset, res); jniDebug("set character encoding to %s, result:%d", charset, res);
} else { } else {
jniTrace("input character encoding is empty"); jniDebug("input character encoding is empty");
} }
(*env)->ReleaseStringUTFChars(env, optionValue, charset); (*env)->ReleaseStringUTFChars(env, optionValue, charset);
} else if (optionIndex == TSDB_OPTION_TIMEZONE) { } else if (optionIndex == TSDB_OPTION_TIMEZONE) {
const char *tz1 = (*env)->GetStringUTFChars(env, optionValue, NULL); const char *tz1 = (*env)->GetStringUTFChars(env, optionValue, NULL);
if (tz1 && strlen(tz1) != 0) { if (tz1 && strlen(tz1) != 0) {
res = taos_options(TSDB_OPTION_TIMEZONE, tz1); res = taos_options(TSDB_OPTION_TIMEZONE, tz1);
jniTrace("set timezone to %s, result:%d", tz1, res); jniDebug("set timezone to %s, result:%d", tz1, res);
} else { } else {
jniTrace("input timezone is empty"); jniDebug("input timezone is empty");
} }
(*env)->ReleaseStringUTFChars(env, optionValue, tz1); (*env)->ReleaseStringUTFChars(env, optionValue, tz1);
} else { } else {
...@@ -227,10 +216,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn ...@@ -227,10 +216,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn
} }
if (user == NULL) { if (user == NULL) {
jniTrace("jobj:%p, user is null, use default user %s", jobj, TSDB_DEFAULT_USER); jniDebug("jobj:%p, user is null, use default user %s", jobj, TSDB_DEFAULT_USER);
} }
if (pass == NULL) { if (pass == NULL) {
jniTrace("jobj:%p, pass is null, use default password", jobj); jniDebug("jobj:%p, pass is null, use default password", jobj);
} }
/* /*
...@@ -244,7 +233,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn ...@@ -244,7 +233,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn
jniError("jobj:%p, conn:%p, connect to database failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret, jniError("jobj:%p, conn:%p, connect to database failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
(char *)host, (char *)user, (char *)dbname, jport); (char *)host, (char *)user, (char *)dbname, jport);
} else { } else {
jniTrace("jobj:%p, conn:%p, connect to database succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret, jniDebug("jobj:%p, conn:%p, connect to database succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
(char *)host, (char *)user, (char *)dbname, jport); (char *)host, (char *)user, (char *)dbname, jport);
} }
...@@ -282,7 +271,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp( ...@@ -282,7 +271,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(
// todo handle error // todo handle error
} }
jniTrace("jobj:%p, conn:%p, sql:%s", jobj, tscon, dst); jniDebug("jobj:%p, conn:%p, sql:%s", jobj, tscon, dst);
SSqlObj *pSql = taos_query(tscon, dst); SSqlObj *pSql = taos_query(tscon, dst);
int32_t code = taos_errno(pSql); int32_t code = taos_errno(pSql);
...@@ -293,9 +282,9 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp( ...@@ -293,9 +282,9 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(
int32_t affectRows = 0; int32_t affectRows = 0;
if (pSql->cmd.command == TSDB_SQL_INSERT) { if (pSql->cmd.command == TSDB_SQL_INSERT) {
affectRows = taos_affected_rows(pSql); affectRows = taos_affected_rows(pSql);
jniTrace("jobj:%p, conn:%p, code:%s, affect rows:%d", jobj, tscon, tstrerror(code), affectRows); jniDebug("jobj:%p, conn:%p, code:%s, affect rows:%d", jobj, tscon, tstrerror(code), affectRows);
} else { } else {
jniTrace("jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code)); jniDebug("jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
} }
} }
...@@ -343,10 +332,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp( ...@@ -343,10 +332,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp(
if (tscIsUpdateQuery(pSql)) { if (tscIsUpdateQuery(pSql)) {
// taos_free_result(pSql); // free result here // taos_free_result(pSql); // free result here
jniTrace("jobj:%p, conn:%p, no resultset, %p", jobj, pObj, (void *)tres); jniDebug("jobj:%p, conn:%p, no resultset, %p", jobj, pObj, (void *)tres);
return 0; return 0;
} else { } else {
jniTrace("jobj:%p, conn:%p, get resultset, %p", jobj, pObj, (void *)tres); jniDebug("jobj:%p, conn:%p, get resultset, %p", jobj, pObj, (void *)tres);
return tres; return tres;
} }
} }
...@@ -365,7 +354,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp( ...@@ -365,7 +354,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp(
} }
taos_free_result((void *)res); taos_free_result((void *)res);
jniTrace("jobj:%p, conn:%p, free resultset:%p", jobj, tscon, (void *)res); jniDebug("jobj:%p, conn:%p, free resultset:%p", jobj, tscon, (void *)res);
return JNI_SUCCESS; return JNI_SUCCESS;
} }
...@@ -383,7 +372,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm ...@@ -383,7 +372,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm
} }
jint ret = taos_affected_rows((SSqlObj *)res); jint ret = taos_affected_rows((SSqlObj *)res);
jniTrace("jobj:%p, conn:%p, sql:%p, res: %p, affect rows:%d", jobj, tscon, (void *)con, (void *)res, ret); jniDebug("jobj:%p, conn:%p, sql:%p, res: %p, affect rows:%d", jobj, tscon, (void *)con, (void *)res, ret);
return ret; return ret;
} }
...@@ -412,7 +401,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData ...@@ -412,7 +401,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
jniError("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, (void *)res, num_fields); jniError("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, (void *)res, num_fields);
return JNI_NUM_OF_FIELDS_0; return JNI_NUM_OF_FIELDS_0;
} else { } else {
jniTrace("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, (void *)res, num_fields); jniDebug("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, (void *)res, num_fields);
for (int i = 0; i < num_fields; ++i) { for (int i = 0; i < num_fields; ++i) {
jobject metadataObj = (*env)->NewObject(env, g_metadataClass, g_metadataConstructFp); jobject metadataObj = (*env)->NewObject(env, g_metadataClass, g_metadataConstructFp);
(*env)->SetIntField(env, metadataObj, g_metadataColtypeField, fields[i].type); (*env)->SetIntField(env, metadataObj, g_metadataColtypeField, fields[i].type);
...@@ -471,10 +460,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn ...@@ -471,10 +460,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
if (row == NULL) { if (row == NULL) {
int tserrno = taos_errno(result); int tserrno = taos_errno(result);
if (tserrno == 0) { if (tserrno == 0) {
jniTrace("jobj:%p, conn:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, (void*)res, num_fields); jniDebug("jobj:%p, conn:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, (void*)res, num_fields);
return JNI_FETCH_END; return JNI_FETCH_END;
} else { } else {
jniTrace("jobj:%p, conn:%p, interruptted query", jobj, tscon); jniDebug("jobj:%p, conn:%p, interruptted query", jobj, tscon);
return JNI_RESULT_SET_NULL; return JNI_RESULT_SET_NULL;
} }
} }
...@@ -542,7 +531,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm ...@@ -542,7 +531,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm
jniError("jobj:%p, connection is already closed", jobj); jniError("jobj:%p, connection is already closed", jobj);
return JNI_CONNECTION_NULL; return JNI_CONNECTION_NULL;
} else { } else {
jniTrace("jobj:%p, conn:%p, close connection success", jobj, tscon); jniDebug("jobj:%p, conn:%p, close connection success", jobj, tscon);
taos_close(tscon); taos_close(tscon);
return JNI_SUCCESS; return JNI_SUCCESS;
} }
...@@ -556,7 +545,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI ...@@ -556,7 +545,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI
char *sql = NULL; char *sql = NULL;
jniGetGlobalMethod(env); jniGetGlobalMethod(env);
jniTrace("jobj:%p, in TSDBJNIConnector_subscribeImp", jobj); jniDebug("jobj:%p, in TSDBJNIConnector_subscribeImp", jobj);
if (jtopic != NULL) { if (jtopic != NULL) {
topic = (char *)(*env)->GetStringUTFChars(env, jtopic, NULL); topic = (char *)(*env)->GetStringUTFChars(env, jtopic, NULL);
...@@ -566,7 +555,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI ...@@ -566,7 +555,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI
} }
if (topic == NULL || sql == NULL) { if (topic == NULL || sql == NULL) {
jniTrace("jobj:%p, invalid argument: topic or sql is NULL", jobj); jniDebug("jobj:%p, invalid argument: topic or sql is NULL", jobj);
return sub; return sub;
} }
...@@ -574,9 +563,9 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI ...@@ -574,9 +563,9 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI
sub = (jlong)tsub; sub = (jlong)tsub;
if (sub == 0) { if (sub == 0) {
jniTrace("jobj:%p, failed to subscribe: topic:%s", jobj, topic); jniDebug("jobj:%p, failed to subscribe: topic:%s", jobj, topic);
} else { } else {
jniTrace("jobj:%p, successfully subscribe: topic: %s", jobj, topic); jniDebug("jobj:%p, successfully subscribe: topic: %s", jobj, topic);
} }
(*env)->ReleaseStringUTFChars(env, jtopic, topic); (*env)->ReleaseStringUTFChars(env, jtopic, topic);
...@@ -586,7 +575,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI ...@@ -586,7 +575,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_subscribeImp(JNI
} }
JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_consumeImp(JNIEnv *env, jobject jobj, jlong sub) { JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_consumeImp(JNIEnv *env, jobject jobj, jlong sub) {
jniTrace("jobj:%p, in TSDBJNIConnector_consumeImp, sub:%lld", jobj, sub); jniDebug("jobj:%p, in TSDBJNIConnector_consumeImp, sub:%lld", jobj, sub);
jniGetGlobalMethod(env); jniGetGlobalMethod(env);
TAOS_SUB *tsub = (TAOS_SUB *)sub; TAOS_SUB *tsub = (TAOS_SUB *)sub;
...@@ -629,7 +618,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab ...@@ -629,7 +618,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab
} }
int code = taos_validate_sql(tscon, dst); int code = taos_validate_sql(tscon, dst);
jniTrace("jobj:%p, conn:%p, code is %d", jobj, tscon, code); jniDebug("jobj:%p, conn:%p, code is %d", jobj, tscon, code);
free(dst); free(dst);
return code; return code;
......
...@@ -55,7 +55,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const ...@@ -55,7 +55,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const
strtolower(pSql->sqlstr, sqlstr); strtolower(pSql->sqlstr, sqlstr);
tscDump("%p SQL: %s", pSql, pSql->sqlstr); tscDebugDump("%p SQL: %s", pSql, pSql->sqlstr);
pSql->cmd.curSql = pSql->sqlstr; pSql->cmd.curSql = pSql->sqlstr;
int32_t code = tsParseSql(pSql, true); int32_t code = tsParseSql(pSql, true);
...@@ -361,7 +361,7 @@ void tscProcessAsyncRes(SSchedMsg *pMsg) { ...@@ -361,7 +361,7 @@ void tscProcessAsyncRes(SSchedMsg *pMsg) {
} }
if (shouldFree) { if (shouldFree) {
tscTrace("%p sqlObj is automatically freed in async res", pSql); tscDebug("%p sqlObj is automatically freed in async res", pSql);
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
} }
} }
...@@ -385,7 +385,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) { ...@@ -385,7 +385,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) {
void tscQueueAsyncRes(SSqlObj *pSql) { void tscQueueAsyncRes(SSqlObj *pSql) {
if (pSql == NULL || pSql->signature != pSql) { if (pSql == NULL || pSql->signature != pSql) {
tscTrace("%p SqlObj is freed, not add into queue async res", pSql); tscDebug("%p SqlObj is freed, not add into queue async res", pSql);
return; return;
} else { } else {
tscError("%p add into queued async res, code:%s", pSql, tstrerror(pSql->res.code)); tscError("%p add into queued async res, code:%s", pSql, tstrerror(pSql->res.code));
...@@ -401,12 +401,12 @@ void tscQueueAsyncRes(SSqlObj *pSql) { ...@@ -401,12 +401,12 @@ void tscQueueAsyncRes(SSqlObj *pSql) {
void tscProcessAsyncFree(SSchedMsg *pMsg) { void tscProcessAsyncFree(SSchedMsg *pMsg) {
SSqlObj *pSql = (SSqlObj *)pMsg->ahandle; SSqlObj *pSql = (SSqlObj *)pMsg->ahandle;
tscTrace("%p sql is freed", pSql); tscDebug("%p sql is freed", pSql);
taos_free_result(pSql); taos_free_result(pSql);
} }
void tscQueueAsyncFreeResult(SSqlObj *pSql) { void tscQueueAsyncFreeResult(SSqlObj *pSql) {
tscTrace("%p sqlObj put in queue to async free", pSql); tscDebug("%p sqlObj put in queue to async free", pSql);
SSchedMsg schedMsg = { 0 }; SSchedMsg schedMsg = { 0 };
schedMsg.fp = tscProcessAsyncFree; schedMsg.fp = tscProcessAsyncFree;
...@@ -436,7 +436,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { ...@@ -436,7 +436,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
// check if it is a sub-query of super table query first, if true, enter another routine // check if it is a sub-query of super table query first, if true, enter another routine
if (TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_STABLE_SUBQUERY)) { if (TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_STABLE_SUBQUERY)) {
tscTrace("%p update table meta in local cache, continue to process sql and send corresponding subquery", pSql); tscDebug("%p update table meta in local cache, continue to process sql and send corresponding subquery", pSql);
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
code = tscGetTableMeta(pSql, pTableMetaInfo); code = tscGetTableMeta(pSql, pTableMetaInfo);
...@@ -462,7 +462,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { ...@@ -462,7 +462,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
} }
} else { // continue to process normal async query } else { // continue to process normal async query
if (pCmd->parseFinished) { if (pCmd->parseFinished) {
tscTrace("%p update table meta in local cache, continue to process sql and send corresponding query", pSql); tscDebug("%p update table meta in local cache, continue to process sql and send corresponding query", pSql);
STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0); STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0);
code = tscGetTableMeta(pSql, pTableMetaInfo); code = tscGetTableMeta(pSql, pTableMetaInfo);
...@@ -481,7 +481,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { ...@@ -481,7 +481,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
// code = tscSendMsgToServer(pSql); // code = tscSendMsgToServer(pSql);
// if (code == TSDB_CODE_SUCCESS) return; // if (code == TSDB_CODE_SUCCESS) return;
} else { } else {
tscTrace("%p continue parse sql after get table meta", pSql); tscDebug("%p continue parse sql after get table meta", pSql);
code = tsParseSql(pSql, false); code = tsParseSql(pSql, false);
if (TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_STMT_INSERT)) { if (TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_STMT_INSERT)) {
...@@ -522,14 +522,14 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { ...@@ -522,14 +522,14 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
} }
if (pSql->pStream) { if (pSql->pStream) {
tscTrace("%p stream:%p meta is updated, start new query, command:%d", pSql, pSql->pStream, pSql->cmd.command); tscDebug("%p stream:%p meta is updated, start new query, command:%d", pSql, pSql->pStream, pSql->cmd.command);
if (!pSql->cmd.parseFinished) { if (!pSql->cmd.parseFinished) {
tsParseSql(pSql, false); tsParseSql(pSql, false);
sem_post(&pSql->rspSem); sem_post(&pSql->rspSem);
} }
return; return;
} else { } else {
tscTrace("%p get tableMeta successfully", pSql); tscDebug("%p get tableMeta successfully", pSql);
} }
tscDoQuery(pSql); tscDoQuery(pSql);
......
...@@ -962,7 +962,7 @@ static void minMax_function(SQLFunctionCtx *pCtx, char *pOutput, int32_t isMin, ...@@ -962,7 +962,7 @@ static void minMax_function(SQLFunctionCtx *pCtx, char *pOutput, int32_t isMin,
} else if (pCtx->inputType == TSDB_DATA_TYPE_INT) { } else if (pCtx->inputType == TSDB_DATA_TYPE_INT) {
int32_t *data = (int32_t *)pOutput; int32_t *data = (int32_t *)pOutput;
#if defined(_DEBUG_VIEW) #if defined(_DEBUG_VIEW)
tscTrace("max value updated according to pre-cal:%d", *data); tscDebug("max value updated according to pre-cal:%d", *data);
#endif #endif
if ((*data < val) ^ isMin) { if ((*data < val) ^ isMin) {
...@@ -1022,7 +1022,7 @@ static void minMax_function(SQLFunctionCtx *pCtx, char *pOutput, int32_t isMin, ...@@ -1022,7 +1022,7 @@ static void minMax_function(SQLFunctionCtx *pCtx, char *pOutput, int32_t isMin,
*notNullElems += 1; *notNullElems += 1;
} }
#if defined(_DEBUG_VIEW) #if defined(_DEBUG_VIEW)
tscTrace("max value updated:%d", *retVal); tscDebug("max value updated:%d", *retVal);
#endif #endif
} else if (pCtx->inputType == TSDB_DATA_TYPE_BIGINT) { } else if (pCtx->inputType == TSDB_DATA_TYPE_BIGINT) {
TYPED_LOOPCHECK_N(int64_t, pOutput, p, pCtx, pCtx->inputType, isMin, *notNullElems); TYPED_LOOPCHECK_N(int64_t, pOutput, p, pCtx, pCtx->inputType, isMin, *notNullElems);
...@@ -1704,7 +1704,7 @@ static void last_data_assign_impl(SQLFunctionCtx *pCtx, char *pData, int32_t ind ...@@ -1704,7 +1704,7 @@ static void last_data_assign_impl(SQLFunctionCtx *pCtx, char *pData, int32_t ind
if (pInfo->hasResult != DATA_SET_FLAG || pInfo->ts < timestamp[index]) { if (pInfo->hasResult != DATA_SET_FLAG || pInfo->ts < timestamp[index]) {
#if defined(_DEBUG_VIEW) #if defined(_DEBUG_VIEW)
tscTrace("assign index:%d, ts:%" PRId64 ", val:%d, ", index, timestamp[index], *(int32_t *)pData); tscDebug("assign index:%d, ts:%" PRId64 ", val:%d, ", index, timestamp[index], *(int32_t *)pData);
#endif #endif
memcpy(pCtx->aOutputBuf, pData, pCtx->inputBytes); memcpy(pCtx->aOutputBuf, pData, pCtx->inputBytes);
...@@ -3973,7 +3973,7 @@ static double do_calc_rate(const SRateInfo* pRateInfo) { ...@@ -3973,7 +3973,7 @@ static double do_calc_rate(const SRateInfo* pRateInfo) {
double resultVal = ((double)diff) / duration; double resultVal = ((double)diff) / duration;
tscTrace("do_calc_rate() isIRate:%d firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64 " resultVal:%f", tscDebug("do_calc_rate() isIRate:%d firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64 " resultVal:%f",
pRateInfo->isIRate, pRateInfo->firstKey, pRateInfo->lastKey, pRateInfo->firstValue, pRateInfo->lastValue, pRateInfo->CorrectionValue, resultVal); pRateInfo->isIRate, pRateInfo->firstKey, pRateInfo->lastKey, pRateInfo->firstValue, pRateInfo->lastValue, pRateInfo->CorrectionValue, resultVal);
return resultVal; return resultVal;
...@@ -4009,12 +4009,12 @@ static void rate_function(SQLFunctionCtx *pCtx) { ...@@ -4009,12 +4009,12 @@ static void rate_function(SQLFunctionCtx *pCtx) {
SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf; SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf;
TSKEY *primaryKey = pCtx->ptsList; TSKEY *primaryKey = pCtx->ptsList;
tscTrace("%p rate_function() size:%d, hasNull:%d", pCtx, pCtx->size, pCtx->hasNull); tscDebug("%p rate_function() size:%d, hasNull:%d", pCtx, pCtx->size, pCtx->hasNull);
for (int32_t i = 0; i < pCtx->size; ++i) { for (int32_t i = 0; i < pCtx->size; ++i) {
char *pData = GET_INPUT_CHAR_INDEX(pCtx, i); char *pData = GET_INPUT_CHAR_INDEX(pCtx, i);
if (pCtx->hasNull && isNull(pData, pCtx->inputType)) { if (pCtx->hasNull && isNull(pData, pCtx->inputType)) {
tscTrace("%p rate_function() index of null data:%d", pCtx, i); tscDebug("%p rate_function() index of null data:%d", pCtx, i);
continue; continue;
} }
...@@ -4042,19 +4042,19 @@ static void rate_function(SQLFunctionCtx *pCtx) { ...@@ -4042,19 +4042,19 @@ static void rate_function(SQLFunctionCtx *pCtx) {
pRateInfo->firstValue = v; pRateInfo->firstValue = v;
pRateInfo->firstKey = primaryKey[i]; pRateInfo->firstKey = primaryKey[i];
tscTrace("firstValue:%" PRId64 " firstKey:%" PRId64, pRateInfo->firstValue, pRateInfo->firstKey); tscDebug("firstValue:%" PRId64 " firstKey:%" PRId64, pRateInfo->firstValue, pRateInfo->firstKey);
} }
if (INT64_MIN == pRateInfo->lastValue) { if (INT64_MIN == pRateInfo->lastValue) {
pRateInfo->lastValue = v; pRateInfo->lastValue = v;
} else if (v < pRateInfo->lastValue) { } else if (v < pRateInfo->lastValue) {
pRateInfo->CorrectionValue += pRateInfo->lastValue; pRateInfo->CorrectionValue += pRateInfo->lastValue;
tscTrace("CorrectionValue:%" PRId64, pRateInfo->CorrectionValue); tscDebug("CorrectionValue:%" PRId64, pRateInfo->CorrectionValue);
} }
pRateInfo->lastValue = v; pRateInfo->lastValue = v;
pRateInfo->lastKey = primaryKey[i]; pRateInfo->lastKey = primaryKey[i];
tscTrace("lastValue:%" PRId64 " lastKey:%" PRId64, pRateInfo->lastValue, pRateInfo->lastKey); tscDebug("lastValue:%" PRId64 " lastKey:%" PRId64, pRateInfo->lastValue, pRateInfo->lastKey);
} }
if (!pCtx->hasNull) { if (!pCtx->hasNull) {
...@@ -4117,7 +4117,7 @@ static void rate_function_f(SQLFunctionCtx *pCtx, int32_t index) { ...@@ -4117,7 +4117,7 @@ static void rate_function_f(SQLFunctionCtx *pCtx, int32_t index) {
pRateInfo->lastValue = v; pRateInfo->lastValue = v;
pRateInfo->lastKey = primaryKey[index]; pRateInfo->lastKey = primaryKey[index];
tscTrace("====%p rate_function_f() index:%d lastValue:%" PRId64 " lastKey:%" PRId64 " CorrectionValue:%" PRId64, pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->CorrectionValue); tscDebug("====%p rate_function_f() index:%d lastValue:%" PRId64 " lastKey:%" PRId64 " CorrectionValue:%" PRId64, pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->CorrectionValue);
SET_VAL(pCtx, 1, 1); SET_VAL(pCtx, 1, 1);
...@@ -4137,7 +4137,7 @@ static void rate_func_merge(SQLFunctionCtx *pCtx) { ...@@ -4137,7 +4137,7 @@ static void rate_func_merge(SQLFunctionCtx *pCtx) {
SResultInfo *pResInfo = GET_RES_INFO(pCtx); SResultInfo *pResInfo = GET_RES_INFO(pCtx);
assert(pResInfo->superTableQ); assert(pResInfo->superTableQ);
tscTrace("rate_func_merge() size:%d", pCtx->size); tscDebug("rate_func_merge() size:%d", pCtx->size);
//SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf; //SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf;
SRateInfo *pBuf = (SRateInfo *)pCtx->aOutputBuf; SRateInfo *pBuf = (SRateInfo *)pCtx->aOutputBuf;
...@@ -4154,7 +4154,7 @@ static void rate_func_merge(SQLFunctionCtx *pCtx) { ...@@ -4154,7 +4154,7 @@ static void rate_func_merge(SQLFunctionCtx *pCtx) {
numOfNotNull++; numOfNotNull++;
memcpy(pBuf, pInput, sizeof(SRateInfo)); memcpy(pBuf, pInput, sizeof(SRateInfo));
tscTrace("%p rate_func_merge() isIRate:%d firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64, tscDebug("%p rate_func_merge() isIRate:%d firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64,
pCtx, pInput->isIRate, pInput->firstKey, pInput->lastKey, pInput->firstValue, pInput->lastValue, pInput->CorrectionValue); pCtx, pInput->isIRate, pInput->firstKey, pInput->lastKey, pInput->firstValue, pInput->lastValue, pInput->CorrectionValue);
} }
...@@ -4177,7 +4177,7 @@ static void rate_func_copy(SQLFunctionCtx *pCtx) { ...@@ -4177,7 +4177,7 @@ static void rate_func_copy(SQLFunctionCtx *pCtx) {
pResInfo->hasResult = ((SRateInfo*)pCtx->aInputElemBuf)->hasResult; pResInfo->hasResult = ((SRateInfo*)pCtx->aInputElemBuf)->hasResult;
SRateInfo* pRateInfo = (SRateInfo*)pCtx->aInputElemBuf; SRateInfo* pRateInfo = (SRateInfo*)pCtx->aInputElemBuf;
tscTrace("%p rate_func_second_merge() firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64 " hasResult:%d", tscDebug("%p rate_func_second_merge() firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64 " hasResult:%d",
pCtx, pRateInfo->firstKey, pRateInfo->lastKey, pRateInfo->firstValue, pRateInfo->lastValue, pRateInfo->CorrectionValue, pRateInfo->hasResult); pCtx, pRateInfo->firstKey, pRateInfo->lastKey, pRateInfo->firstValue, pRateInfo->lastValue, pRateInfo->CorrectionValue, pRateInfo->hasResult);
} }
...@@ -4187,7 +4187,7 @@ static void rate_finalizer(SQLFunctionCtx *pCtx) { ...@@ -4187,7 +4187,7 @@ static void rate_finalizer(SQLFunctionCtx *pCtx) {
SResultInfo *pResInfo = GET_RES_INFO(pCtx); SResultInfo *pResInfo = GET_RES_INFO(pCtx);
SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf; SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf;
tscTrace("%p isIRate:%d firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64 " hasResult:%d", tscDebug("%p isIRate:%d firstKey:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " lastValue:%" PRId64 " CorrectionValue:%" PRId64 " hasResult:%d",
pCtx, pRateInfo->isIRate, pRateInfo->firstKey, pRateInfo->lastKey, pRateInfo->firstValue, pRateInfo->lastValue, pRateInfo->CorrectionValue, pRateInfo->hasResult); pCtx, pRateInfo->isIRate, pRateInfo->firstKey, pRateInfo->lastKey, pRateInfo->firstValue, pRateInfo->lastValue, pRateInfo->CorrectionValue, pRateInfo->hasResult);
if (pRateInfo->hasResult != DATA_SET_FLAG) { if (pRateInfo->hasResult != DATA_SET_FLAG) {
...@@ -4197,7 +4197,7 @@ static void rate_finalizer(SQLFunctionCtx *pCtx) { ...@@ -4197,7 +4197,7 @@ static void rate_finalizer(SQLFunctionCtx *pCtx) {
*(double*)pCtx->aOutputBuf = do_calc_rate(pRateInfo); *(double*)pCtx->aOutputBuf = do_calc_rate(pRateInfo);
tscTrace("rate_finalizer() output result:%f", *(double *)pCtx->aOutputBuf); tscDebug("rate_finalizer() output result:%f", *(double *)pCtx->aOutputBuf);
// cannot set the numOfIteratedElems again since it is set during previous iteration // cannot set the numOfIteratedElems again since it is set during previous iteration
pResInfo->numOfRes = 1; pResInfo->numOfRes = 1;
...@@ -4214,7 +4214,7 @@ static void irate_function(SQLFunctionCtx *pCtx) { ...@@ -4214,7 +4214,7 @@ static void irate_function(SQLFunctionCtx *pCtx) {
SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf; SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf;
TSKEY *primaryKey = pCtx->ptsList; TSKEY *primaryKey = pCtx->ptsList;
tscTrace("%p irate_function() size:%d, hasNull:%d", pCtx, pCtx->size, pCtx->hasNull); tscDebug("%p irate_function() size:%d, hasNull:%d", pCtx, pCtx->size, pCtx->hasNull);
if (pCtx->size < 1) { if (pCtx->size < 1) {
return; return;
...@@ -4223,7 +4223,7 @@ static void irate_function(SQLFunctionCtx *pCtx) { ...@@ -4223,7 +4223,7 @@ static void irate_function(SQLFunctionCtx *pCtx) {
for (int32_t i = pCtx->size - 1; i >= 0; --i) { for (int32_t i = pCtx->size - 1; i >= 0; --i) {
char *pData = GET_INPUT_CHAR_INDEX(pCtx, i); char *pData = GET_INPUT_CHAR_INDEX(pCtx, i);
if (pCtx->hasNull && isNull(pData, pCtx->inputType)) { if (pCtx->hasNull && isNull(pData, pCtx->inputType)) {
tscTrace("%p irate_function() index of null data:%d", pCtx, i); tscDebug("%p irate_function() index of null data:%d", pCtx, i);
continue; continue;
} }
...@@ -4252,7 +4252,7 @@ static void irate_function(SQLFunctionCtx *pCtx) { ...@@ -4252,7 +4252,7 @@ static void irate_function(SQLFunctionCtx *pCtx) {
pRateInfo->lastValue = v; pRateInfo->lastValue = v;
pRateInfo->lastKey = primaryKey[i]; pRateInfo->lastKey = primaryKey[i];
tscTrace("%p irate_function() lastValue:%" PRId64 " lastKey:%" PRId64, pCtx, pRateInfo->lastValue, pRateInfo->lastKey); tscDebug("%p irate_function() lastValue:%" PRId64 " lastKey:%" PRId64, pCtx, pRateInfo->lastValue, pRateInfo->lastKey);
continue; continue;
} }
...@@ -4260,7 +4260,7 @@ static void irate_function(SQLFunctionCtx *pCtx) { ...@@ -4260,7 +4260,7 @@ static void irate_function(SQLFunctionCtx *pCtx) {
pRateInfo->firstValue = v; pRateInfo->firstValue = v;
pRateInfo->firstKey = primaryKey[i]; pRateInfo->firstKey = primaryKey[i];
tscTrace("%p irate_function() firstValue:%" PRId64 " firstKey:%" PRId64, pCtx, pRateInfo->firstValue, pRateInfo->firstKey); tscDebug("%p irate_function() firstValue:%" PRId64 " firstKey:%" PRId64, pCtx, pRateInfo->firstValue, pRateInfo->firstKey);
break; break;
} }
} }
...@@ -4313,7 +4313,7 @@ static void irate_function_f(SQLFunctionCtx *pCtx, int32_t index) { ...@@ -4313,7 +4313,7 @@ static void irate_function_f(SQLFunctionCtx *pCtx, int32_t index) {
pRateInfo->lastValue = v; pRateInfo->lastValue = v;
pRateInfo->lastKey = primaryKey[index]; pRateInfo->lastKey = primaryKey[index];
tscTrace("====%p irate_function_f() index:%d lastValue:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " firstKey:%" PRId64, pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->firstValue , pRateInfo->firstKey); tscDebug("====%p irate_function_f() index:%d lastValue:%" PRId64 " lastKey:%" PRId64 " firstValue:%" PRId64 " firstKey:%" PRId64, pCtx, index, pRateInfo->lastValue, pRateInfo->lastKey, pRateInfo->firstValue , pRateInfo->firstKey);
SET_VAL(pCtx, 1, 1); SET_VAL(pCtx, 1, 1);
...@@ -4337,7 +4337,7 @@ static void do_sumrate_merge(SQLFunctionCtx *pCtx) { ...@@ -4337,7 +4337,7 @@ static void do_sumrate_merge(SQLFunctionCtx *pCtx) {
for (int32_t i = 0; i < pCtx->size; ++i, input += pCtx->inputBytes) { for (int32_t i = 0; i < pCtx->size; ++i, input += pCtx->inputBytes) {
SRateInfo *pInput = (SRateInfo *)input; SRateInfo *pInput = (SRateInfo *)input;
tscTrace("%p do_sumrate_merge() hasResult:%d input num:%" PRId64 " input sum:%f total num:%" PRId64 " total sum:%f", pCtx, pInput->hasResult, pInput->num, pInput->sum, pRateInfo->num, pRateInfo->sum); tscDebug("%p do_sumrate_merge() hasResult:%d input num:%" PRId64 " input sum:%f total num:%" PRId64 " total sum:%f", pCtx, pInput->hasResult, pInput->num, pInput->sum, pRateInfo->num, pRateInfo->sum);
if (pInput->hasResult != DATA_SET_FLAG) { if (pInput->hasResult != DATA_SET_FLAG) {
continue; continue;
...@@ -4360,12 +4360,12 @@ static void do_sumrate_merge(SQLFunctionCtx *pCtx) { ...@@ -4360,12 +4360,12 @@ static void do_sumrate_merge(SQLFunctionCtx *pCtx) {
} }
static void sumrate_func_merge(SQLFunctionCtx *pCtx) { static void sumrate_func_merge(SQLFunctionCtx *pCtx) {
tscTrace("%p sumrate_func_merge() process ...", pCtx); tscDebug("%p sumrate_func_merge() process ...", pCtx);
do_sumrate_merge(pCtx); do_sumrate_merge(pCtx);
} }
static void sumrate_func_second_merge(SQLFunctionCtx *pCtx) { static void sumrate_func_second_merge(SQLFunctionCtx *pCtx) {
tscTrace("%p sumrate_func_second_merge() process ...", pCtx); tscDebug("%p sumrate_func_second_merge() process ...", pCtx);
do_sumrate_merge(pCtx); do_sumrate_merge(pCtx);
} }
...@@ -4373,7 +4373,7 @@ static void sumrate_finalizer(SQLFunctionCtx *pCtx) { ...@@ -4373,7 +4373,7 @@ static void sumrate_finalizer(SQLFunctionCtx *pCtx) {
SResultInfo *pResInfo = GET_RES_INFO(pCtx); SResultInfo *pResInfo = GET_RES_INFO(pCtx);
SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf; SRateInfo *pRateInfo = (SRateInfo *)pResInfo->interResultBuf;
tscTrace("%p sumrate_finalizer() superTableQ:%d num:%" PRId64 " sum:%f hasResult:%d", pCtx, pResInfo->superTableQ, pRateInfo->num, pRateInfo->sum, pRateInfo->hasResult); tscDebug("%p sumrate_finalizer() superTableQ:%d num:%" PRId64 " sum:%f hasResult:%d", pCtx, pResInfo->superTableQ, pRateInfo->num, pRateInfo->sum, pRateInfo->hasResult);
if (pRateInfo->hasResult != DATA_SET_FLAG) { if (pRateInfo->hasResult != DATA_SET_FLAG) {
setNull(pCtx->aOutputBuf, TSDB_DATA_TYPE_DOUBLE, sizeof(double)); setNull(pCtx->aOutputBuf, TSDB_DATA_TYPE_DOUBLE, sizeof(double));
......
...@@ -177,7 +177,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd ...@@ -177,7 +177,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
for (int32_t i = 0; i < numOfBuffer; ++i) { for (int32_t i = 0; i < numOfBuffer; ++i) {
int32_t len = pMemBuffer[i]->fileMeta.flushoutData.nLength; int32_t len = pMemBuffer[i]->fileMeta.flushoutData.nLength;
if (len == 0) { if (len == 0) {
tscTrace("%p no data retrieved from orderOfVnode:%d", pSql, i + 1); tscDebug("%p no data retrieved from orderOfVnode:%d", pSql, i + 1);
continue; continue;
} }
...@@ -186,7 +186,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd ...@@ -186,7 +186,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
if (numOfFlush == 0 || numOfBuffer == 0) { if (numOfFlush == 0 || numOfBuffer == 0) {
tscLocalReducerEnvDestroy(pMemBuffer, pDesc, finalmodel, numOfBuffer); tscLocalReducerEnvDestroy(pMemBuffer, pDesc, finalmodel, numOfBuffer);
tscTrace("%p retrieved no data", pSql); tscDebug("%p retrieved no data", pSql);
return; return;
} }
...@@ -219,7 +219,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd ...@@ -219,7 +219,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
pReducer->numOfVnode = numOfBuffer; pReducer->numOfVnode = numOfBuffer;
pReducer->pDesc = pDesc; pReducer->pDesc = pDesc;
tscTrace("%p the number of merged leaves is: %d", pSql, pReducer->numOfBuffer); tscDebug("%p the number of merged leaves is: %d", pSql, pReducer->numOfBuffer);
int32_t idx = 0; int32_t idx = 0;
for (int32_t i = 0; i < numOfBuffer; ++i) { for (int32_t i = 0; i < numOfBuffer; ++i) {
...@@ -242,7 +242,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd ...@@ -242,7 +242,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
ds->pageId = 0; ds->pageId = 0;
ds->rowIdx = 0; ds->rowIdx = 0;
tscTrace("%p load data from disk into memory, orderOfVnode:%d, total:%d", pSql, i + 1, idx + 1); tscDebug("%p load data from disk into memory, orderOfVnode:%d, total:%d", pSql, i + 1, idx + 1);
tExtMemBufferLoadData(pMemBuffer[i], &(ds->filePage), j, 0); tExtMemBufferLoadData(pMemBuffer[i], &(ds->filePage), j, 0);
#ifdef _DEBUG_VIEW #ifdef _DEBUG_VIEW
printf("load data page into mem for build loser tree: %" PRIu64 " rows\n", ds->filePage.num); printf("load data page into mem for build loser tree: %" PRIu64 " rows\n", ds->filePage.num);
...@@ -256,7 +256,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd ...@@ -256,7 +256,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
#endif #endif
if (ds->filePage.num == 0) { // no data in this flush, the index does not increase if (ds->filePage.num == 0) { // no data in this flush, the index does not increase
tscTrace("%p flush data is empty, ignore %d flush record", pSql, idx); tscDebug("%p flush data is empty, ignore %d flush record", pSql, idx);
tfree(ds); tfree(ds);
continue; continue;
} }
...@@ -477,10 +477,10 @@ void tscDestroyLocalReducer(SSqlObj *pSql) { ...@@ -477,10 +477,10 @@ void tscDestroyLocalReducer(SSqlObj *pSql) {
return; return;
} }
tscTrace("%p start to free local reducer", pSql); tscDebug("%p start to free local reducer", pSql);
SSqlRes *pRes = &(pSql->res); SSqlRes *pRes = &(pSql->res);
if (pRes->pLocalReducer == NULL) { if (pRes->pLocalReducer == NULL) {
tscTrace("%p local reducer has been freed, abort", pSql); tscDebug("%p local reducer has been freed, abort", pSql);
return; return;
} }
...@@ -494,7 +494,7 @@ void tscDestroyLocalReducer(SSqlObj *pSql) { ...@@ -494,7 +494,7 @@ void tscDestroyLocalReducer(SSqlObj *pSql) {
while ((status = atomic_val_compare_exchange_32(&pLocalReducer->status, TSC_LOCALREDUCE_READY, while ((status = atomic_val_compare_exchange_32(&pLocalReducer->status, TSC_LOCALREDUCE_READY,
TSC_LOCALREDUCE_TOBE_FREED)) == TSC_LOCALREDUCE_IN_PROGRESS) { TSC_LOCALREDUCE_TOBE_FREED)) == TSC_LOCALREDUCE_IN_PROGRESS) {
taosMsleep(100); taosMsleep(100);
tscTrace("%p waiting for delete procedure, status: %d", pSql, status); tscDebug("%p waiting for delete procedure, status: %d", pSql, status);
} }
pLocalReducer->pFillInfo = taosDestoryFillInfo(pLocalReducer->pFillInfo); pLocalReducer->pFillInfo = taosDestoryFillInfo(pLocalReducer->pFillInfo);
...@@ -543,10 +543,10 @@ void tscDestroyLocalReducer(SSqlObj *pSql) { ...@@ -543,10 +543,10 @@ void tscDestroyLocalReducer(SSqlObj *pSql) {
pLocalReducer->numOfCompleted = 0; pLocalReducer->numOfCompleted = 0;
free(pLocalReducer); free(pLocalReducer);
} else { } else {
tscTrace("%p already freed or another free function is invoked", pSql); tscDebug("%p already freed or another free function is invoked", pSql);
} }
tscTrace("%p free local reducer finished", pSql); tscDebug("%p free local reducer finished", pSql);
} }
static int32_t createOrderDescriptor(tOrderDescriptor **pOrderDesc, SSqlCmd *pCmd, SColumnModel *pModel) { static int32_t createOrderDescriptor(tOrderDescriptor **pOrderDesc, SSqlCmd *pCmd, SColumnModel *pModel) {
...@@ -1407,7 +1407,7 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) { ...@@ -1407,7 +1407,7 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) {
tscResetForNextRetrieve(pRes); tscResetForNextRetrieve(pRes);
if (pSql->signature != pSql || pRes == NULL || pRes->pLocalReducer == NULL) { // all data has been processed if (pSql->signature != pSql || pRes == NULL || pRes->pLocalReducer == NULL) { // all data has been processed
tscTrace("%p %s call the drop local reducer", pSql, __FUNCTION__); tscDebug("%p %s call the drop local reducer", pSql, __FUNCTION__);
tscDestroyLocalReducer(pSql); tscDestroyLocalReducer(pSql);
return 0; return 0;
} }
......
...@@ -1050,7 +1050,7 @@ int tsParseInsertSql(SSqlObj *pSql) { ...@@ -1050,7 +1050,7 @@ int tsParseInsertSql(SSqlObj *pSql) {
str = pCmd->curSql; str = pCmd->curSql;
} }
tscTrace("%p create data block list for submit data:%p, pTableList:%p", pSql, pCmd->pDataBlocks, pCmd->pTableList); tscDebug("%p create data block list for submit data:%p, pTableList:%p", pSql, pCmd->pDataBlocks, pCmd->pTableList);
while (1) { while (1) {
int32_t index = 0; int32_t index = 0;
...@@ -1310,7 +1310,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) { ...@@ -1310,7 +1310,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
if ((!pCmd->parseFinished) && (!initial)) { if ((!pCmd->parseFinished) && (!initial)) {
tscTrace("%p resume to parse sql: %s", pSql, pCmd->curSql); tscDebug("%p resume to parse sql: %s", pSql, pCmd->curSql);
} }
if (tscIsInsertData(pSql->sqlstr)) { if (tscIsInsertData(pSql->sqlstr)) {
......
...@@ -140,7 +140,7 @@ static int normalStmtBindParam(STscStmt* stmt, TAOS_BIND* bind) { ...@@ -140,7 +140,7 @@ static int normalStmtBindParam(STscStmt* stmt, TAOS_BIND* bind) {
break; break;
default: default:
tscTrace("param %d: type mismatch or invalid", i); tscDebug("param %d: type mismatch or invalid", i);
return TSDB_CODE_TSC_INVALID_VALUE; return TSDB_CODE_TSC_INVALID_VALUE;
} }
} }
...@@ -356,7 +356,7 @@ static int insertStmtBindParam(STscStmt* stmt, TAOS_BIND* bind) { ...@@ -356,7 +356,7 @@ static int insertStmtBindParam(STscStmt* stmt, TAOS_BIND* bind) {
SParamInfo* param = pBlock->params + j; SParamInfo* param = pBlock->params + j;
int code = doBindParam(data, param, bind + param->idx); int code = doBindParam(data, param, bind + param->idx);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
tscTrace("param %d: type mismatch or invalid", param->idx); tscDebug("param %d: type mismatch or invalid", param->idx);
return code; return code;
} }
} }
...@@ -538,7 +538,7 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) { ...@@ -538,7 +538,7 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
pRes->numOfRows = 1; pRes->numOfRows = 1;
strtolower(pSql->sqlstr, sql); strtolower(pSql->sqlstr, sql);
tscDump("%p SQL: %s", pSql, pSql->sqlstr); tscDebugDump("%p SQL: %s", pSql, pSql->sqlstr);
if (tscIsInsertData(pSql->sqlstr)) { if (tscIsInsertData(pSql->sqlstr)) {
pStmt->isInsert = true; pStmt->isInsert = true;
......
...@@ -34,7 +34,7 @@ void tscInitConnCb(void *param, TAOS_RES *result, int code) { ...@@ -34,7 +34,7 @@ void tscInitConnCb(void *param, TAOS_RES *result, int code) {
tscSlowQueryConnInitialized = false; tscSlowQueryConnInitialized = false;
free(sql); free(sql);
} else { } else {
tscTrace("taos:%p, slow query connect success, code:%d", tscSlowQueryConn, code); tscDebug("taos:%p, slow query connect success, code:%d", tscSlowQueryConn, code);
tscSlowQueryConnInitialized = true; tscSlowQueryConnInitialized = true;
tscSaveSlowQueryFp(sql, NULL); tscSaveSlowQueryFp(sql, NULL);
} }
...@@ -59,14 +59,14 @@ void tscAddIntoSqlList(SSqlObj *pSql) { ...@@ -59,14 +59,14 @@ void tscAddIntoSqlList(SSqlObj *pSql) {
pSql->stime = taosGetTimestampMs(); pSql->stime = taosGetTimestampMs();
pSql->listed = 1; pSql->listed = 1;
tscTrace("%p added into sqlList", pSql); tscDebug("%p added into sqlList", pSql);
} }
void tscSaveSlowQueryFpCb(void *param, TAOS_RES *result, int code) { void tscSaveSlowQueryFpCb(void *param, TAOS_RES *result, int code) {
if (code < 0) { if (code < 0) {
tscError("failed to save slow query, code:%d", code); tscError("failed to save slow query, code:%d", code);
} else { } else {
tscTrace("success to save slow query, code:%d", code); tscDebug("success to save slow query, code:%d", code);
} }
} }
...@@ -75,14 +75,14 @@ void tscSaveSlowQueryFp(void *handle, void *tmrId) { ...@@ -75,14 +75,14 @@ void tscSaveSlowQueryFp(void *handle, void *tmrId) {
if (!tscSlowQueryConnInitialized) { if (!tscSlowQueryConnInitialized) {
if (tscSlowQueryConn == NULL) { if (tscSlowQueryConn == NULL) {
tscTrace("start to init slow query connect"); tscDebug("start to init slow query connect");
taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, tscInitConnCb, sql, &tscSlowQueryConn); taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, tscInitConnCb, sql, &tscSlowQueryConn);
} else { } else {
tscError("taos:%p, slow query connect is already initialized", tscSlowQueryConn); tscError("taos:%p, slow query connect is already initialized", tscSlowQueryConn);
free(sql); free(sql);
} }
} else { } else {
tscTrace("taos:%p, save slow query:%s", tscSlowQueryConn, sql); tscDebug("taos:%p, save slow query:%s", tscSlowQueryConn, sql);
taos_query_a(tscSlowQueryConn, sql, tscSaveSlowQueryFpCb, NULL); taos_query_a(tscSlowQueryConn, sql, tscSaveSlowQueryFpCb, NULL);
free(sql); free(sql);
} }
...@@ -96,7 +96,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) { ...@@ -96,7 +96,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
return; return;
} }
tscTrace("%p query time:%" PRId64 " sql:%s", pSql, pSql->res.useconds, pSql->sqlstr); tscDebug("%p query time:%" PRId64 " sql:%s", pSql, pSql->res.useconds, pSql->sqlstr);
int32_t sqlSize = TSDB_SLOW_QUERY_SQL_LEN + size; int32_t sqlSize = TSDB_SLOW_QUERY_SQL_LEN + size;
char *sql = malloc(sqlSize); char *sql = malloc(sqlSize);
...@@ -138,7 +138,7 @@ void tscRemoveFromSqlList(SSqlObj *pSql) { ...@@ -138,7 +138,7 @@ void tscRemoveFromSqlList(SSqlObj *pSql) {
pSql->listed = 0; pSql->listed = 0;
tscSaveSlowQuery(pSql); tscSaveSlowQuery(pSql);
tscTrace("%p removed from sqlList", pSql); tscDebug("%p removed from sqlList", pSql);
} }
void tscKillQuery(STscObj *pObj, uint32_t killId) { void tscKillQuery(STscObj *pObj, uint32_t killId) {
...@@ -154,7 +154,7 @@ void tscKillQuery(STscObj *pObj, uint32_t killId) { ...@@ -154,7 +154,7 @@ void tscKillQuery(STscObj *pObj, uint32_t killId) {
if (pSql == NULL) return; if (pSql == NULL) return;
tscTrace("%p query is killed, queryId:%d", pSql, killId); tscDebug("%p query is killed, queryId:%d", pSql, killId);
taos_stop_query(pSql); taos_stop_query(pSql);
} }
...@@ -208,7 +208,7 @@ void tscKillStream(STscObj *pObj, uint32_t killId) { ...@@ -208,7 +208,7 @@ void tscKillStream(STscObj *pObj, uint32_t killId) {
pthread_mutex_unlock(&pObj->mutex); pthread_mutex_unlock(&pObj->mutex);
if (pStream) { if (pStream) {
tscTrace("%p stream:%p is killed, streamId:%d", pStream->pSql, pStream, killId); tscDebug("%p stream:%p is killed, streamId:%d", pStream->pSql, pStream, killId);
if (pStream->callback) { if (pStream->callback) {
pStream->callback(pStream->param); pStream->callback(pStream->param);
} }
...@@ -299,6 +299,6 @@ void tscKillConnection(STscObj *pObj) { ...@@ -299,6 +299,6 @@ void tscKillConnection(STscObj *pObj) {
pthread_mutex_unlock(&pObj->mutex); pthread_mutex_unlock(&pObj->mutex);
tscTrace("connection:%p is killed", pObj); tscDebug("connection:%p is killed", pObj);
taos_close(pObj); taos_close(pObj);
} }
...@@ -4754,7 +4754,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL* ...@@ -4754,7 +4754,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
pQueryInfo->clauseLimit = pQueryInfo->limit.limit; pQueryInfo->clauseLimit = pQueryInfo->limit.limit;
pQueryInfo->slimit = pQuerySql->slimit; pQueryInfo->slimit = pQuerySql->slimit;
tscTrace("%p limit:%" PRId64 ", offset:%" PRId64 " slimit:%" PRId64 ", soffset:%" PRId64, pSql, pQueryInfo->limit.limit, tscDebug("%p limit:%" PRId64 ", offset:%" PRId64 " slimit:%" PRId64 ", soffset:%" PRId64, pSql, pQueryInfo->limit.limit,
pQueryInfo->limit.offset, pQueryInfo->slimit.limit, pQueryInfo->slimit.offset); pQueryInfo->limit.offset, pQueryInfo->slimit.limit, pQueryInfo->slimit.offset);
if (pQueryInfo->slimit.offset < 0 || pQueryInfo->limit.offset < 0) { if (pQueryInfo->slimit.offset < 0 || pQueryInfo->limit.offset < 0) {
...@@ -4762,7 +4762,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL* ...@@ -4762,7 +4762,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
} }
if (pQueryInfo->limit.limit == 0) { if (pQueryInfo->limit.limit == 0) {
tscTrace("%p limit 0, no output result", pSql); tscDebug("%p limit 0, no output result", pSql);
pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT; pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -4784,7 +4784,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL* ...@@ -4784,7 +4784,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
} }
if (pQueryInfo->slimit.limit == 0) { if (pQueryInfo->slimit.limit == 0) {
tscTrace("%p slimit 0, no output result", pSql); tscDebug("%p slimit 0, no output result", pSql);
pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT; pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -4802,7 +4802,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL* ...@@ -4802,7 +4802,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
// No tables included. No results generated. Query results are empty. // No tables included. No results generated. Query results are empty.
if (pTableMetaInfo->vgroupList->numOfVgroups == 0) { if (pTableMetaInfo->vgroupList->numOfVgroups == 0) {
tscTrace("%p no table in super table, no output result", pSql); tscDebug("%p no table in super table, no output result", pSql);
pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT; pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -5522,7 +5522,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) { ...@@ -5522,7 +5522,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
} }
str[offset] = ']'; str[offset] = ']';
tscTrace("%p select clause:%s", pSql, str); tscDebug("%p select clause:%s", pSql, str);
} }
int32_t doCheckForCreateTable(SSqlObj* pSql, int32_t subClauseIndex, SSqlInfo* pInfo) { int32_t doCheckForCreateTable(SSqlObj* pSql, int32_t subClauseIndex, SSqlInfo* pInfo) {
......
...@@ -61,7 +61,7 @@ void tscPrintMgmtIp() { ...@@ -61,7 +61,7 @@ void tscPrintMgmtIp() {
tscError("invalid mnode IP list:%d", tscMgmtIpSet.numOfIps); tscError("invalid mnode IP list:%d", tscMgmtIpSet.numOfIps);
} else { } else {
for (int i = 0; i < tscMgmtIpSet.numOfIps; ++i) { for (int i = 0; i < tscMgmtIpSet.numOfIps; ++i) {
tscTrace("mnode index:%d %s:%d", i, tscMgmtIpSet.fqdn[i], tscMgmtIpSet.port[i]); tscDebug("mnode index:%d %s:%d", i, tscMgmtIpSet.fqdn[i], tscMgmtIpSet.port[i]);
} }
} }
} }
...@@ -76,9 +76,9 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) { ...@@ -76,9 +76,9 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) {
void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) { void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
tscMgmtIpSet = *pIpSet; tscMgmtIpSet = *pIpSet;
tscTrace("mnode IP list is changed for ufp is called, numOfIps:%d inUse:%d", tscMgmtIpSet.numOfIps, tscMgmtIpSet.inUse); tscDebug("mnode IP list is changed for ufp is called, numOfIps:%d inUse:%d", tscMgmtIpSet.numOfIps, tscMgmtIpSet.inUse);
for (int32_t i = 0; i < tscMgmtIpSet.numOfIps; ++i) { for (int32_t i = 0; i < tscMgmtIpSet.numOfIps; ++i) {
tscTrace("index:%d fqdn:%s port:%d", i, tscMgmtIpSet.fqdn[i], tscMgmtIpSet.port[i]); tscDebug("index:%d fqdn:%s port:%d", i, tscMgmtIpSet.fqdn[i], tscMgmtIpSet.port[i]);
} }
} }
...@@ -121,7 +121,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) { ...@@ -121,7 +121,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
if (pRsp->streamId) tscKillStream(pObj, htonl(pRsp->streamId)); if (pRsp->streamId) tscKillStream(pObj, htonl(pRsp->streamId));
} }
} else { } else {
tscTrace("heart beat failed, code:%s", tstrerror(code)); tscDebug("heart beat failed, code:%s", tstrerror(code));
} }
taosTmrReset(tscProcessActivityTimer, tsShellActivityTimer * 500, pObj, tscTmr, &pObj->pTimer); taosTmrReset(tscProcessActivityTimer, tsShellActivityTimer * 500, pObj, tscTmr, &pObj->pTimer);
...@@ -157,11 +157,11 @@ void tscProcessActivityTimer(void *handle, void *tmrId) { ...@@ -157,11 +157,11 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
pObj->pHb = pSql; pObj->pHb = pSql;
tscAddSubqueryInfo(&pObj->pHb->cmd); tscAddSubqueryInfo(&pObj->pHb->cmd);
tscTrace("%p pHb is allocated, pObj:%p", pObj->pHb, pObj); tscDebug("%p pHb is allocated, pObj:%p", pObj->pHb, pObj);
} }
if (tscShouldFreeHeatBeat(pObj->pHb)) { if (tscShouldFreeHeatBeat(pObj->pHb)) {
tscTrace("%p free HB object and release connection", pObj); tscDebug("%p free HB object and release connection", pObj);
tscFreeSqlObj(pObj->pHb); tscFreeSqlObj(pObj->pHb);
tscCloseTscObj(pObj); tscCloseTscObj(pObj);
return; return;
...@@ -215,7 +215,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { ...@@ -215,7 +215,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
if (pObj->signature != pObj) { if (pObj->signature != pObj) {
tscTrace("%p DB connection is closed, cmd:%d pObj:%p signature:%p", pSql, pCmd->command, pObj, pObj->signature); tscDebug("%p DB connection is closed, cmd:%d pObj:%p signature:%p", pSql, pCmd->command, pObj, pObj->signature);
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
rpcFreeCont(rpcMsg->pCont); rpcFreeCont(rpcMsg->pCont);
...@@ -224,7 +224,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { ...@@ -224,7 +224,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
if (pQueryInfo != NULL && pQueryInfo->type == TSDB_QUERY_TYPE_FREE_RESOURCE) { if (pQueryInfo != NULL && pQueryInfo->type == TSDB_QUERY_TYPE_FREE_RESOURCE) {
tscTrace("%p sqlObj needs to be released or DB connection is closed, cmd:%d type:%d, pObj:%p signature:%p", tscDebug("%p sqlObj needs to be released or DB connection is closed, cmd:%d type:%d, pObj:%p signature:%p",
pSql, pCmd->command, pQueryInfo->type, pObj, pObj->signature); pSql, pCmd->command, pQueryInfo->type, pObj, pObj->signature);
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
...@@ -279,11 +279,11 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { ...@@ -279,11 +279,11 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
if (pRes->code != TSDB_CODE_TSC_QUERY_CANCELLED) { if (pRes->code != TSDB_CODE_TSC_QUERY_CANCELLED) {
pRes->code = (rpcMsg->code != TSDB_CODE_SUCCESS) ? rpcMsg->code : TSDB_CODE_RPC_NETWORK_UNAVAIL; pRes->code = (rpcMsg->code != TSDB_CODE_SUCCESS) ? rpcMsg->code : TSDB_CODE_RPC_NETWORK_UNAVAIL;
} else { } else {
tscTrace("%p query is cancelled, code:%s", pSql, tstrerror(pRes->code)); tscDebug("%p query is cancelled, code:%s", pSql, tstrerror(pRes->code));
} }
if (pRes->code == TSDB_CODE_SUCCESS) { if (pRes->code == TSDB_CODE_SUCCESS) {
tscTrace("%p reset retry counter to be 0 due to success rsp, old:%d", pSql, pSql->retry); tscDebug("%p reset retry counter to be 0 due to success rsp, old:%d", pSql, pSql->retry);
pSql->retry = 0; pSql->retry = 0;
} }
...@@ -318,10 +318,10 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { ...@@ -318,10 +318,10 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
pMsg->numOfFailedBlocks = htonl(pMsg->numOfFailedBlocks); pMsg->numOfFailedBlocks = htonl(pMsg->numOfFailedBlocks);
pRes->numOfRows += pMsg->affectedRows; pRes->numOfRows += pMsg->affectedRows;
tscTrace("%p SQL cmd:%s, code:%s inserted rows:%d rspLen:%d", pSql, sqlCmd[pCmd->command], tscDebug("%p SQL cmd:%s, code:%s inserted rows:%d rspLen:%d", pSql, sqlCmd[pCmd->command],
tstrerror(pRes->code), pMsg->affectedRows, pRes->rspLen); tstrerror(pRes->code), pMsg->affectedRows, pRes->rspLen);
} else { } else {
tscTrace("%p SQL cmd:%s, code:%s rspLen:%d", pSql, sqlCmd[pCmd->command], tstrerror(pRes->code), pRes->rspLen); tscDebug("%p SQL cmd:%s, code:%s rspLen:%d", pSql, sqlCmd[pCmd->command], tstrerror(pRes->code), pRes->rspLen);
} }
} }
...@@ -336,7 +336,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { ...@@ -336,7 +336,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
(*pSql->fp)(pSql->param, pSql, rpcMsg->code); (*pSql->fp)(pSql->param, pSql, rpcMsg->code);
if (shouldFree) { if (shouldFree) {
tscTrace("%p sqlObj is automatically freed", pSql); tscDebug("%p sqlObj is automatically freed", pSql);
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
} }
} }
...@@ -394,7 +394,7 @@ int tscProcessSql(SSqlObj *pSql) { ...@@ -394,7 +394,7 @@ int tscProcessSql(SSqlObj *pSql) {
assert((pQueryInfo->numOfTables == 0 && pQueryInfo->command == TSDB_SQL_HB) || pQueryInfo->numOfTables > 0); assert((pQueryInfo->numOfTables == 0 && pQueryInfo->command == TSDB_SQL_HB) || pQueryInfo->numOfTables > 0);
} }
tscTrace("%p SQL cmd:%s will be processed, name:%s, type:%d", pSql, sqlCmd[pCmd->command], name, type); tscDebug("%p SQL cmd:%s will be processed, name:%s, type:%d", pSql, sqlCmd[pCmd->command], name, type);
if (pCmd->command < TSDB_SQL_MGMT) { // the pTableMetaInfo cannot be NULL if (pCmd->command < TSDB_SQL_MGMT) { // the pTableMetaInfo cannot be NULL
if (pTableMetaInfo == NULL) { if (pTableMetaInfo == NULL) {
pSql->res.code = TSDB_CODE_TSC_APP_ERROR; pSql->res.code = TSDB_CODE_TSC_APP_ERROR;
...@@ -447,7 +447,7 @@ void tscKillSTableQuery(SSqlObj *pSql) { ...@@ -447,7 +447,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
} }
} }
tscTrace("%p super table query cancelled", pSql); tscDebug("%p super table query cancelled", pSql);
} }
int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...@@ -504,7 +504,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -504,7 +504,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pSql->cmd.msgType = TSDB_MSG_TYPE_SUBMIT; pSql->cmd.msgType = TSDB_MSG_TYPE_SUBMIT;
tscSetDnodeIpList(pSql, &pTableMeta->vgroupInfo); tscSetDnodeIpList(pSql, &pTableMeta->vgroupInfo);
tscTrace("%p build submit msg, vgId:%d numOfTables:%d numberOfIP:%d", pSql, vgId, pSql->cmd.numOfTablesInSubmit, tscDebug("%p build submit msg, vgId:%d numOfTables:%d numberOfIP:%d", pSql, vgId, pSql->cmd.numOfTablesInSubmit,
pSql->ipList.numOfIps); pSql->ipList.numOfIps);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -537,7 +537,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char ...@@ -537,7 +537,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
assert(index >= 0); assert(index >= 0);
pVgroupInfo = &pTableMetaInfo->vgroupList->vgroups[index]; pVgroupInfo = &pTableMetaInfo->vgroupList->vgroups[index];
tscTrace("%p query on stable, vgIndex:%d, numOfVgroups:%d", pSql, index, pTableMetaInfo->vgroupList->numOfVgroups); tscDebug("%p query on stable, vgIndex:%d, numOfVgroups:%d", pSql, index, pTableMetaInfo->vgroupList->numOfVgroups);
} else { } else {
pVgroupInfo = &pTableMeta->vgroupInfo; pVgroupInfo = &pTableMeta->vgroupInfo;
} }
...@@ -557,7 +557,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char ...@@ -557,7 +557,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
int32_t numOfVgroups = taosArrayGetSize(pTableMetaInfo->pVgroupTables); int32_t numOfVgroups = taosArrayGetSize(pTableMetaInfo->pVgroupTables);
assert(index >= 0 && index < numOfVgroups); assert(index >= 0 && index < numOfVgroups);
tscTrace("%p query on stable, vgIndex:%d, numOfVgroups:%d", pSql, index, numOfVgroups); tscDebug("%p query on stable, vgIndex:%d, numOfVgroups:%d", pSql, index, numOfVgroups);
SVgroupTableInfo* pTableIdList = taosArrayGet(pTableMetaInfo->pVgroupTables, index); SVgroupTableInfo* pTableIdList = taosArrayGet(pTableMetaInfo->pVgroupTables, index);
...@@ -580,7 +580,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char ...@@ -580,7 +580,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
} }
} }
tscTrace("%p vgId:%d, query on table:%s, tid:%d, uid:%" PRIu64, pSql, htonl(pQueryMsg->head.vgId), pTableMetaInfo->name, tscDebug("%p vgId:%d, query on table:%s, tid:%d, uid:%" PRIu64, pSql, htonl(pQueryMsg->head.vgId), pTableMetaInfo->name,
pTableMeta->sid, pTableMeta->uid); pTableMeta->sid, pTableMeta->uid);
return pMsg; return pMsg;
...@@ -849,7 +849,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -849,7 +849,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t msgLen = pMsg - pCmd->payload; int32_t msgLen = pMsg - pCmd->payload;
tscTrace("%p msg built success,len:%d bytes", pSql, msgLen); tscDebug("%p msg built success,len:%d bytes", pSql, msgLen);
pCmd->payloadLen = msgLen; pCmd->payloadLen = msgLen;
pSql->cmd.msgType = TSDB_MSG_TYPE_QUERY; pSql->cmd.msgType = TSDB_MSG_TYPE_QUERY;
...@@ -1521,7 +1521,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1521,7 +1521,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
assert(pCmd->payloadLen + minMsgSize() <= pCmd->allocSize); assert(pCmd->payloadLen + minMsgSize() <= pCmd->allocSize);
tscTrace("%p build load multi-metermeta msg completed, numOfTables:%d, msg size:%d", pSql, pCmd->count, tscDebug("%p build load multi-metermeta msg completed, numOfTables:%d, msg size:%d", pSql, pCmd->count,
pCmd->payloadLen); pCmd->payloadLen);
return pCmd->payloadLen; return pCmd->payloadLen;
...@@ -1681,7 +1681,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) { ...@@ -1681,7 +1681,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_TSC_OUT_OF_MEMORY;
} }
tscTrace("%p recv table meta, uid:%"PRId64 ", tid:%d, name:%s", pSql, pTableMeta->uid, pTableMeta->sid, pTableMetaInfo->name); tscDebug("%p recv table meta, uid:%"PRId64 ", tid:%d, name:%s", pSql, pTableMeta->uid, pTableMeta->sid, pTableMetaInfo->name);
free(pTableMeta); free(pTableMeta);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -1790,7 +1790,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) { ...@@ -1790,7 +1790,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
pSql->res.code = TSDB_CODE_SUCCESS; pSql->res.code = TSDB_CODE_SUCCESS;
pSql->res.numOfTotal = i; pSql->res.numOfTotal = i;
tscTrace("%p load multi-metermeta resp from complete num:%d", pSql, pSql->res.numOfTotal); tscDebug("%p load multi-metermeta resp from complete num:%d", pSql, pSql->res.numOfTotal);
#endif #endif
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -1959,7 +1959,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) { ...@@ -1959,7 +1959,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) {
* The cached information is expired, however, we may have lost the ref of original meter. So, clear whole cache * The cached information is expired, however, we may have lost the ref of original meter. So, clear whole cache
* instead. * instead.
*/ */
tscTrace("%p force release table meta after drop table:%s", pSql, pTableMetaInfo->name); tscDebug("%p force release table meta after drop table:%s", pSql, pTableMetaInfo->name);
taosCacheRelease(tscCacheHandle, (void **)&pTableMeta, true); taosCacheRelease(tscCacheHandle, (void **)&pTableMeta, true);
if (pTableMetaInfo->pTableMeta) { if (pTableMetaInfo->pTableMeta) {
...@@ -1977,7 +1977,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) { ...@@ -1977,7 +1977,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
return 0; return 0;
} }
tscTrace("%p force release metermeta in cache after alter-table: %s", pSql, pTableMetaInfo->name); tscDebug("%p force release metermeta in cache after alter-table: %s", pSql, pTableMetaInfo->name);
taosCacheRelease(tscCacheHandle, (void **)&pTableMeta, true); taosCacheRelease(tscCacheHandle, (void **)&pTableMeta, true);
if (pTableMetaInfo->pTableMeta) { if (pTableMetaInfo->pTableMeta) {
...@@ -1985,7 +1985,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) { ...@@ -1985,7 +1985,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
taosCacheRelease(tscCacheHandle, (void **)&(pTableMetaInfo->pTableMeta), true); taosCacheRelease(tscCacheHandle, (void **)&(pTableMetaInfo->pTableMeta), true);
if (isSuperTable) { // if it is a super table, reset whole query cache if (isSuperTable) { // if it is a super table, reset whole query cache
tscTrace("%p reset query cache since table:%s is stable", pSql, pTableMetaInfo->name); tscDebug("%p reset query cache since table:%s is stable", pSql, pTableMetaInfo->name);
taosCacheEmpty(tscCacheHandle); taosCacheEmpty(tscCacheHandle);
} }
} }
...@@ -2049,7 +2049,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) { ...@@ -2049,7 +2049,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
} }
pRes->row = 0; pRes->row = 0;
tscTrace("%p numOfRows:%" PRId64 ", offset:%" PRId64 ", complete:%d", pSql, pRes->numOfRows, pRes->offset, pRes->completed); tscDebug("%p numOfRows:%" PRId64 ", offset:%" PRId64 ", complete:%d", pSql, pRes->numOfRows, pRes->offset, pRes->completed);
return 0; return 0;
} }
...@@ -2101,7 +2101,7 @@ static int32_t getTableMetaFromMgmt(SSqlObj *pSql, STableMetaInfo *pTableMetaInf ...@@ -2101,7 +2101,7 @@ static int32_t getTableMetaFromMgmt(SSqlObj *pSql, STableMetaInfo *pTableMetaInf
tstrncpy(pNewMeterMetaInfo->name, pTableMetaInfo->name, sizeof(pNewMeterMetaInfo->name)); tstrncpy(pNewMeterMetaInfo->name, pTableMetaInfo->name, sizeof(pNewMeterMetaInfo->name));
memcpy(pNew->cmd.payload, pSql->cmd.payload, pSql->cmd.payloadLen); // tag information if table does not exists. memcpy(pNew->cmd.payload, pSql->cmd.payload, pSql->cmd.payloadLen); // tag information if table does not exists.
pNew->cmd.payloadLen = pSql->cmd.payloadLen; pNew->cmd.payloadLen = pSql->cmd.payloadLen;
tscTrace("%p new pSqlObj:%p to get tableMeta, auto create:%d", pSql, pNew, pNew->cmd.autoCreated); tscDebug("%p new pSqlObj:%p to get tableMeta, auto create:%d", pSql, pNew, pNew->cmd.autoCreated);
pNew->fp = tscTableMetaCallBack; pNew->fp = tscTableMetaCallBack;
pNew->param = pSql; pNew->param = pSql;
...@@ -2125,7 +2125,7 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) { ...@@ -2125,7 +2125,7 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) {
pTableMetaInfo->pTableMeta = (STableMeta *)taosCacheAcquireByName(tscCacheHandle, pTableMetaInfo->name); pTableMetaInfo->pTableMeta = (STableMeta *)taosCacheAcquireByName(tscCacheHandle, pTableMetaInfo->name);
if (pTableMetaInfo->pTableMeta != NULL) { if (pTableMetaInfo->pTableMeta != NULL) {
STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta); STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta);
tscTrace("%p retrieve table Meta from cache, the number of columns:%d, numOfTags:%d, %p", pSql, tinfo.numOfColumns, tscDebug("%p retrieve table Meta from cache, the number of columns:%d, numOfTags:%d, %p", pSql, tinfo.numOfColumns,
tinfo.numOfTags, pTableMetaInfo->pTableMeta); tinfo.numOfTags, pTableMetaInfo->pTableMeta);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -2153,7 +2153,7 @@ int tscRenewTableMeta(SSqlObj *pSql, char *tableId) { ...@@ -2153,7 +2153,7 @@ int tscRenewTableMeta(SSqlObj *pSql, char *tableId) {
STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; STableMeta* pTableMeta = pTableMetaInfo->pTableMeta;
if (pTableMetaInfo->pTableMeta) { if (pTableMetaInfo->pTableMeta) {
tscTrace("%p update table meta, old meta numOfTags:%d, numOfCols:%d, uid:%" PRId64 ", addr:%p", pSql, tscDebug("%p update table meta, old meta numOfTags:%d, numOfCols:%d, uid:%" PRId64 ", addr:%p", pSql,
tscGetNumOfTags(pTableMeta), tscGetNumOfColumns(pTableMeta), pTableMeta->uid, pTableMeta); tscGetNumOfTags(pTableMeta), tscGetNumOfColumns(pTableMeta), pTableMeta->uid, pTableMeta);
} }
...@@ -2207,7 +2207,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) { ...@@ -2207,7 +2207,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
} }
pNewQueryInfo->numOfTables = pQueryInfo->numOfTables; pNewQueryInfo->numOfTables = pQueryInfo->numOfTables;
tscTrace("%p new sqlObj:%p to get vgroupInfo, numOfTables:%d", pSql, pNew, pNewQueryInfo->numOfTables); tscDebug("%p new sqlObj:%p to get vgroupInfo, numOfTables:%d", pSql, pNew, pNewQueryInfo->numOfTables);
pNew->fp = tscTableMetaCallBack; pNew->fp = tscTableMetaCallBack;
pNew->param = pSql; pNew->param = pSql;
......
...@@ -145,7 +145,7 @@ static void syncConnCallback(void *param, TAOS_RES *tres, int code) { ...@@ -145,7 +145,7 @@ static void syncConnCallback(void *param, TAOS_RES *tres, int code) {
} }
TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) { TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) {
tscTrace("try to create a connection to %s:%u, user:%s db:%s", ip, port, user, db); tscDebug("try to create a connection to %s:%u, user:%s db:%s", ip, port, user, db);
if (user == NULL) user = TSDB_DEFAULT_USER; if (user == NULL) user = TSDB_DEFAULT_USER;
if (pass == NULL) pass = TSDB_DEFAULT_PASS; if (pass == NULL) pass = TSDB_DEFAULT_PASS;
...@@ -165,7 +165,7 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha ...@@ -165,7 +165,7 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha
return NULL; return NULL;
} }
tscTrace("%p DB connection is opening, dnodeConn:%p", pObj, pObj->pDnodeConn); tscDebug("%p DB connection is opening, dnodeConn:%p", pObj, pObj->pDnodeConn);
taos_free_result(pSql); taos_free_result(pSql);
// version compare only requires the first 3 segments of the version string // version compare only requires the first 3 segments of the version string
...@@ -190,7 +190,7 @@ TAOS *taos_connect_a(char *ip, char *user, char *pass, char *db, uint16_t port, ...@@ -190,7 +190,7 @@ TAOS *taos_connect_a(char *ip, char *user, char *pass, char *db, uint16_t port,
} }
pSql->res.code = tscProcessSql(pSql); pSql->res.code = tscProcessSql(pSql);
tscTrace("%p DB async connection is opening", taos); tscDebug("%p DB async connection is opening", taos);
return taos; return taos;
} }
...@@ -441,7 +441,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) { ...@@ -441,7 +441,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
assert(pSql->fp == NULL); assert(pSql->fp == NULL);
tscTrace("%p try data in the next subclause:%d, total subclause:%d", pSql, pCmd->clauseIndex, pCmd->numOfClause); tscDebug("%p try data in the next subclause:%d, total subclause:%d", pSql, pCmd->clauseIndex, pCmd->numOfClause);
tscProcessSql(pSql); tscProcessSql(pSql);
nRows = taos_fetch_block_impl(res, rows); nRows = taos_fetch_block_impl(res, rows);
...@@ -487,7 +487,7 @@ static bool tscFreeQhandleInVnode(SSqlObj* pSql) { ...@@ -487,7 +487,7 @@ static bool tscFreeQhandleInVnode(SSqlObj* pSql) {
(pCmd->command == TSDB_SQL_SELECT && pSql->pStream == NULL && pTableMetaInfo->pTableMeta != NULL)) { (pCmd->command == TSDB_SQL_SELECT && pSql->pStream == NULL && pTableMetaInfo->pTableMeta != NULL)) {
pCmd->command = (pCmd->command > TSDB_SQL_MGMT) ? TSDB_SQL_RETRIEVE : TSDB_SQL_FETCH; pCmd->command = (pCmd->command > TSDB_SQL_MGMT) ? TSDB_SQL_RETRIEVE : TSDB_SQL_FETCH;
tscTrace("%p send msg to dnode to free qhandle ASAP, command:%s", pSql, sqlCmd[pCmd->command]); tscDebug("%p send msg to dnode to free qhandle ASAP, command:%s", pSql, sqlCmd[pCmd->command]);
tscProcessSql(pSql); tscProcessSql(pSql);
// in case of sync model query, waits for response and then goes on // in case of sync model query, waits for response and then goes on
...@@ -495,9 +495,9 @@ static bool tscFreeQhandleInVnode(SSqlObj* pSql) { ...@@ -495,9 +495,9 @@ static bool tscFreeQhandleInVnode(SSqlObj* pSql) {
// sem_wait(&pSql->rspSem); // sem_wait(&pSql->rspSem);
// tscFreeSqlObj(pSql); // tscFreeSqlObj(pSql);
// tscTrace("%p sqlObj is freed by app", pSql); // tscDebug("%p sqlObj is freed by app", pSql);
// } else { // } else {
tscTrace("%p sqlObj will be freed while rsp received", pSql); tscDebug("%p sqlObj will be freed while rsp received", pSql);
// } // }
return true; return true;
...@@ -510,7 +510,7 @@ void taos_free_result(TAOS_RES *res) { ...@@ -510,7 +510,7 @@ void taos_free_result(TAOS_RES *res) {
SSqlObj *pSql = (SSqlObj *)res; SSqlObj *pSql = (SSqlObj *)res;
if (pSql == NULL || pSql->signature != pSql) { if (pSql == NULL || pSql->signature != pSql) {
tscTrace("%p sqlObj has been freed", pSql); tscDebug("%p sqlObj has been freed", pSql);
return; return;
} }
...@@ -518,7 +518,7 @@ void taos_free_result(TAOS_RES *res) { ...@@ -518,7 +518,7 @@ void taos_free_result(TAOS_RES *res) {
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
if (pRes == NULL || pRes->qhandle == 0) { if (pRes == NULL || pRes->qhandle == 0) {
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
tscTrace("%p SqlObj is freed by app, qhandle is null", pSql); tscDebug("%p SqlObj is freed by app, qhandle is null", pSql);
return; return;
} }
...@@ -526,14 +526,14 @@ void taos_free_result(TAOS_RES *res) { ...@@ -526,14 +526,14 @@ void taos_free_result(TAOS_RES *res) {
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
if (pQueryInfo == NULL) { if (pQueryInfo == NULL) {
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
tscTrace("%p SqlObj is freed by app", pSql); tscDebug("%p SqlObj is freed by app", pSql);
return; return;
} }
pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE; pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE;
if (!tscFreeQhandleInVnode(pSql)) { if (!tscFreeQhandleInVnode(pSql)) {
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
tscTrace("%p sqlObj is freed by app", pSql); tscDebug("%p sqlObj is freed by app", pSql);
} }
} }
...@@ -615,7 +615,7 @@ void taos_stop_query(TAOS_RES *res) { ...@@ -615,7 +615,7 @@ void taos_stop_query(TAOS_RES *res) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
if (pSql->signature != pSql) return; if (pSql->signature != pSql) return;
tscTrace("%p start to cancel query", res); tscDebug("%p start to cancel query", res);
pSql->res.code = TSDB_CODE_TSC_QUERY_CANCELLED; pSql->res.code = TSDB_CODE_TSC_QUERY_CANCELLED;
...@@ -630,7 +630,7 @@ void taos_stop_query(TAOS_RES *res) { ...@@ -630,7 +630,7 @@ void taos_stop_query(TAOS_RES *res) {
} }
rpcCancelRequest(pSql->pRpcCtx); rpcCancelRequest(pSql->pRpcCtx);
tscTrace("%p query is cancelled", res); tscDebug("%p query is cancelled", res);
} }
int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) { int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) {
...@@ -714,7 +714,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) { ...@@ -714,7 +714,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pRes->numOfTotal = 0; pRes->numOfTotal = 0;
pRes->numOfClauseTotal = 0; pRes->numOfClauseTotal = 0;
tscTrace("%p Valid SQL: %s pObj:%p", pSql, sql, pObj); tscDebug("%p Valid SQL: %s pObj:%p", pSql, sql, pObj);
int32_t sqlLen = strlen(sql); int32_t sqlLen = strlen(sql);
if (sqlLen > tsMaxSQLStringLen) { if (sqlLen > tsMaxSQLStringLen) {
...@@ -728,7 +728,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) { ...@@ -728,7 +728,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
if (pSql->sqlstr == NULL) { if (pSql->sqlstr == NULL) {
pRes->code = TSDB_CODE_TSC_OUT_OF_MEMORY; pRes->code = TSDB_CODE_TSC_OUT_OF_MEMORY;
tscError("%p failed to malloc sql string buffer", pSql); tscError("%p failed to malloc sql string buffer", pSql);
tscTrace("%p Valid SQL result:%d, %s pObj:%p", pSql, pRes->code, taos_errstr(taos), pObj); tscDebug("%p Valid SQL result:%d, %s pObj:%p", pSql, pRes->code, taos_errstr(taos), pObj);
tfree(pSql); tfree(pSql);
return pRes->code; return pRes->code;
} }
...@@ -744,7 +744,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) { ...@@ -744,7 +744,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pRes->code = (uint8_t)tsParseSql(pSql, false); pRes->code = (uint8_t)tsParseSql(pSql, false);
int code = pRes->code; int code = pRes->code;
tscTrace("%p Valid SQL result:%d, %s pObj:%p", pSql, pRes->code, taos_errstr(taos), pObj); tscDebug("%p Valid SQL result:%d, %s pObj:%p", pSql, pRes->code, taos_errstr(taos), pObj);
taos_free_result(pSql); taos_free_result(pSql);
return code; return code;
...@@ -848,7 +848,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) { ...@@ -848,7 +848,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
pRes->code = 0; pRes->code = 0;
assert(pSql->fp == NULL); assert(pSql->fp == NULL);
tscTrace("%p tableNameList: %s pObj:%p", pSql, tableNameList, pObj); tscDebug("%p tableNameList: %s pObj:%p", pSql, tableNameList, pObj);
int32_t tblListLen = strlen(tableNameList); int32_t tblListLen = strlen(tableNameList);
if (tblListLen > MAX_TABLE_NAME_LENGTH) { if (tblListLen > MAX_TABLE_NAME_LENGTH) {
...@@ -884,7 +884,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) { ...@@ -884,7 +884,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
tscDoQuery(pSql); tscDoQuery(pSql);
tscTrace("%p load multi metermeta result:%d %s pObj:%p", pSql, pRes->code, taos_errstr(taos), pObj); tscDebug("%p load multi metermeta result:%d %s pObj:%p", pSql, pRes->code, taos_errstr(taos), pObj);
if (pRes->code != TSDB_CODE_SUCCESS) { if (pRes->code != TSDB_CODE_SUCCESS) {
tscPartiallyFreeSqlObj(pSql); tscPartiallyFreeSqlObj(pSql);
} }
......
...@@ -91,7 +91,7 @@ static void tscProcessStreamLaunchQuery(SSchedMsg *pMsg) { ...@@ -91,7 +91,7 @@ static void tscProcessStreamLaunchQuery(SSchedMsg *pMsg) {
} else { } else {
tscTansformSQLFuncForSTableQuery(pQueryInfo); tscTansformSQLFuncForSTableQuery(pQueryInfo);
tscTrace("%p stream:%p start stream query on:%s", pSql, pStream, pTableMetaInfo->name); tscDebug("%p stream:%p start stream query on:%s", pSql, pStream, pTableMetaInfo->name);
tscDoQuery(pStream->pSql); tscDoQuery(pStream->pSql);
tscIncStreamExecutionCount(pStream); tscIncStreamExecutionCount(pStream);
} }
...@@ -106,7 +106,7 @@ static void tscProcessStreamTimer(void *handle, void *tmrId) { ...@@ -106,7 +106,7 @@ static void tscProcessStreamTimer(void *handle, void *tmrId) {
pStream->numOfRes = 0; // reset the numOfRes. pStream->numOfRes = 0; // reset the numOfRes.
SSqlObj *pSql = pStream->pSql; SSqlObj *pSql = pStream->pSql;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
tscTrace("%p add into timer", pSql); tscDebug("%p add into timer", pSql);
if (isProjectStream(pQueryInfo)) { if (isProjectStream(pQueryInfo)) {
/* /*
...@@ -184,7 +184,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf ...@@ -184,7 +184,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
for(int32_t i = 0; i < numOfRows; ++i) { for(int32_t i = 0; i < numOfRows; ++i) {
TAOS_ROW row = taos_fetch_row(res); TAOS_ROW row = taos_fetch_row(res);
tscTrace("%p stream:%p fetch result", pSql, pStream); tscDebug("%p stream:%p fetch result", pSql, pStream);
if (isProjectStream(pQueryInfo)) { if (isProjectStream(pQueryInfo)) {
pStream->stime = *(TSKEY *)row[0]; pStream->stime = *(TSKEY *)row[0];
} else { } else {
...@@ -227,8 +227,8 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf ...@@ -227,8 +227,8 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
// char result[512] = {0}; // char result[512] = {0};
// taos_print_row(result, row, pQueryInfo->fieldsInfo.pFields, pQueryInfo->fieldsInfo.numOfOutput); // taos_print_row(result, row, pQueryInfo->fieldsInfo.pFields, pQueryInfo->fieldsInfo.numOfOutput);
// tscPrint("%p stream:%p query result: %s", pSql, pStream, result); // tscInfo("%p stream:%p query result: %s", pSql, pStream, result);
tscTrace("%p stream:%p fetch result", pSql, pStream); tscDebug("%p stream:%p fetch result", pSql, pStream);
// user callback function // user callback function
(*pStream->fp)(pStream->param, res, row); (*pStream->fp)(pStream->param, res, row);
...@@ -250,7 +250,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf ...@@ -250,7 +250,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
} }
} }
tscTrace("%p stream:%p, query on:%s, fetch result completed, fetched rows:%" PRId64, pSql, pStream, pTableMetaInfo->name, tscDebug("%p stream:%p, query on:%s, fetch result completed, fetched rows:%" PRId64, pSql, pStream, pTableMetaInfo->name,
pStream->numOfRes); pStream->numOfRes);
// release the metric/meter meta information reference, so data in cache can be updated // release the metric/meter meta information reference, so data in cache can be updated
...@@ -273,7 +273,7 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer) ...@@ -273,7 +273,7 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
/* /*
* current time window will be closed, since it too early to exceed the maxRetentWindow value * current time window will be closed, since it too early to exceed the maxRetentWindow value
*/ */
tscTrace("%p stream:%p, etime:%" PRId64 " is too old, exceeds the max retention time window:%" PRId64 ", stop the stream", tscDebug("%p stream:%p, etime:%" PRId64 " is too old, exceeds the max retention time window:%" PRId64 ", stop the stream",
pStream->pSql, pStream, pStream->stime, pStream->etime); pStream->pSql, pStream, pStream->stime, pStream->etime);
// TODO : How to terminate stream here // TODO : How to terminate stream here
if (pStream->callback) { if (pStream->callback) {
...@@ -284,10 +284,10 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer) ...@@ -284,10 +284,10 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
return; return;
} }
tscTrace("%p stream:%p, next start at %" PRId64 ", in %" PRId64 "ms. delay:%" PRId64 "ms qrange %" PRId64 "-%" PRId64, pStream->pSql, pStream, tscDebug("%p stream:%p, next start at %" PRId64 ", in %" PRId64 "ms. delay:%" PRId64 "ms qrange %" PRId64 "-%" PRId64, pStream->pSql, pStream,
now + timer, timer, delay, pStream->stime, etime); now + timer, timer, delay, pStream->stime, etime);
} else { } else {
tscTrace("%p stream:%p, next start at %" PRId64 ", in %" PRId64 "ms. delay:%" PRId64 "ms qrange %" PRId64 "-%" PRId64, pStream->pSql, pStream, tscDebug("%p stream:%p, next start at %" PRId64 ", in %" PRId64 "ms. delay:%" PRId64 "ms qrange %" PRId64 "-%" PRId64, pStream->pSql, pStream,
pStream->stime, timer, delay, pStream->stime - pStream->interval, pStream->stime - 1); pStream->stime, timer, delay, pStream->stime - pStream->interval, pStream->stime - 1);
} }
...@@ -331,7 +331,7 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) { ...@@ -331,7 +331,7 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
*/ */
timer = pStream->slidingTime; timer = pStream->slidingTime;
if (pStream->stime > pStream->etime) { if (pStream->stime > pStream->etime) {
tscTrace("%p stream:%p, stime:%" PRId64 " is larger than end time: %" PRId64 ", stop the stream", pStream->pSql, pStream, tscDebug("%p stream:%p, stime:%" PRId64 " is larger than end time: %" PRId64 ", stop the stream", pStream->pSql, pStream,
pStream->stime, pStream->etime); pStream->stime, pStream->etime);
// TODO : How to terminate stream here // TODO : How to terminate stream here
if (pStream->callback) { if (pStream->callback) {
...@@ -344,7 +344,7 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) { ...@@ -344,7 +344,7 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
} else { } else {
pStream->stime += pStream->slidingTime; pStream->stime += pStream->slidingTime;
if ((pStream->stime - pStream->interval) >= pStream->etime) { if ((pStream->stime - pStream->interval) >= pStream->etime) {
tscTrace("%p stream:%p, stime:%" PRId64 " is larger than end time: %" PRId64 ", stop the stream", pStream->pSql, pStream, tscDebug("%p stream:%p, stime:%" PRId64 " is larger than end time: %" PRId64 ", stop the stream", pStream->pSql, pStream,
pStream->stime, pStream->etime); pStream->stime, pStream->etime);
// TODO : How to terminate stream here // TODO : How to terminate stream here
if (pStream->callback) { if (pStream->callback) {
...@@ -503,7 +503,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p ...@@ -503,7 +503,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
} }
strtolower(pSql->sqlstr, sqlstr); strtolower(pSql->sqlstr, sqlstr);
tscDump("%p SQL: %s", pSql, pSql->sqlstr); tscDebugDump("%p SQL: %s", pSql, pSql->sqlstr);
tsem_init(&pSql->rspSem, 0, 0); tsem_init(&pSql->rspSem, 0, 0);
int32_t code = tsParseSql(pSql, true); int32_t code = tsParseSql(pSql, true);
...@@ -541,7 +541,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p ...@@ -541,7 +541,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
pCmd->command = TSDB_SQL_SELECT; pCmd->command = TSDB_SQL_SELECT;
taosTmrReset(tscProcessStreamTimer, starttime, pStream, tscTmr, &pStream->pTimer); taosTmrReset(tscProcessStreamTimer, starttime, pStream, tscTmr, &pStream->pTimer);
tscTrace("%p stream:%p is opened, query on:%s, interval:%" PRId64 ", sliding:%" PRId64 ", first launched in:%" PRId64 ", sql:%s", pSql, tscDebug("%p stream:%p is opened, query on:%s, interval:%" PRId64 ", sliding:%" PRId64 ", first launched in:%" PRId64 ", sql:%s", pSql,
pStream, pTableMetaInfo->name, pStream->interval, pStream->slidingTime, starttime, sqlstr); pStream, pTableMetaInfo->name, pStream->interval, pStream->slidingTime, starttime, sqlstr);
return pStream; return pStream;
...@@ -564,7 +564,7 @@ void taos_close_stream(TAOS_STREAM *handle) { ...@@ -564,7 +564,7 @@ void taos_close_stream(TAOS_STREAM *handle) {
taosTmrStopA(&(pStream->pTimer)); taosTmrStopA(&(pStream->pTimer));
tscTrace("%p stream:%p is closed", pSql, pStream); tscDebug("%p stream:%p is closed", pSql, pStream);
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
pStream->pSql = NULL; pStream->pSql = NULL;
......
...@@ -260,12 +260,12 @@ static int tscLoadSubscriptionProgress(SSub* pSub) { ...@@ -260,12 +260,12 @@ static int tscLoadSubscriptionProgress(SSub* pSub) {
FILE* fp = fopen(buf, "r"); FILE* fp = fopen(buf, "r");
if (fp == NULL) { if (fp == NULL) {
tscTrace("subscription progress file does not exist: %s", pSub->topic); tscDebug("subscription progress file does not exist: %s", pSub->topic);
return 1; return 1;
} }
if (fgets(buf, sizeof(buf), fp) == NULL) { if (fgets(buf, sizeof(buf), fp) == NULL) {
tscTrace("invalid subscription progress file: %s", pSub->topic); tscDebug("invalid subscription progress file: %s", pSub->topic);
fclose(fp); fclose(fp);
return 0; return 0;
} }
...@@ -279,7 +279,7 @@ static int tscLoadSubscriptionProgress(SSub* pSub) { ...@@ -279,7 +279,7 @@ static int tscLoadSubscriptionProgress(SSub* pSub) {
} }
} }
if (strcmp(buf, pSub->pSql->sqlstr) != 0) { if (strcmp(buf, pSub->pSql->sqlstr) != 0) {
tscTrace("subscription sql statement mismatch: %s", pSub->topic); tscDebug("subscription sql statement mismatch: %s", pSub->topic);
fclose(fp); fclose(fp);
return 0; return 0;
} }
...@@ -299,7 +299,7 @@ static int tscLoadSubscriptionProgress(SSub* pSub) { ...@@ -299,7 +299,7 @@ static int tscLoadSubscriptionProgress(SSub* pSub) {
fclose(fp); fclose(fp);
taosArraySort(progress, tscCompareSubscriptionProgress); taosArraySort(progress, tscCompareSubscriptionProgress);
tscTrace("subscription progress loaded, %zu tables: %s", taosArrayGetSize(progress), pSub->topic); tscDebug("subscription progress loaded, %zu tables: %s", taosArrayGetSize(progress), pSub->topic);
return 1; return 1;
} }
...@@ -344,7 +344,7 @@ TAOS_SUB *taos_subscribe(TAOS *taos, int restart, const char* topic, const char ...@@ -344,7 +344,7 @@ TAOS_SUB *taos_subscribe(TAOS *taos, int restart, const char* topic, const char
pSub->taos = taos; pSub->taos = taos;
if (restart) { if (restart) {
tscTrace("restart subscription: %s", topic); tscDebug("restart subscription: %s", topic);
} else { } else {
tscLoadSubscriptionProgress(pSub); tscLoadSubscriptionProgress(pSub);
} }
...@@ -356,7 +356,7 @@ TAOS_SUB *taos_subscribe(TAOS *taos, int restart, const char* topic, const char ...@@ -356,7 +356,7 @@ TAOS_SUB *taos_subscribe(TAOS *taos, int restart, const char* topic, const char
pSub->interval = interval; pSub->interval = interval;
if (fp != NULL) { if (fp != NULL) {
tscTrace("asynchronize subscription, create new timer: %s", topic); tscDebug("asynchronize subscription, create new timer: %s", topic);
pSub->fp = fp; pSub->fp = fp;
pSub->param = param; pSub->param = param;
taosTmrReset(tscProcessSubscriptionTimer, interval, pSub, tscTmr, &pSub->pTimer); taosTmrReset(tscProcessSubscriptionTimer, interval, pSub, tscTmr, &pSub->pTimer);
...@@ -379,7 +379,7 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) { ...@@ -379,7 +379,7 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) {
if (pSub->pTimer == NULL) { if (pSub->pTimer == NULL) {
int64_t duration = taosGetTimestampMs() - pSub->lastConsumeTime; int64_t duration = taosGetTimestampMs() - pSub->lastConsumeTime;
if (duration < (int64_t)(pSub->interval)) { if (duration < (int64_t)(pSub->interval)) {
tscTrace("subscription consume too frequently, blocking..."); tscDebug("subscription consume too frequently, blocking...");
taosMsleep(pSub->interval - (int32_t)duration); taosMsleep(pSub->interval - (int32_t)duration);
} }
} }
...@@ -388,9 +388,9 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) { ...@@ -388,9 +388,9 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) {
tscRemoveFromSqlList(pSql); tscRemoveFromSqlList(pSql);
if (taosGetTimestampMs() - pSub->lastSyncTime > 10 * 60 * 1000) { if (taosGetTimestampMs() - pSub->lastSyncTime > 10 * 60 * 1000) {
tscTrace("begin table synchronization"); tscDebug("begin table synchronization");
if (!tscUpdateSubscription(pSub->taos, pSub)) return NULL; if (!tscUpdateSubscription(pSub->taos, pSub)) return NULL;
tscTrace("table synchronization completed"); tscDebug("table synchronization completed");
} }
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
......
此差异已折叠。
...@@ -72,7 +72,7 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) { ...@@ -72,7 +72,7 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) {
tscError("failed to init connection to TDengine"); tscError("failed to init connection to TDengine");
return -1; return -1;
} else { } else {
tscTrace("dnodeConn:%p is created, user:%s", *pDnodeConn, user); tscDebug("dnodeConn:%p is created, user:%s", *pDnodeConn, user);
} }
} }
...@@ -106,8 +106,8 @@ void taos_init_imp() { ...@@ -106,8 +106,8 @@ void taos_init_imp() {
taosCheckGlobalCfg(); taosCheckGlobalCfg();
taosPrintGlobalCfg(); taosPrintGlobalCfg();
tscTrace("starting to initialize TAOS client ..."); tscDebug("starting to initialize TAOS client ...");
tscTrace("Local End Point is:%s", tsLocalEp); tscDebug("Local End Point is:%s", tsLocalEp);
} }
taosSetCoreDump(); taosSetCoreDump();
...@@ -151,7 +151,7 @@ void taos_init_imp() { ...@@ -151,7 +151,7 @@ void taos_init_imp() {
tscCacheHandle = taosCacheInit(refreshTime); tscCacheHandle = taosCacheInit(refreshTime);
} }
tscTrace("client is initialized successfully"); tscDebug("client is initialized successfully");
} }
void taos_init() { pthread_once(&tscinit, taos_init_imp); } void taos_init() { pthread_once(&tscinit, taos_init_imp); }
...@@ -182,7 +182,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -182,7 +182,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) { if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) {
tstrncpy(configDir, pStr, TSDB_FILENAME_LEN); tstrncpy(configDir, pStr, TSDB_FILENAME_LEN);
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
tscPrint("set config file directory:%s", pStr); tscInfo("set config file directory:%s", pStr);
} else { } else {
tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr, tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr,
tsCfgStatusStr[cfg->cfgStatus], (char *)cfg->ptr); tsCfgStatusStr[cfg->cfgStatus], (char *)cfg->ptr);
...@@ -198,7 +198,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -198,7 +198,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
if (tsShellActivityTimer < 1) tsShellActivityTimer = 1; if (tsShellActivityTimer < 1) tsShellActivityTimer = 1;
if (tsShellActivityTimer > 3600) tsShellActivityTimer = 3600; if (tsShellActivityTimer > 3600) tsShellActivityTimer = 3600;
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
tscPrint("set shellActivityTimer:%d", tsShellActivityTimer); tscInfo("set shellActivityTimer:%d", tsShellActivityTimer);
} else { } else {
tscWarn("config option:%s, input value:%s, is configured by %s, use %d", cfg->option, pStr, tscWarn("config option:%s, input value:%s, is configured by %s, use %d", cfg->option, pStr,
tsCfgStatusStr[cfg->cfgStatus], *(int32_t *)cfg->ptr); tsCfgStatusStr[cfg->cfgStatus], *(int32_t *)cfg->ptr);
...@@ -211,7 +211,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -211,7 +211,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
size_t len = strlen(pStr); size_t len = strlen(pStr);
if (len == 0 || len > TSDB_LOCALE_LEN) { if (len == 0 || len > TSDB_LOCALE_LEN) {
tscPrint("Invalid locale:%s, use default", pStr); tscInfo("Invalid locale:%s, use default", pStr);
return -1; return -1;
} }
...@@ -227,11 +227,11 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -227,11 +227,11 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
char *locale = setlocale(LC_CTYPE, pStr); char *locale = setlocale(LC_CTYPE, pStr);
if (locale != NULL) { if (locale != NULL) {
tscPrint("locale set, prev locale:%s, new locale:%s", tsLocale, locale); tscInfo("locale set, prev locale:%s, new locale:%s", tsLocale, locale);
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
} else { // set the user-specified localed failed, use default LC_CTYPE as current locale } else { // set the user-specified localed failed, use default LC_CTYPE as current locale
locale = setlocale(LC_CTYPE, tsLocale); locale = setlocale(LC_CTYPE, tsLocale);
tscPrint("failed to set locale:%s, current locale:%s", pStr, tsLocale); tscInfo("failed to set locale:%s, current locale:%s", pStr, tsLocale);
} }
tstrncpy(tsLocale, locale, sizeof(tsLocale)); tstrncpy(tsLocale, locale, sizeof(tsLocale));
...@@ -244,21 +244,21 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -244,21 +244,21 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
if (taosValidateEncodec(charset)) { if (taosValidateEncodec(charset)) {
if (strlen(tsCharset) == 0) { if (strlen(tsCharset) == 0) {
tscPrint("charset set:%s", charset); tscInfo("charset set:%s", charset);
} else { } else {
tscPrint("charset changed from %s to %s", tsCharset, charset); tscInfo("charset changed from %s to %s", tsCharset, charset);
} }
tstrncpy(tsCharset, charset, sizeof(tsCharset)); tstrncpy(tsCharset, charset, sizeof(tsCharset));
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
} else { } else {
tscPrint("charset:%s is not valid in locale, charset remains:%s", charset, tsCharset); tscInfo("charset:%s is not valid in locale, charset remains:%s", charset, tsCharset);
} }
free(charset); free(charset);
} else { // it may be windows system } else { // it may be windows system
tscPrint("charset remains:%s", tsCharset); tscInfo("charset remains:%s", tsCharset);
} }
} else { } else {
tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr, tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr,
...@@ -274,22 +274,22 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -274,22 +274,22 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
size_t len = strlen(pStr); size_t len = strlen(pStr);
if (len == 0 || len > TSDB_LOCALE_LEN) { if (len == 0 || len > TSDB_LOCALE_LEN) {
tscPrint("failed to set charset:%s", pStr); tscInfo("failed to set charset:%s", pStr);
return -1; return -1;
} }
if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) { if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) {
if (taosValidateEncodec(pStr)) { if (taosValidateEncodec(pStr)) {
if (strlen(tsCharset) == 0) { if (strlen(tsCharset) == 0) {
tscPrint("charset is set:%s", pStr); tscInfo("charset is set:%s", pStr);
} else { } else {
tscPrint("charset changed from %s to %s", tsCharset, pStr); tscInfo("charset changed from %s to %s", tsCharset, pStr);
} }
tstrncpy(tsCharset, pStr, sizeof(tsCharset)); tstrncpy(tsCharset, pStr, sizeof(tsCharset));
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
} else { } else {
tscPrint("charset:%s not valid", pStr); tscInfo("charset:%s not valid", pStr);
} }
} else { } else {
tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr, tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr,
...@@ -307,7 +307,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { ...@@ -307,7 +307,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
tstrncpy(tsTimezone, pStr, sizeof(tsTimezone)); tstrncpy(tsTimezone, pStr, sizeof(tsTimezone));
tsSetTimeZone(); tsSetTimeZone();
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
tscTrace("timezone set:%s, input:%s by taos_options", tsTimezone, pStr); tscDebug("timezone set:%s, input:%s by taos_options", tsTimezone, pStr);
} else { } else {
tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr, tscWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, pStr,
tsCfgStatusStr[cfg->cfgStatus], (char *)cfg->ptr); tsCfgStatusStr[cfg->cfgStatus], (char *)cfg->ptr);
...@@ -328,7 +328,7 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) { ...@@ -328,7 +328,7 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) {
for (int i = 1; atomic_val_compare_exchange_32(&lock, 0, 1) != 0; ++i) { for (int i = 1; atomic_val_compare_exchange_32(&lock, 0, 1) != 0; ++i) {
if (i % 1000 == 0) { if (i % 1000 == 0) {
tscPrint("haven't acquire lock after spin %d times.", i); tscInfo("haven't acquire lock after spin %d times.", i);
sched_yield(); sched_yield();
} }
} }
......
...@@ -374,7 +374,7 @@ void tscFreeSqlObj(SSqlObj* pSql) { ...@@ -374,7 +374,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
return; return;
} }
tscTrace("%p start to free sql object", pSql); tscDebug("%p start to free sql object", pSql);
tscPartiallyFreeSqlObj(pSql); tscPartiallyFreeSqlObj(pSql);
pSql->signature = NULL; pSql->signature = NULL;
...@@ -656,7 +656,7 @@ int32_t tscMergeTableDataBlocks(SSqlObj* pSql, SArray* pTableDataBlockList) { ...@@ -656,7 +656,7 @@ int32_t tscMergeTableDataBlocks(SSqlObj* pSql, SArray* pTableDataBlockList) {
tscSortRemoveDataBlockDupRows(pOneTableBlock); tscSortRemoveDataBlockDupRows(pOneTableBlock);
char* ekey = (char*)pBlocks->data + pOneTableBlock->rowSize*(pBlocks->numOfRows-1); char* ekey = (char*)pBlocks->data + pOneTableBlock->rowSize*(pBlocks->numOfRows-1);
tscTrace("%p tableId:%s, sid:%d rows:%d sversion:%d skey:%" PRId64 ", ekey:%" PRId64, pSql, pOneTableBlock->tableId, tscDebug("%p tableId:%s, sid:%d rows:%d sversion:%d skey:%" PRId64 ", ekey:%" PRId64, pSql, pOneTableBlock->tableId,
pBlocks->tid, pBlocks->numOfRows, pBlocks->sversion, GET_INT64_VAL(pBlocks->data), GET_INT64_VAL(ekey)); pBlocks->tid, pBlocks->numOfRows, pBlocks->sversion, GET_INT64_VAL(pBlocks->data), GET_INT64_VAL(ekey));
...@@ -702,7 +702,7 @@ void tscCloseTscObj(STscObj* pObj) { ...@@ -702,7 +702,7 @@ void tscCloseTscObj(STscObj* pObj) {
rpcClose(pObj->pDnodeConn); rpcClose(pObj->pDnodeConn);
} }
tscTrace("%p DB connection is closed, dnodeConn:%p", pObj, pObj->pDnodeConn); tscDebug("%p DB connection is closed, dnodeConn:%p", pObj, pObj->pDnodeConn);
tfree(pObj); tfree(pObj);
} }
...@@ -1562,7 +1562,7 @@ void tscClearSubqueryInfo(SSqlCmd* pCmd) { ...@@ -1562,7 +1562,7 @@ void tscClearSubqueryInfo(SSqlCmd* pCmd) {
} }
void clearAllTableMetaInfo(SQueryInfo* pQueryInfo, const char* address, bool removeFromCache) { void clearAllTableMetaInfo(SQueryInfo* pQueryInfo, const char* address, bool removeFromCache) {
tscTrace("%p deref the table meta in cache, numOfTables:%d", address, pQueryInfo->numOfTables); tscDebug("%p deref the table meta in cache, numOfTables:%d", address, pQueryInfo->numOfTables);
for(int32_t i = 0; i < pQueryInfo->numOfTables; ++i) { for(int32_t i = 0; i < pQueryInfo->numOfTables; ++i) {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i);
...@@ -1844,7 +1844,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void ...@@ -1844,7 +1844,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
if (cmd == TSDB_SQL_SELECT) { if (cmd == TSDB_SQL_SELECT) {
size_t size = taosArrayGetSize(pNewQueryInfo->colList); size_t size = taosArrayGetSize(pNewQueryInfo->colList);
tscTrace( tscDebug(
"%p new subquery:%p, tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%zu, colList:%zu," "%p new subquery:%p, tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%zu, colList:%zu,"
"fieldInfo:%d, name:%s, qrang:%" PRId64 " - %" PRId64 " order:%d, limit:%" PRId64, "fieldInfo:%d, name:%s, qrang:%" PRId64 " - %" PRId64 " order:%d, limit:%" PRId64,
pSql, pNew, tableIndex, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, tscSqlExprNumOfExprs(pNewQueryInfo), pSql, pNew, tableIndex, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, tscSqlExprNumOfExprs(pNewQueryInfo),
...@@ -1853,7 +1853,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void ...@@ -1853,7 +1853,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
tscPrintSelectClause(pNew, 0); tscPrintSelectClause(pNew, 0);
} else { } else {
tscTrace("%p new sub insertion: %p, vnodeIdx:%d", pSql, pNew, pTableMetaInfo->vgroupIndex); tscDebug("%p new sub insertion: %p, vnodeIdx:%d", pSql, pNew, pTableMetaInfo->vgroupIndex);
} }
return pNew; return pNew;
...@@ -2012,7 +2012,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) { ...@@ -2012,7 +2012,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
int32_t totalVgroups = pTableMetaInfo->vgroupList->numOfVgroups; int32_t totalVgroups = pTableMetaInfo->vgroupList->numOfVgroups;
while (++pTableMetaInfo->vgroupIndex < totalVgroups) { while (++pTableMetaInfo->vgroupIndex < totalVgroups) {
tscTrace("%p results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%" PRId64, pSql, tscDebug("%p results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%" PRId64, pSql,
pTableMetaInfo->vgroupIndex - 1, pTableMetaInfo->vgroupIndex, totalVgroups, pRes->numOfClauseTotal); pTableMetaInfo->vgroupIndex - 1, pTableMetaInfo->vgroupIndex, totalVgroups, pRes->numOfClauseTotal);
/* /*
...@@ -2031,7 +2031,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) { ...@@ -2031,7 +2031,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
pQueryInfo->limit.offset = pRes->offset; pQueryInfo->limit.offset = pRes->offset;
assert((pRes->offset >= 0 && pRes->numOfRows == 0) || (pRes->offset == 0 && pRes->numOfRows >= 0)); assert((pRes->offset >= 0 && pRes->numOfRows == 0) || (pRes->offset == 0 && pRes->numOfRows >= 0));
tscTrace("%p new query to next vgroup, index:%d, limit:%" PRId64 ", offset:%" PRId64 ", glimit:%" PRId64, tscDebug("%p new query to next vgroup, index:%d, limit:%" PRId64 ", offset:%" PRId64 ", glimit:%" PRId64,
pSql, pTableMetaInfo->vgroupIndex, pQueryInfo->limit.limit, pQueryInfo->limit.offset, pQueryInfo->clauseLimit); pSql, pTableMetaInfo->vgroupIndex, pQueryInfo->limit.limit, pQueryInfo->limit.offset, pQueryInfo->clauseLimit);
/* /*
...@@ -2081,7 +2081,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, void (*queryFp)()) { ...@@ -2081,7 +2081,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, void (*queryFp)()) {
assert(queryFp != NULL); assert(queryFp != NULL);
} }
tscTrace("%p try data in the next subclause:%d, total subclause:%d", pSql, pCmd->clauseIndex, pCmd->numOfClause); tscDebug("%p try data in the next subclause:%d, total subclause:%d", pSql, pCmd->clauseIndex, pCmd->numOfClause);
if (pCmd->command > TSDB_SQL_LOCAL) { if (pCmd->command > TSDB_SQL_LOCAL) {
tscProcessLocalCmd(pSql); tscProcessLocalCmd(pSql);
} else { } else {
......
...@@ -158,9 +158,9 @@ extern int32_t mqttDebugFlag; ...@@ -158,9 +158,9 @@ extern int32_t mqttDebugFlag;
extern int32_t monitorDebugFlag; extern int32_t monitorDebugFlag;
extern int32_t uDebugFlag; extern int32_t uDebugFlag;
extern int32_t rpcDebugFlag; extern int32_t rpcDebugFlag;
extern int32_t debugFlag;
extern int32_t odbcDebugFlag; extern int32_t odbcDebugFlag;
extern int32_t qDebugFlag; extern int32_t qDebugFlag;
extern int32_t debugFlag;
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize) #define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
......
...@@ -25,15 +25,18 @@ extern "C" { ...@@ -25,15 +25,18 @@ extern "C" {
extern int32_t uDebugFlag; extern int32_t uDebugFlag;
extern int32_t tscEmbedded; extern int32_t tscEmbedded;
#define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR UTL ", uDebugFlag, __VA_ARGS__); }} #define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
#define uWarn(...) { if (uDebugFlag & DEBUG_WARN) { taosPrintLog("WARN UTL ", uDebugFlag, __VA_ARGS__); }} #define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
#define uTrace(...) { if (uDebugFlag & DEBUG_TRACE) { taosPrintLog("UTL ", uDebugFlag, __VA_ARGS__); }} #define uWarn(...) { if (uDebugFlag & DEBUG_WARN) { taosPrintLog("UTL WARN ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
#define uDump(x, y) { if (uDebugFlag & DEBUG_DUMP) { taosDumpData(x, y); }} #define uInfo(...) { if (uDebugFlag & DEBUG_INFO) { taosPrintLog("UTL INFO ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
#define uPrint(...) { taosPrintLog("UTL ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); } #define uDebug(...) { if (uDebugFlag & DEBUG_DEBUG) { taosPrintLog("UTL DEBUG ", uDebugFlag, __VA_ARGS__); }}
#define uForcePrint(...) { taosPrintLog("ERROR UTL ", 255, __VA_ARGS__); } #define uTrace(...) { if (uDebugFlag & DEBUG_TRACE) { taosPrintLog("UTL TRACE ", uDebugFlag, __VA_ARGS__); }}
#define pError(...) { taosPrintLog("ERROR APP ", 255, __VA_ARGS__); } #define uDebugDump(...) { if (uDebugFlag & DEBUG_DEBUG) { taosPrintLongString("UTL DEBUG ", uDebugFlag, __VA_ARGS__); }}
#define pPrint(...) { taosPrintLog("APP ", 255, __VA_ARGS__); } #define uTraceDump(...) { if (uDebugFlag & DEBUG_TRACE) { taosPrintLongString("UTL TRACE ", uDebugFlag, __VA_ARGS__); }}
#define pError(...) { taosPrintLog("APP ERROR ", 255, __VA_ARGS__); }
#define pPrint(...) { taosPrintLog("APP INFO ", 255, __VA_ARGS__); }
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -216,7 +216,7 @@ void taosSetAllDebugFlag() { ...@@ -216,7 +216,7 @@ void taosSetAllDebugFlag() {
tsdbDebugFlag = debugFlag; tsdbDebugFlag = debugFlag;
qDebugFlag = debugFlag; qDebugFlag = debugFlag;
} }
uPrint("all debug flag are set to %d", debugFlag); uInfo("all debug flag are set to %d", debugFlag);
} }
bool taosCfgDynamicOptions(char *msg) { bool taosCfgDynamicOptions(char *msg) {
...@@ -234,7 +234,7 @@ bool taosCfgDynamicOptions(char *msg) { ...@@ -234,7 +234,7 @@ bool taosCfgDynamicOptions(char *msg) {
vint = atoi(value); vint = atoi(value);
} }
uPrint("change dynamic option: %s, value: %d", option, vint); uInfo("change dynamic option: %s, value: %d", option, vint);
for (int32_t i = 0; i < tsGlobalConfigNum; ++i) { for (int32_t i = 0; i < tsGlobalConfigNum; ++i) {
SGlobalCfg *cfg = tsGlobalConfig + i; SGlobalCfg *cfg = tsGlobalConfig + i;
...@@ -1175,7 +1175,7 @@ void taosInitGlobalCfg() { ...@@ -1175,7 +1175,7 @@ void taosInitGlobalCfg() {
} }
bool taosCheckGlobalCfg() { bool taosCheckGlobalCfg() {
if (debugFlag == 135 || debugFlag == 199) { if (debugFlag & DEBUG_TRACE || debugFlag & DEBUG_DEBUG) {
taosSetAllDebugFlag(); taosSetAllDebugFlag();
} }
...@@ -1184,7 +1184,7 @@ bool taosCheckGlobalCfg() { ...@@ -1184,7 +1184,7 @@ bool taosCheckGlobalCfg() {
} }
snprintf(tsLocalEp, sizeof(tsLocalEp), "%s:%d", tsLocalFqdn, tsServerPort); snprintf(tsLocalEp, sizeof(tsLocalEp), "%s:%d", tsLocalFqdn, tsServerPort);
uPrint("localEp is: %s", tsLocalEp); uInfo("localEp is: %s", tsLocalEp);
if (tsFirst[0] == 0) { if (tsFirst[0] == 0) {
strcpy(tsFirst, tsLocalEp); strcpy(tsFirst, tsLocalEp);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// TODO refactor to set the tz value through parameter // TODO refactor to set the tz value through parameter
void tsSetTimeZone() { void tsSetTimeZone() {
SGlobalCfg *cfg_timezone = taosGetConfigOption("timezone"); SGlobalCfg *cfg_timezone = taosGetConfigOption("timezone");
uPrint("timezone is set to %s by %s", tsTimezone, tsCfgStatusStr[cfg_timezone->cfgStatus]); uInfo("timezone is set to %s by %s", tsTimezone, tsCfgStatusStr[cfg_timezone->cfgStatus]);
#ifdef WINDOWS #ifdef WINDOWS
char winStr[TSDB_LOCALE_LEN * 2]; char winStr[TSDB_LOCALE_LEN * 2];
...@@ -61,5 +61,5 @@ void tsSetTimeZone() { ...@@ -61,5 +61,5 @@ void tsSetTimeZone() {
sprintf(tsTimezone, "(%s, %s%02d00)", tzname[daylight], tz >= 0 ? "+" : "-", abs(tz)); sprintf(tsTimezone, "(%s, %s%02d00)", tzname[daylight], tz >= 0 ? "+" : "-", abs(tz));
tsDaylight = daylight; tsDaylight = daylight;
uPrint("timezone format changed to %s", tsTimezone); uInfo("timezone format changed to %s", tsTimezone);
} }
...@@ -24,10 +24,12 @@ extern "C" { ...@@ -24,10 +24,12 @@ extern "C" {
extern int32_t dDebugFlag; extern int32_t dDebugFlag;
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR DND ", 255, __VA_ARGS__); }} #define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", dDebugFlag, __VA_ARGS__); }}
#define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); }} #define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); }} #define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("DND WARN ", dDebugFlag, __VA_ARGS__); }}
#define dPrint(...) { taosPrintLog("DND ", 255, __VA_ARGS__); } #define dInfo(...) { if (dDebugFlag & DEBUG_INFO) { taosPrintLog("DND INFO ", dDebugFlag, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND DEBUG ", dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND TRACE ", dDebugFlag, __VA_ARGS__); }}
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -55,7 +55,7 @@ int32_t dnodeInitMnodePeer() { ...@@ -55,7 +55,7 @@ int32_t dnodeInitMnodePeer() {
pWorker->workerId = i; pWorker->workerId = i;
} }
dPrint("dnode mpeer is opened"); dInfo("dnode mpeer is opened");
return 0; return 0;
} }
...@@ -76,7 +76,7 @@ void dnodeCleanupMnodePeer() { ...@@ -76,7 +76,7 @@ void dnodeCleanupMnodePeer() {
taosCloseQset(tsMPeerQset); taosCloseQset(tsMPeerQset);
tfree(tsMPeerPool.peerWorker); tfree(tsMPeerPool.peerWorker);
dPrint("dnode mpeer is closed"); dInfo("dnode mpeer is closed");
} }
int32_t dnodeAllocateMnodePqueue() { int32_t dnodeAllocateMnodePqueue() {
...@@ -98,10 +98,10 @@ int32_t dnodeAllocateMnodePqueue() { ...@@ -98,10 +98,10 @@ int32_t dnodeAllocateMnodePqueue() {
} }
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
dTrace("dnode mpeer worker:%d is launched, total:%d", pWorker->workerId, tsMPeerPool.num); dDebug("dnode mpeer worker:%d is launched, total:%d", pWorker->workerId, tsMPeerPool.num);
} }
dTrace("dnode mpeer queue:%p is allocated", tsMPeerQueue); dDebug("dnode mpeer queue:%p is allocated", tsMPeerQueue);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -147,11 +147,11 @@ static void *dnodeProcessMnodePeerQueue(void *param) { ...@@ -147,11 +147,11 @@ static void *dnodeProcessMnodePeerQueue(void *param) {
while (1) { while (1) {
if (taosReadQitemFromQset(tsMPeerQset, &type, (void **)&pPeerMsg, &unUsed) == 0) { if (taosReadQitemFromQset(tsMPeerQset, &type, (void **)&pPeerMsg, &unUsed) == 0) {
dTrace("dnodeProcessMnodePeerQueue: got no message from qset, exiting..."); dDebug("dnodeProcessMnodePeerQueue: got no message from qset, exiting...");
break; break;
} }
dTrace("msg:%s will be processed in mpeer queue", taosMsg[pPeerMsg->rpcMsg.msgType]); dDebug("msg:%s will be processed in mpeer queue", taosMsg[pPeerMsg->rpcMsg.msgType]);
int32_t code = mnodeProcessPeerReq(pPeerMsg); int32_t code = mnodeProcessPeerReq(pPeerMsg);
dnodeSendRpcMnodePeerRsp(pPeerMsg, code); dnodeSendRpcMnodePeerRsp(pPeerMsg, code);
} }
......
...@@ -57,7 +57,7 @@ int32_t dnodeInitMnodeRead() { ...@@ -57,7 +57,7 @@ int32_t dnodeInitMnodeRead() {
pWorker->workerId = i; pWorker->workerId = i;
} }
dPrint("dnode mread is opened"); dInfo("dnode mread is opened");
return 0; return 0;
} }
...@@ -79,7 +79,7 @@ void dnodeCleanupMnodeRead() { ...@@ -79,7 +79,7 @@ void dnodeCleanupMnodeRead() {
taosCloseQset(tsMReadQset); taosCloseQset(tsMReadQset);
free(tsMReadPool.readWorker); free(tsMReadPool.readWorker);
dPrint("dnode mread is closed"); dInfo("dnode mread is closed");
} }
int32_t dnodeAllocateMnodeRqueue() { int32_t dnodeAllocateMnodeRqueue() {
...@@ -101,10 +101,10 @@ int32_t dnodeAllocateMnodeRqueue() { ...@@ -101,10 +101,10 @@ int32_t dnodeAllocateMnodeRqueue() {
} }
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
dTrace("dnode mread worker:%d is launched, total:%d", pWorker->workerId, tsMReadPool.num); dDebug("dnode mread worker:%d is launched, total:%d", pWorker->workerId, tsMReadPool.num);
} }
dTrace("dnode mread queue:%p is allocated", tsMReadQueue); dDebug("dnode mread queue:%p is allocated", tsMReadQueue);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -155,11 +155,11 @@ static void *dnodeProcessMnodeReadQueue(void *param) { ...@@ -155,11 +155,11 @@ static void *dnodeProcessMnodeReadQueue(void *param) {
while (1) { while (1) {
if (taosReadQitemFromQset(tsMReadQset, &type, (void **)&pReadMsg, &unUsed) == 0) { if (taosReadQitemFromQset(tsMReadQset, &type, (void **)&pReadMsg, &unUsed) == 0) {
dTrace("dnodeProcessMnodeReadQueue: got no message from qset, exiting..."); dDebug("dnodeProcessMnodeReadQueue: got no message from qset, exiting...");
break; break;
} }
dTrace("%p, msg:%s will be processed in mread queue", pReadMsg->rpcMsg.ahandle, taosMsg[pReadMsg->rpcMsg.msgType]); dDebug("%p, msg:%s will be processed in mread queue", pReadMsg->rpcMsg.ahandle, taosMsg[pReadMsg->rpcMsg.msgType]);
int32_t code = mnodeProcessRead(pReadMsg); int32_t code = mnodeProcessRead(pReadMsg);
dnodeSendRpcMnodeReadRsp(pReadMsg, code); dnodeSendRpcMnodeReadRsp(pReadMsg, code);
} }
......
...@@ -57,7 +57,7 @@ int32_t dnodeInitMnodeWrite() { ...@@ -57,7 +57,7 @@ int32_t dnodeInitMnodeWrite() {
pWorker->workerId = i; pWorker->workerId = i;
} }
dPrint("dnode mwrite is opened"); dInfo("dnode mwrite is opened");
return 0; return 0;
} }
...@@ -78,7 +78,7 @@ void dnodeCleanupMnodeWrite() { ...@@ -78,7 +78,7 @@ void dnodeCleanupMnodeWrite() {
taosCloseQset(tsMWriteQset); taosCloseQset(tsMWriteQset);
tfree(tsMWritePool.writeWorker); tfree(tsMWritePool.writeWorker);
dPrint("dnode mwrite is closed"); dInfo("dnode mwrite is closed");
} }
int32_t dnodeAllocateMnodeWqueue() { int32_t dnodeAllocateMnodeWqueue() {
...@@ -100,10 +100,10 @@ int32_t dnodeAllocateMnodeWqueue() { ...@@ -100,10 +100,10 @@ int32_t dnodeAllocateMnodeWqueue() {
} }
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
dTrace("dnode mwrite worker:%d is launched, total:%d", pWorker->workerId, tsMWritePool.num); dDebug("dnode mwrite worker:%d is launched, total:%d", pWorker->workerId, tsMWritePool.num);
} }
dTrace("dnode mwrite queue:%p is allocated", tsMWriteQueue); dDebug("dnode mwrite queue:%p is allocated", tsMWriteQueue);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -121,7 +121,7 @@ void dnodeDispatchToMnodeWriteQueue(SRpcMsg *pMsg) { ...@@ -121,7 +121,7 @@ void dnodeDispatchToMnodeWriteQueue(SRpcMsg *pMsg) {
SMnodeMsg *pWrite = (SMnodeMsg *)taosAllocateQitem(sizeof(SMnodeMsg)); SMnodeMsg *pWrite = (SMnodeMsg *)taosAllocateQitem(sizeof(SMnodeMsg));
mnodeCreateMsg(pWrite, pMsg); mnodeCreateMsg(pWrite, pMsg);
dTrace("app:%p:%p, msg:%s is put into mwrite queue", pWrite->rpcMsg.ahandle, pWrite, taosMsg[pWrite->rpcMsg.msgType]); dDebug("app:%p:%p, msg:%s is put into mwrite queue", pWrite->rpcMsg.ahandle, pWrite, taosMsg[pWrite->rpcMsg.msgType]);
taosWriteQitem(tsMWriteQueue, TAOS_QTYPE_RPC, pWrite); taosWriteQitem(tsMWriteQueue, TAOS_QTYPE_RPC, pWrite);
} }
...@@ -157,11 +157,11 @@ static void *dnodeProcessMnodeWriteQueue(void *param) { ...@@ -157,11 +157,11 @@ static void *dnodeProcessMnodeWriteQueue(void *param) {
while (1) { while (1) {
if (taosReadQitemFromQset(tsMWriteQset, &type, (void **)&pWrite, &unUsed) == 0) { if (taosReadQitemFromQset(tsMWriteQset, &type, (void **)&pWrite, &unUsed) == 0) {
dTrace("dnodeProcessMnodeWriteQueue: got no message from qset, exiting..."); dDebug("dnodeProcessMnodeWriteQueue: got no message from qset, exiting...");
break; break;
} }
dTrace("app:%p:%p, msg:%s will be processed in mwrite queue", pWrite->rpcMsg.ahandle, pWrite, dDebug("app:%p:%p, msg:%s will be processed in mwrite queue", pWrite->rpcMsg.ahandle, pWrite,
taosMsg[pWrite->rpcMsg.msgType]); taosMsg[pWrite->rpcMsg.msgType]);
int32_t code = mnodeProcessWrite(pWrite); int32_t code = mnodeProcessWrite(pWrite);
...@@ -175,13 +175,13 @@ void dnodeReprocessMnodeWriteMsg(void *pMsg) { ...@@ -175,13 +175,13 @@ void dnodeReprocessMnodeWriteMsg(void *pMsg) {
SMnodeMsg *pWrite = pMsg; SMnodeMsg *pWrite = pMsg;
if (!mnodeIsRunning() || tsMWriteQueue == NULL) { if (!mnodeIsRunning() || tsMWriteQueue == NULL) {
dTrace("app:%p:%p, msg:%s is redirected for mnode not running, retry times:%d", pWrite->rpcMsg.ahandle, pWrite, dDebug("app:%p:%p, msg:%s is redirected for mnode not running, retry times:%d", pWrite->rpcMsg.ahandle, pWrite,
taosMsg[pWrite->rpcMsg.msgType], pWrite->retry); taosMsg[pWrite->rpcMsg.msgType], pWrite->retry);
dnodeSendRedirectMsg(pMsg, true); dnodeSendRedirectMsg(pMsg, true);
dnodeFreeMnodeWriteMsg(pWrite); dnodeFreeMnodeWriteMsg(pWrite);
} else { } else {
dTrace("app:%p:%p, msg:%s is reput into mwrite queue, retry times:%d", pWrite->rpcMsg.ahandle, pWrite, dDebug("app:%p:%p, msg:%s is reput into mwrite queue, retry times:%d", pWrite->rpcMsg.ahandle, pWrite,
taosMsg[pWrite->rpcMsg.msgType], pWrite->retry); taosMsg[pWrite->rpcMsg.msgType], pWrite->retry);
taosWriteQitem(tsMWriteQueue, TAOS_QTYPE_RPC, pWrite); taosWriteQitem(tsMWriteQueue, TAOS_QTYPE_RPC, pWrite);
......
...@@ -114,7 +114,7 @@ int32_t dnodeInitSystem() { ...@@ -114,7 +114,7 @@ int32_t dnodeInitSystem() {
} }
taosPrintGlobalCfg(); taosPrintGlobalCfg();
dPrint("start to initialize TDengine on %s", tsLocalEp); dInfo("start to initialize TDengine on %s", tsLocalEp);
if (dnodeInitComponents() != 0) { if (dnodeInitComponents() != 0) {
return -1; return -1;
...@@ -124,7 +124,7 @@ int32_t dnodeInitSystem() { ...@@ -124,7 +124,7 @@ int32_t dnodeInitSystem() {
dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_RUNING); dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_RUNING);
dnodeStartStream(); dnodeStartStream();
dPrint("TDengine is initialized successfully"); dInfo("TDengine is initialized successfully");
return 0; return 0;
} }
...@@ -189,7 +189,7 @@ static int32_t dnodeInitStorage() { ...@@ -189,7 +189,7 @@ static int32_t dnodeInitStorage() {
dnodeCheckDataDirOpenned(tsDnodeDir); dnodeCheckDataDirOpenned(tsDnodeDir);
dPrint("storage directory is initialized"); dInfo("storage directory is initialized");
return 0; return 0;
} }
......
...@@ -141,7 +141,7 @@ int32_t dnodeInitMgmt() { ...@@ -141,7 +141,7 @@ int32_t dnodeInitMgmt() {
taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer); taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer);
dPrint("dnode mgmt is initialized"); dInfo("dnode mgmt is initialized");
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -196,11 +196,11 @@ static void *dnodeProcessMgmtQueue(void *param) { ...@@ -196,11 +196,11 @@ static void *dnodeProcessMgmtQueue(void *param) {
while (1) { while (1) {
if (taosReadQitemFromQset(tsMgmtQset, &type, (void **) &pMsg, &handle) == 0) { if (taosReadQitemFromQset(tsMgmtQset, &type, (void **) &pMsg, &handle) == 0) {
dTrace("dnode mgmt got no message from qset, exit ..."); dDebug("dnode mgmt got no message from qset, exit ...");
break; break;
} }
dTrace("%p, msg:%s will be processed", pMsg->ahandle, taosMsg[pMsg->msgType]); dDebug("%p, msg:%s will be processed", pMsg->ahandle, taosMsg[pMsg->msgType]);
if (dnodeProcessMgmtMsgFp[pMsg->msgType]) { if (dnodeProcessMgmtMsgFp[pMsg->msgType]) {
rsp.code = (*dnodeProcessMgmtMsgFp[pMsg->msgType])(pMsg); rsp.code = (*dnodeProcessMgmtMsgFp[pMsg->msgType])(pMsg);
} else { } else {
...@@ -252,7 +252,7 @@ static int32_t dnodeOpenVnodes() { ...@@ -252,7 +252,7 @@ static int32_t dnodeOpenVnodes() {
status = dnodeGetVnodeList(vnodeList, &numOfVnodes); status = dnodeGetVnodeList(vnodeList, &numOfVnodes);
if (status != TSDB_CODE_SUCCESS) { if (status != TSDB_CODE_SUCCESS) {
dPrint("Get dnode list failed"); dInfo("Get dnode list failed");
free(vnodeList); free(vnodeList);
return status; return status;
} }
...@@ -263,7 +263,7 @@ static int32_t dnodeOpenVnodes() { ...@@ -263,7 +263,7 @@ static int32_t dnodeOpenVnodes() {
} }
free(vnodeList); free(vnodeList);
dPrint("there are total vnodes:%d, openned:%d failed:%d", numOfVnodes, numOfVnodes-failed, failed); dInfo("there are total vnodes:%d, openned:%d failed:%d", numOfVnodes, numOfVnodes-failed, failed);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -273,7 +273,7 @@ void dnodeStartStream() { ...@@ -273,7 +273,7 @@ void dnodeStartStream() {
int32_t status = dnodeGetVnodeList(vnodeList, &numOfVnodes); int32_t status = dnodeGetVnodeList(vnodeList, &numOfVnodes);
if (status != TSDB_CODE_SUCCESS) { if (status != TSDB_CODE_SUCCESS) {
dPrint("Get dnode list failed"); dInfo("Get dnode list failed");
return; return;
} }
...@@ -281,7 +281,7 @@ void dnodeStartStream() { ...@@ -281,7 +281,7 @@ void dnodeStartStream() {
vnodeStartStream(vnodeList[i]); vnodeStartStream(vnodeList[i]);
} }
dPrint("streams started"); dInfo("streams started");
} }
static void dnodeCloseVnodes() { static void dnodeCloseVnodes() {
...@@ -292,7 +292,7 @@ static void dnodeCloseVnodes() { ...@@ -292,7 +292,7 @@ static void dnodeCloseVnodes() {
status = dnodeGetVnodeList(vnodeList, &numOfVnodes); status = dnodeGetVnodeList(vnodeList, &numOfVnodes);
if (status != TSDB_CODE_SUCCESS) { if (status != TSDB_CODE_SUCCESS) {
dPrint("Get dnode list failed"); dInfo("Get dnode list failed");
free(vnodeList); free(vnodeList);
return; return;
} }
...@@ -302,7 +302,7 @@ static void dnodeCloseVnodes() { ...@@ -302,7 +302,7 @@ static void dnodeCloseVnodes() {
} }
free(vnodeList); free(vnodeList);
dPrint("total vnodes:%d are all closed", numOfVnodes); dInfo("total vnodes:%d are all closed", numOfVnodes);
} }
static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) { static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
...@@ -360,10 +360,10 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) { ...@@ -360,10 +360,10 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
} }
void dnodeUpdateMnodeIpSetForPeer(SRpcIpSet *pIpSet) { void dnodeUpdateMnodeIpSetForPeer(SRpcIpSet *pIpSet) {
dPrint("mnode IP list for is changed, numOfIps:%d inUse:%d", pIpSet->numOfIps, pIpSet->inUse); dInfo("mnode IP list for is changed, numOfIps:%d inUse:%d", pIpSet->numOfIps, pIpSet->inUse);
for (int i = 0; i < pIpSet->numOfIps; ++i) { for (int i = 0; i < pIpSet->numOfIps; ++i) {
pIpSet->port[i] -= TSDB_PORT_DNODEDNODE; pIpSet->port[i] -= TSDB_PORT_DNODEDNODE;
dPrint("mnode index:%d %s:%u", i, pIpSet->fqdn[i], pIpSet->port[i]) dInfo("mnode index:%d %s:%u", i, pIpSet->fqdn[i], pIpSet->port[i])
} }
tsDMnodeIpSet = *pIpSet; tsDMnodeIpSet = *pIpSet;
...@@ -440,9 +440,9 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) { ...@@ -440,9 +440,9 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
if (!dnodeCheckMnodeInfos(pMnodes)) return; if (!dnodeCheckMnodeInfos(pMnodes)) return;
memcpy(&tsDMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)); memcpy(&tsDMnodeInfos, pMnodes, sizeof(SDMMnodeInfos));
dPrint("mnode infos is changed, nodeNum:%d inUse:%d", tsDMnodeInfos.nodeNum, tsDMnodeInfos.inUse); dInfo("mnode infos is changed, nodeNum:%d inUse:%d", tsDMnodeInfos.nodeNum, tsDMnodeInfos.inUse);
for (int32_t i = 0; i < tsDMnodeInfos.nodeNum; i++) { for (int32_t i = 0; i < tsDMnodeInfos.nodeNum; i++) {
dPrint("mnode index:%d, %s", tsDMnodeInfos.nodeInfos[i].nodeId, tsDMnodeInfos.nodeInfos[i].nodeEp); dInfo("mnode index:%d, %s", tsDMnodeInfos.nodeInfos[i].nodeId, tsDMnodeInfos.nodeInfos[i].nodeEp);
} }
tsDMnodeIpSet.inUse = tsDMnodeInfos.inUse; tsDMnodeIpSet.inUse = tsDMnodeInfos.inUse;
...@@ -461,7 +461,7 @@ static bool dnodeReadMnodeInfos() { ...@@ -461,7 +461,7 @@ static bool dnodeReadMnodeInfos() {
sprintf(ipFile, "%s/mnodeIpList.json", tsDnodeDir); sprintf(ipFile, "%s/mnodeIpList.json", tsDnodeDir);
FILE *fp = fopen(ipFile, "r"); FILE *fp = fopen(ipFile, "r");
if (!fp) { if (!fp) {
dTrace("failed to read mnodeIpList.json, file not exist"); dDebug("failed to read mnodeIpList.json, file not exist");
return false; return false;
} }
...@@ -530,9 +530,9 @@ static bool dnodeReadMnodeInfos() { ...@@ -530,9 +530,9 @@ static bool dnodeReadMnodeInfos() {
ret = true; ret = true;
dPrint("read mnode iplist successed, numOfIps:%d inUse:%d", tsDMnodeInfos.nodeNum, tsDMnodeInfos.inUse); dInfo("read mnode iplist successed, numOfIps:%d inUse:%d", tsDMnodeInfos.nodeNum, tsDMnodeInfos.inUse);
for (int32_t i = 0; i < tsDMnodeInfos.nodeNum; i++) { for (int32_t i = 0; i < tsDMnodeInfos.nodeNum; i++) {
dPrint("mnode:%d, %s", tsDMnodeInfos.nodeInfos[i].nodeId, tsDMnodeInfos.nodeInfos[i].nodeEp); dInfo("mnode:%d, %s", tsDMnodeInfos.nodeInfos[i].nodeId, tsDMnodeInfos.nodeInfos[i].nodeEp);
} }
PARSE_OVER: PARSE_OVER:
...@@ -572,7 +572,7 @@ static void dnodeSaveMnodeInfos() { ...@@ -572,7 +572,7 @@ static void dnodeSaveMnodeInfos() {
fclose(fp); fclose(fp);
free(content); free(content);
dPrint("save mnode iplist successed"); dInfo("save mnode iplist successed");
} }
char *dnodeGetMnodeMasterEp() { char *dnodeGetMnodeMasterEp() {
...@@ -645,7 +645,7 @@ static bool dnodeReadDnodeCfg() { ...@@ -645,7 +645,7 @@ static bool dnodeReadDnodeCfg() {
FILE *fp = fopen(dnodeCfgFile, "r"); FILE *fp = fopen(dnodeCfgFile, "r");
if (!fp) { if (!fp) {
dTrace("failed to read dnodeCfg.json, file not exist"); dDebug("failed to read dnodeCfg.json, file not exist");
return false; return false;
} }
...@@ -676,7 +676,7 @@ static bool dnodeReadDnodeCfg() { ...@@ -676,7 +676,7 @@ static bool dnodeReadDnodeCfg() {
ret = true; ret = true;
dPrint("read numOfVnodes successed, dnodeId:%d", tsDnodeCfg.dnodeId); dInfo("read numOfVnodes successed, dnodeId:%d", tsDnodeCfg.dnodeId);
PARSE_CFG_OVER: PARSE_CFG_OVER:
free(content); free(content);
...@@ -705,12 +705,12 @@ static void dnodeSaveDnodeCfg() { ...@@ -705,12 +705,12 @@ static void dnodeSaveDnodeCfg() {
fclose(fp); fclose(fp);
free(content); free(content);
dPrint("save dnodeId successed"); dInfo("save dnodeId successed");
} }
void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg) { void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg) {
if (tsDnodeCfg.dnodeId == 0) { if (tsDnodeCfg.dnodeId == 0) {
dPrint("dnodeId is set to %d", pCfg->dnodeId); dInfo("dnodeId is set to %d", pCfg->dnodeId);
tsDnodeCfg.dnodeId = pCfg->dnodeId; tsDnodeCfg.dnodeId = pCfg->dnodeId;
dnodeSaveDnodeCfg(); dnodeSaveDnodeCfg();
} }
...@@ -731,11 +731,11 @@ void dnodeSendRedirectMsg(SRpcMsg *rpcMsg, bool forShell) { ...@@ -731,11 +731,11 @@ void dnodeSendRedirectMsg(SRpcMsg *rpcMsg, bool forShell) {
dnodeGetMnodeIpSetForPeer(&ipSet); dnodeGetMnodeIpSetForPeer(&ipSet);
} }
dTrace("msg:%s will be redirected, dnodeIp:%s user:%s, numOfIps:%d inUse:%d", taosMsg[rpcMsg->msgType], dDebug("msg:%s will be redirected, dnodeIp:%s user:%s, numOfIps:%d inUse:%d", taosMsg[rpcMsg->msgType],
taosIpStr(connInfo.clientIp), connInfo.user, ipSet.numOfIps, ipSet.inUse); taosIpStr(connInfo.clientIp), connInfo.user, ipSet.numOfIps, ipSet.inUse);
for (int i = 0; i < ipSet.numOfIps; ++i) { for (int i = 0; i < ipSet.numOfIps; ++i) {
dTrace("mnode index:%d %s:%d", i, ipSet.fqdn[i], ipSet.port[i]); dDebug("mnode index:%d %s:%d", i, ipSet.fqdn[i], ipSet.port[i]);
ipSet.port[i] = htons(ipSet.port[i]); ipSet.port[i] = htons(ipSet.port[i]);
} }
......
...@@ -127,14 +127,14 @@ void dnodeProcessModuleStatus(uint32_t moduleStatus) { ...@@ -127,14 +127,14 @@ void dnodeProcessModuleStatus(uint32_t moduleStatus) {
for (int32_t module = TSDB_MOD_MNODE; module < TSDB_MOD_HTTP; ++module) { for (int32_t module = TSDB_MOD_MNODE; module < TSDB_MOD_HTTP; ++module) {
bool enableModule = moduleStatus & (1 << module); bool enableModule = moduleStatus & (1 << module);
if (!tsModule[module].enable && enableModule) { if (!tsModule[module].enable && enableModule) {
dPrint("module status:%u is received, start %s module", tsModuleStatus, tsModule[module].name); dInfo("module status:%u is received, start %s module", tsModuleStatus, tsModule[module].name);
tsModule[module].enable = true; tsModule[module].enable = true;
dnodeSetModuleStatus(module); dnodeSetModuleStatus(module);
(*tsModule[module].startFp)(); (*tsModule[module].startFp)();
} }
if (tsModule[module].enable && !enableModule) { if (tsModule[module].enable && !enableModule) {
dPrint("module status:%u is received, stop %s module", tsModuleStatus, tsModule[module].name); dInfo("module status:%u is received, stop %s module", tsModuleStatus, tsModule[module].name);
tsModule[module].enable = false; tsModule[module].enable = false;
dnodeUnSetModuleStatus(module); dnodeUnSetModuleStatus(module);
(*tsModule[module].stopFp)(); (*tsModule[module].stopFp)();
......
...@@ -70,7 +70,7 @@ int32_t dnodeInitServer() { ...@@ -70,7 +70,7 @@ int32_t dnodeInitServer() {
return -1; return -1;
} }
dPrint("inter-dnodes RPC server is opened"); dInfo("inter-dnodes RPC server is opened");
return 0; return 0;
} }
...@@ -78,7 +78,7 @@ void dnodeCleanupServer() { ...@@ -78,7 +78,7 @@ void dnodeCleanupServer() {
if (tsDnodeServerRpc) { if (tsDnodeServerRpc) {
rpcClose(tsDnodeServerRpc); rpcClose(tsDnodeServerRpc);
tsDnodeServerRpc = NULL; tsDnodeServerRpc = NULL;
dPrint("inter-dnodes RPC server is closed"); dInfo("inter-dnodes RPC server is closed");
} }
} }
...@@ -95,7 +95,7 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcIpSet *pIpSet) { ...@@ -95,7 +95,7 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcIpSet *pIpSet) {
rspMsg.code = TSDB_CODE_RPC_NOT_READY; rspMsg.code = TSDB_CODE_RPC_NOT_READY;
rpcSendResponse(&rspMsg); rpcSendResponse(&rspMsg);
rpcFreeCont(pMsg->pCont); rpcFreeCont(pMsg->pCont);
dTrace("RPC %p, msg:%s is ignored since dnode not running", pMsg->handle, taosMsg[pMsg->msgType]); dDebug("RPC %p, msg:%s is ignored since dnode not running", pMsg->handle, taosMsg[pMsg->msgType]);
return; return;
} }
...@@ -108,7 +108,7 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcIpSet *pIpSet) { ...@@ -108,7 +108,7 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcIpSet *pIpSet) {
if (dnodeProcessReqMsgFp[pMsg->msgType]) { if (dnodeProcessReqMsgFp[pMsg->msgType]) {
(*dnodeProcessReqMsgFp[pMsg->msgType])(pMsg); (*dnodeProcessReqMsgFp[pMsg->msgType])(pMsg);
} else { } else {
dTrace("RPC %p, message:%s not processed", pMsg->handle, taosMsg[pMsg->msgType]); dDebug("RPC %p, message:%s not processed", pMsg->handle, taosMsg[pMsg->msgType]);
rspMsg.code = TSDB_CODE_DND_MSG_NOT_PROCESSED; rspMsg.code = TSDB_CODE_DND_MSG_NOT_PROCESSED;
rpcSendResponse(&rspMsg); rpcSendResponse(&rspMsg);
rpcFreeCont(pMsg->pCont); rpcFreeCont(pMsg->pCont);
...@@ -135,7 +135,7 @@ int32_t dnodeInitClient() { ...@@ -135,7 +135,7 @@ int32_t dnodeInitClient() {
return -1; return -1;
} }
dPrint("inter-dnodes rpc client is opened"); dInfo("inter-dnodes rpc client is opened");
return 0; return 0;
} }
...@@ -143,7 +143,7 @@ void dnodeCleanupClient() { ...@@ -143,7 +143,7 @@ void dnodeCleanupClient() {
if (tsDnodeClientRpc) { if (tsDnodeClientRpc) {
rpcClose(tsDnodeClientRpc); rpcClose(tsDnodeClientRpc);
tsDnodeClientRpc = NULL; tsDnodeClientRpc = NULL;
dPrint("inter-dnodes rpc client is closed"); dInfo("inter-dnodes rpc client is closed");
} }
} }
......
...@@ -97,7 +97,7 @@ int32_t dnodeInitShell() { ...@@ -97,7 +97,7 @@ int32_t dnodeInitShell() {
return -1; return -1;
} }
dPrint("shell rpc server is opened"); dInfo("shell rpc server is opened");
return 0; return 0;
} }
...@@ -154,7 +154,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char ...@@ -154,7 +154,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
rpcMsg.contLen = sizeof(SDMAuthMsg); rpcMsg.contLen = sizeof(SDMAuthMsg);
rpcMsg.msgType = TSDB_MSG_TYPE_DM_AUTH; rpcMsg.msgType = TSDB_MSG_TYPE_DM_AUTH;
dTrace("user:%s, send auth msg to mnode", user); dDebug("user:%s, send auth msg to mnode", user);
SRpcMsg rpcRsp = {0}; SRpcMsg rpcRsp = {0};
dnodeSendMsgToDnodeRecv(&rpcMsg, &rpcRsp); dnodeSendMsgToDnodeRecv(&rpcMsg, &rpcRsp);
...@@ -162,7 +162,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char ...@@ -162,7 +162,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
dError("user:%s, auth msg received from mnode, error:%s", user, tstrerror(rpcRsp.code)); dError("user:%s, auth msg received from mnode, error:%s", user, tstrerror(rpcRsp.code));
} else { } else {
SDMAuthRsp *pRsp = rpcRsp.pCont; SDMAuthRsp *pRsp = rpcRsp.pCont;
dTrace("user:%s, auth msg received from mnode", user); dDebug("user:%s, auth msg received from mnode", user);
memcpy(secret, pRsp->secret, TSDB_KEY_LEN); memcpy(secret, pRsp->secret, TSDB_KEY_LEN);
memcpy(ckey, pRsp->ckey, TSDB_KEY_LEN); memcpy(ckey, pRsp->ckey, TSDB_KEY_LEN);
*spi = pRsp->spi; *spi = pRsp->spi;
...@@ -174,7 +174,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char ...@@ -174,7 +174,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
} }
void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t sid) { void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t sid) {
dTrace("vgId:%d, sid:%d send config table msg to mnode", vgId, sid); dDebug("vgId:%d, sid:%d send config table msg to mnode", vgId, sid);
int32_t contLen = sizeof(SDMConfigTableMsg); int32_t contLen = sizeof(SDMConfigTableMsg);
SDMConfigTableMsg *pMsg = rpcMallocCont(contLen); SDMConfigTableMsg *pMsg = rpcMallocCont(contLen);
...@@ -197,7 +197,7 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t sid) { ...@@ -197,7 +197,7 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t sid) {
dError("vgId:%d, sid:%d failed to config table from mnode", vgId, sid); dError("vgId:%d, sid:%d failed to config table from mnode", vgId, sid);
return NULL; return NULL;
} else { } else {
dPrint("vgId:%d, sid:%d config table msg is received", vgId, sid); dInfo("vgId:%d, sid:%d config table msg is received", vgId, sid);
// delete this after debug finished // delete this after debug finished
SMDCreateTableMsg *pTable = rpcRsp.pCont; SMDCreateTableMsg *pTable = rpcRsp.pCont;
...@@ -205,7 +205,7 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t sid) { ...@@ -205,7 +205,7 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t sid) {
int16_t numOfTags = htons(pTable->numOfTags); int16_t numOfTags = htons(pTable->numOfTags);
int32_t sid = htonl(pTable->sid); int32_t sid = htonl(pTable->sid);
uint64_t uid = htobe64(pTable->uid); uint64_t uid = htobe64(pTable->uid);
dPrint("table:%s, numOfColumns:%d numOfTags:%d sid:%d uid:%" PRIu64, pTable->tableId, numOfColumns, numOfTags, sid, uid); dInfo("table:%s, numOfColumns:%d numOfTags:%d sid:%d uid:%" PRIu64, pTable->tableId, numOfColumns, numOfTags, sid, uid);
return rpcRsp.pCont; return rpcRsp.pCont;
} }
......
...@@ -92,7 +92,7 @@ int32_t main(int32_t argc, char *argv[]) { ...@@ -92,7 +92,7 @@ int32_t main(int32_t argc, char *argv[]) {
// Initialize the system // Initialize the system
if (dnodeInitSystem() < 0) { if (dnodeInitSystem() < 0) {
syslog(LOG_ERR, "Error initialize TDengine system"); syslog(LOG_ERR, "Error initialize TDengine system");
dPrint("Failed to start TDengine, please check the log at:%s", tsLogDir); dInfo("Failed to start TDengine, please check the log at:%s", tsLogDir);
closelog(); closelog();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -109,14 +109,14 @@ int32_t main(int32_t argc, char *argv[]) { ...@@ -109,14 +109,14 @@ int32_t main(int32_t argc, char *argv[]) {
dnodeCleanUpSystem(); dnodeCleanUpSystem();
// close the syslog // close the syslog
syslog(LOG_INFO, "Shut down TDengine service successfully"); syslog(LOG_INFO, "Shut down TDengine service successfully");
dPrint("TDengine is shut down!"); dInfo("TDengine is shut down!");
closelog(); closelog();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
static void signal_handler(int32_t signum, siginfo_t *sigInfo, void *context) { static void signal_handler(int32_t signum, siginfo_t *sigInfo, void *context) {
if (signum == SIGUSR1) { if (signum == SIGUSR1) {
taosCfgDynamicOptions("debugFlag 135"); taosCfgDynamicOptions("debugFlag 151");
return; return;
} }
if (signum == SIGUSR2) { if (signum == SIGUSR2) {
...@@ -127,7 +127,7 @@ static void signal_handler(int32_t signum, siginfo_t *sigInfo, void *context) { ...@@ -127,7 +127,7 @@ static void signal_handler(int32_t signum, siginfo_t *sigInfo, void *context) {
syslog(LOG_INFO, "Shut down signal is %d", signum); syslog(LOG_INFO, "Shut down signal is %d", signum);
syslog(LOG_INFO, "Shutting down TDengine service..."); syslog(LOG_INFO, "Shutting down TDengine service...");
// clean the system. // clean the system.
dPrint("shut down signal is %d, sender PID:%d", signum, sigInfo->si_pid); dInfo("shut down signal is %d, sender PID:%d", signum, sigInfo->si_pid);
// protect the application from receive another signal // protect the application from receive another signal
struct sigaction act = {{0}}; struct sigaction act = {{0}};
......
...@@ -59,7 +59,7 @@ int32_t dnodeInitVnodeRead() { ...@@ -59,7 +59,7 @@ int32_t dnodeInitVnodeRead() {
pWorker->workerId = i; pWorker->workerId = i;
} }
dPrint("dnode read is opened"); dInfo("dnode read is opened");
return 0; return 0;
} }
...@@ -81,7 +81,7 @@ void dnodeCleanupVnodeRead() { ...@@ -81,7 +81,7 @@ void dnodeCleanupVnodeRead() {
free(readPool.readWorker); free(readPool.readWorker);
taosCloseQset(readQset); taosCloseQset(readQset);
dPrint("dnode read is closed"); dInfo("dnode read is closed");
} }
void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) { void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) {
...@@ -156,11 +156,11 @@ void *dnodeAllocateVnodeRqueue(void *pVnode) { ...@@ -156,11 +156,11 @@ void *dnodeAllocateVnodeRqueue(void *pVnode) {
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
readPool.num++; readPool.num++;
dTrace("read worker:%d is launched, total:%d", pWorker->workerId, readPool.num); dDebug("read worker:%d is launched, total:%d", pWorker->workerId, readPool.num);
} while (readPool.num < readPool.min); } while (readPool.num < readPool.min);
} }
dTrace("pVnode:%p, read queue:%p is allocated", pVnode, queue); dDebug("pVnode:%p, read queue:%p is allocated", pVnode, queue);
return queue; return queue;
} }
...@@ -207,11 +207,11 @@ static void *dnodeProcessReadQueue(void *param) { ...@@ -207,11 +207,11 @@ static void *dnodeProcessReadQueue(void *param) {
while (1) { while (1) {
if (taosReadQitemFromQset(readQset, &type, (void **)&pReadMsg, &pVnode) == 0) { if (taosReadQitemFromQset(readQset, &type, (void **)&pReadMsg, &pVnode) == 0) {
dTrace("dnodeProcessReadQueee: got no message from qset, exiting..."); dDebug("dnodeProcessReadQueee: got no message from qset, exiting...");
break; break;
} }
dTrace("%p, msg:%s will be processed in vread queue", pReadMsg->rpcMsg.ahandle, taosMsg[pReadMsg->rpcMsg.msgType]); dDebug("%p, msg:%s will be processed in vread queue", pReadMsg->rpcMsg.ahandle, taosMsg[pReadMsg->rpcMsg.msgType]);
int32_t code = vnodeProcessRead(pVnode, pReadMsg); int32_t code = vnodeProcessRead(pVnode, pReadMsg);
dnodeSendRpcReadRsp(pVnode, pReadMsg, code); dnodeSendRpcReadRsp(pVnode, pReadMsg, code);
taosFreeQitem(pReadMsg); taosFreeQitem(pReadMsg);
...@@ -227,7 +227,7 @@ static void dnodeHandleIdleReadWorker(SReadWorker *pWorker) { ...@@ -227,7 +227,7 @@ static void dnodeHandleIdleReadWorker(SReadWorker *pWorker) {
if (num == 0 || (num <= readPool.min && readPool.num > readPool.min)) { if (num == 0 || (num <= readPool.min && readPool.num > readPool.min)) {
readPool.num--; readPool.num--;
dTrace("read worker:%d is released, total:%d", pWorker->workerId, readPool.num); dDebug("read worker:%d is released, total:%d", pWorker->workerId, readPool.num);
pthread_exit(NULL); pthread_exit(NULL);
} else { } else {
usleep(30000); usleep(30000);
......
...@@ -63,7 +63,7 @@ int32_t dnodeInitVnodeWrite() { ...@@ -63,7 +63,7 @@ int32_t dnodeInitVnodeWrite() {
wWorkerPool.writeWorker[i].workerId = i; wWorkerPool.writeWorker[i].workerId = i;
} }
dPrint("dnode write is opened"); dInfo("dnode write is opened");
return 0; return 0;
} }
...@@ -85,7 +85,7 @@ void dnodeCleanupVnodeWrite() { ...@@ -85,7 +85,7 @@ void dnodeCleanupVnodeWrite() {
} }
free(wWorkerPool.writeWorker); free(wWorkerPool.writeWorker);
dPrint("dnode write is closed"); dInfo("dnode write is closed");
} }
void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) { void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) {
...@@ -153,7 +153,7 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) { ...@@ -153,7 +153,7 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) {
taosCloseQueue(queue); taosCloseQueue(queue);
queue = NULL; queue = NULL;
} else { } else {
dTrace("write worker:%d is launched", pWorker->workerId); dDebug("write worker:%d is launched", pWorker->workerId);
wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max; wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max;
} }
...@@ -163,7 +163,7 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) { ...@@ -163,7 +163,7 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) {
wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max; wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max;
} }
dTrace("pVnode:%p, write queue:%p is allocated", pVnode, queue); dDebug("pVnode:%p, write queue:%p is allocated", pVnode, queue);
return queue; return queue;
} }
...@@ -204,7 +204,7 @@ static void *dnodeProcessWriteQueue(void *param) { ...@@ -204,7 +204,7 @@ static void *dnodeProcessWriteQueue(void *param) {
while (1) { while (1) {
numOfMsgs = taosReadAllQitemsFromQset(pWorker->qset, pWorker->qall, &pVnode); numOfMsgs = taosReadAllQitemsFromQset(pWorker->qset, pWorker->qall, &pVnode);
if (numOfMsgs == 0) { if (numOfMsgs == 0) {
dTrace("dnodeProcessWriteQueee: got no message from qset, exiting..."); dDebug("dnodeProcessWriteQueee: got no message from qset, exiting...");
break; break;
} }
...@@ -217,7 +217,7 @@ static void *dnodeProcessWriteQueue(void *param) { ...@@ -217,7 +217,7 @@ static void *dnodeProcessWriteQueue(void *param) {
pHead->msgType = pWrite->rpcMsg.msgType; pHead->msgType = pWrite->rpcMsg.msgType;
pHead->version = 0; pHead->version = 0;
pHead->len = pWrite->contLen; pHead->len = pWrite->contLen;
dTrace("%p, msg:%s will be processed in vwrite queue", pWrite->rpcMsg.ahandle, taosMsg[pWrite->rpcMsg.msgType]); dDebug("%p, msg:%s will be processed in vwrite queue", pWrite->rpcMsg.ahandle, taosMsg[pWrite->rpcMsg.msgType]);
} else { } else {
pHead = (SWalHead *)item; pHead = (SWalHead *)item;
} }
...@@ -256,7 +256,7 @@ static void dnodeHandleIdleWorker(SWriteWorker *pWorker) { ...@@ -256,7 +256,7 @@ static void dnodeHandleIdleWorker(SWriteWorker *pWorker) {
taosFreeQall(pWorker->qall); taosFreeQall(pWorker->qall);
taosCloseQset(pWorker->qset); taosCloseQset(pWorker->qset);
pWorker->qset = NULL; pWorker->qset = NULL;
dTrace("write worker:%d is released", pWorker->workerId); dDebug("write worker:%d is released", pWorker->workerId);
pthread_exit(NULL); pthread_exit(NULL);
} }
} }
...@@ -27,23 +27,23 @@ extern int32_t mDebugFlag; ...@@ -27,23 +27,23 @@ extern int32_t mDebugFlag;
extern int32_t sdbDebugFlag; extern int32_t sdbDebugFlag;
// mnode log function // mnode log function
#define mError(...) { if (mDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); }} #define mFatal(...) { if (mDebugFlag & DEBUG_FATAL) { taosPrintLog("MND FATAL ", mDebugFlag, __VA_ARGS__); }}
#define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", mDebugFlag, __VA_ARGS__); }} #define mError(...) { if (mDebugFlag & DEBUG_ERROR) { taosPrintLog("MND ERROR ", mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mDebugFlag, __VA_ARGS__); }} #define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("MND WARN ", mDebugFlag, __VA_ARGS__); }}
#define mPrint(...) { taosPrintLog("MND ", 255, __VA_ARGS__); } #define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND INFO ", mDebugFlag, __VA_ARGS__); }}
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND DEBUG ", mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND TRACE ", mDebugFlag, __VA_ARGS__); }}
#define sdbFatal(...) { if (sdbDebugFlag & DEBUG_FATAL) { taosPrintLog("SDB FATAL ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbError(...) { if (sdbDebugFlag & DEBUG_ERROR) { taosPrintLog("SDB ERROR ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbWarn(...) { if (sdbDebugFlag & DEBUG_WARN) { taosPrintLog("SDB WARN ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbInfo(...) { if (sdbDebugFlag & DEBUG_INFO) { taosPrintLog("SDB INFO ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbDebug(...) { if (sdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("SDB DEBUG ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbTrace(...) { if (sdbDebugFlag & DEBUG_TRACE) { taosPrintLog("SDB TRACE ", sdbDebugFlag, __VA_ARGS__); }}
#define mLError(...) { monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__) } #define mLError(...) { monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__) }
#define mLWarn(...) { monitorSaveLog(1, __VA_ARGS__); mWarn(__VA_ARGS__) } #define mLWarn(...) { monitorSaveLog(1, __VA_ARGS__); mWarn(__VA_ARGS__) }
#define mLPrint(...) { monitorSaveLog(0, __VA_ARGS__); mPrint(__VA_ARGS__) } #define mLInfo(...) { monitorSaveLog(0, __VA_ARGS__); mInfo(__VA_ARGS__) }
#define sdbError(...) { if (sdbDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR SDB ", 255, __VA_ARGS__); }}
#define sdbWarn(...) { if (sdbDebugFlag & DEBUG_WARN) { taosPrintLog("WARN SDB ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbTrace(...) { if (sdbDebugFlag & DEBUG_TRACE) { taosPrintLog("SDB ", sdbDebugFlag, __VA_ARGS__);}}
#define sdbPrint(...) { taosPrintLog("SDB ", 255, __VA_ARGS__); }
#define sdbLError(...) { monitorSaveLog(2, __VA_ARGS__); sdbError(__VA_ARGS__) }
#define sdbLWarn(...) { monitorSaveLog(1, __VA_ARGS__); sdbWarn(__VA_ARGS__) }
#define sdbLPrint(...) { monitorSaveLog(0, __VA_ARGS__); sdbPrint(__VA_ARGS__) }
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -83,7 +83,7 @@ static int32_t mnodeAcctActionDecode(SSdbOper *pOper) { ...@@ -83,7 +83,7 @@ static int32_t mnodeAcctActionDecode(SSdbOper *pOper) {
static int32_t mnodeAcctActionRestored() { static int32_t mnodeAcctActionRestored() {
int32_t numOfRows = sdbGetNumOfRows(tsAcctSdb); int32_t numOfRows = sdbGetNumOfRows(tsAcctSdb);
if (numOfRows <= 0 && dnodeIsFirstDeploy()) { if (numOfRows <= 0 && dnodeIsFirstDeploy()) {
mPrint("dnode first deploy, create root acct"); mInfo("dnode first deploy, create root acct");
int32_t code = mnodeCreateRootAcct(); int32_t code = mnodeCreateRootAcct();
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
mError("failed to create root account, reason:%s", tstrerror(code)); mError("failed to create root account, reason:%s", tstrerror(code));
...@@ -121,7 +121,7 @@ int32_t mnodeInitAccts() { ...@@ -121,7 +121,7 @@ int32_t mnodeInitAccts() {
return -1; return -1;
} }
mTrace("table:%s, hash is created", tableDesc.tableName); mDebug("table:%s, hash is created", tableDesc.tableName);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -62,7 +62,7 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) { ...@@ -62,7 +62,7 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
pVgroup->vnodeGid[0].dnodeId = pSelDnode->dnodeId; pVgroup->vnodeGid[0].dnodeId = pSelDnode->dnodeId;
pVgroup->vnodeGid[0].pDnode = pSelDnode; pVgroup->vnodeGid[0].pDnode = pSelDnode;
mTrace("dnode:%d, alloc one vnode to vgroup, openVnodes:%d", pSelDnode->dnodeId, pSelDnode->openVnodes); mDebug("dnode:%d, alloc one vnode to vgroup, openVnodes:%d", pSelDnode->dnodeId, pSelDnode->openVnodes);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -157,7 +157,7 @@ int32_t mnodeInitDbs() { ...@@ -157,7 +157,7 @@ int32_t mnodeInitDbs() {
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DB, mnodeGetDbMeta); mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DB, mnodeGetDbMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DB, mnodeRetrieveDbs); mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DB, mnodeRetrieveDbs);
mTrace("table:dbs table is created"); mDebug("table:dbs table is created");
return 0; return 0;
} }
...@@ -314,7 +314,7 @@ static void mnodeSetDefaultDbCfg(SDbCfg *pCfg) { ...@@ -314,7 +314,7 @@ static void mnodeSetDefaultDbCfg(SDbCfg *pCfg) {
static int32_t mnodeCreateDbCb(SMnodeMsg *pMsg, int32_t code) { static int32_t mnodeCreateDbCb(SMnodeMsg *pMsg, int32_t code) {
SDbObj *pDb = pMsg->pDb; SDbObj *pDb = pMsg->pDb;
if (pDb != NULL) { if (pDb != NULL) {
mLPrint("db:%s, is created by %s", pDb->name, mnodeGetUserFromMsg(pMsg)); mLInfo("db:%s, is created by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
} }
return code; return code;
...@@ -328,7 +328,7 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate, void *pMs ...@@ -328,7 +328,7 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate, void *pMs
if (pDb != NULL) { if (pDb != NULL) {
mnodeDecDbRef(pDb); mnodeDecDbRef(pDb);
if (pCreate->ignoreExist) { if (pCreate->ignoreExist) {
mTrace("db:%s, already exist, ignore exist is set", pCreate->db); mDebug("db:%s, already exist, ignore exist is set", pCreate->db);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} else { } else {
mError("db:%s, is already exist, ignore exist not set", pCreate->db); mError("db:%s, is already exist, ignore exist not set", pCreate->db);
...@@ -380,7 +380,7 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate, void *pMs ...@@ -380,7 +380,7 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate, void *pMs
code = sdbInsertRow(&oper); code = sdbInsertRow(&oper);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
tfree(pDb); tfree(pDb);
mLPrint("db:%s, failed to create, reason:%s", pDb->name, tstrerror(code)); mLInfo("db:%s, failed to create, reason:%s", pDb->name, tstrerror(code));
return code; return code;
} else { } else {
return TSDB_CODE_MND_ACTION_IN_PROGRESS; return TSDB_CODE_MND_ACTION_IN_PROGRESS;
...@@ -397,17 +397,17 @@ bool mnodeCheckIsMonitorDB(char *db, char *monitordb) { ...@@ -397,17 +397,17 @@ bool mnodeCheckIsMonitorDB(char *db, char *monitordb) {
#if 0 #if 0
void mnodePrintVgroups(SDbObj *pDb, char *oper) { void mnodePrintVgroups(SDbObj *pDb, char *oper) {
mPrint("db:%s, vgroup link from head, oper:%s", pDb->name, oper); mInfo("db:%s, vgroup link from head, oper:%s", pDb->name, oper);
SVgObj *pVgroup = pDb->pHead; SVgObj *pVgroup = pDb->pHead;
while (pVgroup != NULL) { while (pVgroup != NULL) {
mPrint("vgId:%d", pVgroup->vgId); mInfo("vgId:%d", pVgroup->vgId);
pVgroup = pVgroup->next; pVgroup = pVgroup->next;
} }
mPrint("db:%s, vgroup link from tail", pDb->name, pDb->numOfVgroups); mInfo("db:%s, vgroup link from tail", pDb->name, pDb->numOfVgroups);
pVgroup = pDb->pTail; pVgroup = pDb->pTail;
while (pVgroup != NULL) { while (pVgroup != NULL) {
mPrint("vgId:%d", pVgroup->vgId); mInfo("vgId:%d", pVgroup->vgId);
pVgroup = pVgroup->prev; pVgroup = pVgroup->prev;
} }
} }
...@@ -814,12 +814,12 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -814,12 +814,12 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
} }
if (totalBlocks > 0 && totalBlocks != pDb->cfg.totalBlocks) { if (totalBlocks > 0 && totalBlocks != pDb->cfg.totalBlocks) {
mPrint("db:%s, blocks:%d change to %d", pDb->name, pDb->cfg.totalBlocks, totalBlocks); mInfo("db:%s, blocks:%d change to %d", pDb->name, pDb->cfg.totalBlocks, totalBlocks);
newCfg.totalBlocks = totalBlocks; newCfg.totalBlocks = totalBlocks;
} }
if (maxTables > 0) { if (maxTables > 0) {
mPrint("db:%s, maxTables:%d change to %d", pDb->name, pDb->cfg.maxTables, maxTables); mInfo("db:%s, maxTables:%d change to %d", pDb->name, pDb->cfg.maxTables, maxTables);
newCfg.maxTables = maxTables; newCfg.maxTables = maxTables;
if (newCfg.maxTables < pDb->cfg.maxTables) { if (newCfg.maxTables < pDb->cfg.maxTables) {
mError("db:%s, tables:%d should larger than origin:%d", pDb->name, newCfg.maxTables, pDb->cfg.maxTables); mError("db:%s, tables:%d should larger than origin:%d", pDb->name, newCfg.maxTables, pDb->cfg.maxTables);
...@@ -833,17 +833,17 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -833,17 +833,17 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
} }
if (daysToKeep > 0 && daysToKeep != pDb->cfg.daysToKeep) { if (daysToKeep > 0 && daysToKeep != pDb->cfg.daysToKeep) {
mTrace("db:%s, daysToKeep:%d change to %d", pDb->name, pDb->cfg.daysToKeep, daysToKeep); mDebug("db:%s, daysToKeep:%d change to %d", pDb->name, pDb->cfg.daysToKeep, daysToKeep);
newCfg.daysToKeep = daysToKeep; newCfg.daysToKeep = daysToKeep;
} }
if (daysToKeep1 > 0 && daysToKeep1 != pDb->cfg.daysToKeep1) { if (daysToKeep1 > 0 && daysToKeep1 != pDb->cfg.daysToKeep1) {
mTrace("db:%s, daysToKeep1:%d change to %d", pDb->name, pDb->cfg.daysToKeep1, daysToKeep1); mDebug("db:%s, daysToKeep1:%d change to %d", pDb->name, pDb->cfg.daysToKeep1, daysToKeep1);
newCfg.daysToKeep1 = daysToKeep1; newCfg.daysToKeep1 = daysToKeep1;
} }
if (daysToKeep2 > 0 && daysToKeep2 != pDb->cfg.daysToKeep2) { if (daysToKeep2 > 0 && daysToKeep2 != pDb->cfg.daysToKeep2) {
mTrace("db:%s, daysToKeep2:%d change to %d", pDb->name, pDb->cfg.daysToKeep2, daysToKeep2); mDebug("db:%s, daysToKeep2:%d change to %d", pDb->name, pDb->cfg.daysToKeep2, daysToKeep2);
newCfg.daysToKeep2 = daysToKeep2; newCfg.daysToKeep2 = daysToKeep2;
} }
...@@ -868,7 +868,7 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -868,7 +868,7 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
} }
if (compression >= 0 && compression != pDb->cfg.compression) { if (compression >= 0 && compression != pDb->cfg.compression) {
mTrace("db:%s, compression:%d change to %d", pDb->name, pDb->cfg.compression, compression); mDebug("db:%s, compression:%d change to %d", pDb->name, pDb->cfg.compression, compression);
newCfg.compression = compression; newCfg.compression = compression;
} }
...@@ -878,7 +878,7 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -878,7 +878,7 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
} }
if (replications > 0 && replications != pDb->cfg.replications) { if (replications > 0 && replications != pDb->cfg.replications) {
mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications); mDebug("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications);
newCfg.replications = replications; newCfg.replications = replications;
if (pDb->cfg.walLevel < TSDB_MIN_WAL_LEVEL) { if (pDb->cfg.walLevel < TSDB_MIN_WAL_LEVEL) {
...@@ -916,8 +916,8 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) { ...@@ -916,8 +916,8 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) {
} }
sdbFreeIter(pIter); sdbFreeIter(pIter);
mTrace("db:%s, all vgroups is altered", pDb->name); mDebug("db:%s, all vgroups is altered", pDb->name);
mLPrint("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg)); mLInfo("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
balanceAsyncNotify(); balanceAsyncNotify();
...@@ -957,7 +957,7 @@ static int32_t mnodeAlterDb(SDbObj *pDb, SCMAlterDbMsg *pAlter, void *pMsg) { ...@@ -957,7 +957,7 @@ static int32_t mnodeAlterDb(SDbObj *pDb, SCMAlterDbMsg *pAlter, void *pMsg) {
static int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg) { static int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg) {
SCMAlterDbMsg *pAlter = pMsg->rpcMsg.pCont; SCMAlterDbMsg *pAlter = pMsg->rpcMsg.pCont;
mTrace("db:%s, alter db msg is received from thandle:%p", pAlter->db, pMsg->rpcMsg.handle); mDebug("db:%s, alter db msg is received from thandle:%p", pAlter->db, pMsg->rpcMsg.handle);
if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pAlter->db); if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pAlter->db);
if (pMsg->pDb == NULL) { if (pMsg->pDb == NULL) {
...@@ -973,7 +973,7 @@ static int32_t mnodeDropDbCb(SMnodeMsg *pMsg, int32_t code) { ...@@ -973,7 +973,7 @@ static int32_t mnodeDropDbCb(SMnodeMsg *pMsg, int32_t code) {
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
mError("db:%s, failed to drop from sdb, reason:%s", pDb->name, tstrerror(code)); mError("db:%s, failed to drop from sdb, reason:%s", pDb->name, tstrerror(code));
} else { } else {
mLPrint("db:%s, is dropped by %s", pDb->name, mnodeGetUserFromMsg(pMsg)); mLInfo("db:%s, is dropped by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
} }
return code; return code;
...@@ -983,7 +983,7 @@ static int32_t mnodeDropDb(SMnodeMsg *pMsg) { ...@@ -983,7 +983,7 @@ static int32_t mnodeDropDb(SMnodeMsg *pMsg) {
if (pMsg == NULL) return TSDB_CODE_MND_APP_ERROR; if (pMsg == NULL) return TSDB_CODE_MND_APP_ERROR;
SDbObj *pDb = pMsg->pDb; SDbObj *pDb = pMsg->pDb;
mPrint("db:%s, drop db from sdb", pDb->name); mInfo("db:%s, drop db from sdb", pDb->name);
SSdbOper oper = { SSdbOper oper = {
.type = SDB_OPER_GLOBAL, .type = SDB_OPER_GLOBAL,
...@@ -1003,12 +1003,12 @@ static int32_t mnodeDropDb(SMnodeMsg *pMsg) { ...@@ -1003,12 +1003,12 @@ static int32_t mnodeDropDb(SMnodeMsg *pMsg) {
static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg) { static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg) {
SCMDropDbMsg *pDrop = pMsg->rpcMsg.pCont; SCMDropDbMsg *pDrop = pMsg->rpcMsg.pCont;
mTrace("db:%s, drop db msg is received from thandle:%p", pDrop->db, pMsg->rpcMsg.handle); mDebug("db:%s, drop db msg is received from thandle:%p", pDrop->db, pMsg->rpcMsg.handle);
if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pDrop->db); if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pDrop->db);
if (pMsg->pDb == NULL) { if (pMsg->pDb == NULL) {
if (pDrop->ignoreNotExists) { if (pDrop->ignoreNotExists) {
mTrace("db:%s, db is not exist, think drop success", pDrop->db); mDebug("db:%s, db is not exist, think drop success", pDrop->db);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} else { } else {
mError("db:%s, failed to drop, invalid db", pDrop->db); mError("db:%s, failed to drop, invalid db", pDrop->db);
...@@ -1029,7 +1029,7 @@ static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg) { ...@@ -1029,7 +1029,7 @@ static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg) {
mnodeSendDropAllDbVgroupsMsg(pMsg->pDb); mnodeSendDropAllDbVgroupsMsg(pMsg->pDb);
mTrace("db:%s, all vgroups is dropped", pMsg->pDb->name); mDebug("db:%s, all vgroups is dropped", pMsg->pDb->name);
return mnodeDropDb(pMsg); return mnodeDropDb(pMsg);
} }
...@@ -1038,14 +1038,14 @@ void mnodeDropAllDbs(SAcctObj *pAcct) { ...@@ -1038,14 +1038,14 @@ void mnodeDropAllDbs(SAcctObj *pAcct) {
SDbObj *pDb = NULL; SDbObj *pDb = NULL;
void * pIter = NULL; void * pIter = NULL;
mPrint("acct:%s, all dbs will be dropped from sdb", pAcct->user); mInfo("acct:%s, all dbs will be dropped from sdb", pAcct->user);
while (1) { while (1) {
pIter = mnodeGetNextDb(pIter, &pDb); pIter = mnodeGetNextDb(pIter, &pDb);
if (pDb == NULL) break; if (pDb == NULL) break;
if (pDb->pAcct == pAcct) { if (pDb->pAcct == pAcct) {
mPrint("db:%s, drop db from sdb for acct:%s is dropped", pDb->name, pAcct->user); mInfo("db:%s, drop db from sdb for acct:%s is dropped", pDb->name, pAcct->user);
SSdbOper oper = { SSdbOper oper = {
.type = SDB_OPER_LOCAL, .type = SDB_OPER_LOCAL,
.table = tsDbSdb, .table = tsDbSdb,
...@@ -1060,5 +1060,5 @@ void mnodeDropAllDbs(SAcctObj *pAcct) { ...@@ -1060,5 +1060,5 @@ void mnodeDropAllDbs(SAcctObj *pAcct) {
sdbFreeIter(pIter); sdbFreeIter(pIter);
mPrint("acct:%s, all dbs:%d is dropped from sdb", pAcct->user, numOfDbs); mInfo("acct:%s, all dbs:%d is dropped from sdb", pAcct->user, numOfDbs);
} }
...@@ -83,7 +83,7 @@ static int32_t mnodeDnodeActionDelete(SSdbOper *pOper) { ...@@ -83,7 +83,7 @@ static int32_t mnodeDnodeActionDelete(SSdbOper *pOper) {
mnodeDropMnodeLocal(pDnode->dnodeId); mnodeDropMnodeLocal(pDnode->dnodeId);
balanceAsyncNotify(); balanceAsyncNotify();
mTrace("dnode:%d, all vgroups is dropped from sdb", pDnode->dnodeId); mDebug("dnode:%d, all vgroups is dropped from sdb", pDnode->dnodeId);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -118,7 +118,7 @@ static int32_t mnodeDnodeActionDecode(SSdbOper *pOper) { ...@@ -118,7 +118,7 @@ static int32_t mnodeDnodeActionDecode(SSdbOper *pOper) {
static int32_t mnodeDnodeActionRestored() { static int32_t mnodeDnodeActionRestored() {
int32_t numOfRows = sdbGetNumOfRows(tsDnodeSdb); int32_t numOfRows = sdbGetNumOfRows(tsDnodeSdb);
if (numOfRows <= 0 && dnodeIsFirstDeploy()) { if (numOfRows <= 0 && dnodeIsFirstDeploy()) {
mPrint("dnode first deploy, create dnode:%s", tsLocalEp); mInfo("dnode first deploy, create dnode:%s", tsLocalEp);
mnodeCreateDnode(tsLocalEp, NULL); mnodeCreateDnode(tsLocalEp, NULL);
SDnodeObj *pDnode = mnodeGetDnodeByEp(tsLocalEp); SDnodeObj *pDnode = mnodeGetDnodeByEp(tsLocalEp);
if (pDnode != NULL) { if (pDnode != NULL) {
...@@ -170,7 +170,7 @@ int32_t mnodeInitDnodes() { ...@@ -170,7 +170,7 @@ int32_t mnodeInitDnodes() {
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DNODE, mnodeGetDnodeMeta); mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DNODE, mnodeGetDnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DNODE, mnodeRetrieveDnodes); mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DNODE, mnodeRetrieveDnodes);
mTrace("table:dnodes table is created"); mDebug("table:dnodes table is created");
return 0; return 0;
} }
...@@ -272,13 +272,13 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) { ...@@ -272,13 +272,13 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
}; };
dnodeSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg); dnodeSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg);
mPrint("dnode:%s, is configured by %s", pCmCfgDnode->ep, pMsg->pUser->user); mInfo("dnode:%s, is configured by %s", pCmCfgDnode->ep, pMsg->pUser->user);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
static void mnodeProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) { static void mnodeProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) {
mPrint("cfg dnode rsp is received"); mInfo("cfg dnode rsp is received");
} }
static bool mnodeCheckClusterCfgPara(const SClusterCfg *clusterCfg) { static bool mnodeCheckClusterCfgPara(const SClusterCfg *clusterCfg) {
...@@ -313,7 +313,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { ...@@ -313,7 +313,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
if (pStatus->dnodeId == 0) { if (pStatus->dnodeId == 0) {
pDnode = mnodeGetDnodeByEp(pStatus->dnodeEp); pDnode = mnodeGetDnodeByEp(pStatus->dnodeEp);
if (pDnode == NULL) { if (pDnode == NULL) {
mTrace("dnode %s not created", pStatus->dnodeEp); mDebug("dnode %s not created", pStatus->dnodeEp);
return TSDB_CODE_MND_DNODE_NOT_EXIST; return TSDB_CODE_MND_DNODE_NOT_EXIST;
} }
} else { } else {
...@@ -332,9 +332,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { ...@@ -332,9 +332,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
pDnode->moduleStatus = pStatus->moduleStatus; pDnode->moduleStatus = pStatus->moduleStatus;
if (pStatus->dnodeId == 0) { if (pStatus->dnodeId == 0) {
mTrace("dnode:%d %s, first access", pDnode->dnodeId, pDnode->dnodeEp); mDebug("dnode:%d %s, first access", pDnode->dnodeId, pDnode->dnodeEp);
} else { } else {
//mTrace("dnode:%d, status received, access times %d", pDnode->dnodeId, pDnode->lastAccess); //mDebug("dnode:%d, status received, access times %d", pDnode->dnodeId, pDnode->lastAccess);
} }
int32_t openVnodes = htons(pStatus->openVnodes); int32_t openVnodes = htons(pStatus->openVnodes);
...@@ -358,7 +358,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { ...@@ -358,7 +358,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
SVgObj *pVgroup = mnodeGetVgroup(pVload->vgId); SVgObj *pVgroup = mnodeGetVgroup(pVload->vgId);
if (pVgroup == NULL) { if (pVgroup == NULL) {
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pDnode->dnodeEp); SRpcIpSet ipSet = mnodeGetIpSetFromIp(pDnode->dnodeEp);
mPrint("dnode:%d, vgId:%d not exist in mnode, drop it", pDnode->dnodeId, pVload->vgId); mInfo("dnode:%d, vgId:%d not exist in mnode, drop it", pDnode->dnodeId, pVload->vgId);
mnodeSendDropVnodeMsg(pVload->vgId, &ipSet, NULL); mnodeSendDropVnodeMsg(pVload->vgId, &ipSet, NULL);
} else { } else {
mnodeUpdateVgroupStatus(pVgroup, pDnode, pVload); mnodeUpdateVgroupStatus(pVgroup, pDnode, pVload);
...@@ -380,7 +380,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { ...@@ -380,7 +380,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
return TSDB_CODE_MND_CLUSTER_CFG_INCONSISTENT; return TSDB_CODE_MND_CLUSTER_CFG_INCONSISTENT;
} }
mTrace("dnode:%d, from offline to online", pDnode->dnodeId); mDebug("dnode:%d, from offline to online", pDnode->dnodeId);
pDnode->status = TAOS_DN_STATUS_READY; pDnode->status = TAOS_DN_STATUS_READY;
balanceSyncNotify(); balanceSyncNotify();
balanceAsyncNotify(); balanceAsyncNotify();
...@@ -437,7 +437,7 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) { ...@@ -437,7 +437,7 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) {
tfree(pDnode); tfree(pDnode);
mError("failed to create dnode:%d, result:%s", dnodeId, tstrerror(code)); mError("failed to create dnode:%d, result:%s", dnodeId, tstrerror(code));
} else { } else {
mPrint("dnode:%d is created, result:%s", pDnode->dnodeId, tstrerror(code)); mInfo("dnode:%d is created, result:%s", pDnode->dnodeId, tstrerror(code));
if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
...@@ -454,7 +454,7 @@ int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg) { ...@@ -454,7 +454,7 @@ int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg) {
int32_t code = sdbDeleteRow(&oper); int32_t code = sdbDeleteRow(&oper);
if (code == TSDB_CODE_SUCCESS) { if (code == TSDB_CODE_SUCCESS) {
mLPrint("dnode:%d, is dropped from cluster, result:%s", pDnode->dnodeId, tstrerror(code)); mLInfo("dnode:%d, is dropped from cluster, result:%s", pDnode->dnodeId, tstrerror(code));
if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
...@@ -474,7 +474,7 @@ static int32_t mnodeDropDnodeByEp(char *ep, SMnodeMsg *pMsg) { ...@@ -474,7 +474,7 @@ static int32_t mnodeDropDnodeByEp(char *ep, SMnodeMsg *pMsg) {
return TSDB_CODE_MND_NO_REMOVE_MASTER; return TSDB_CODE_MND_NO_REMOVE_MASTER;
} }
mPrint("dnode:%d, start to drop it", pDnode->dnodeId); mInfo("dnode:%d, start to drop it", pDnode->dnodeId);
#ifndef _SYNC #ifndef _SYNC
return mnodeDropDnode(pDnode, pMsg); return mnodeDropDnode(pDnode, pMsg);
#else #else
......
...@@ -83,11 +83,11 @@ static int32_t mnodeInitComponents() { ...@@ -83,11 +83,11 @@ static int32_t mnodeInitComponents() {
int32_t mnodeStartSystem() { int32_t mnodeStartSystem() {
if (tsMgmtIsRunning) { if (tsMgmtIsRunning) {
mPrint("mnode module already started..."); mInfo("mnode module already started...");
return 0; return 0;
} }
mPrint("starting to initialize mnode ..."); mInfo("starting to initialize mnode ...");
if (mkdir(tsMnodeDir, 0755) != 0 && errno != EEXIST) { if (mkdir(tsMnodeDir, 0755) != 0 && errno != EEXIST) {
mError("failed to init mnode dir:%s, reason:%s", tsMnodeDir, strerror(errno)); mError("failed to init mnode dir:%s, reason:%s", tsMnodeDir, strerror(errno));
return -1; return -1;
...@@ -104,7 +104,7 @@ int32_t mnodeStartSystem() { ...@@ -104,7 +104,7 @@ int32_t mnodeStartSystem() {
grantReset(TSDB_GRANT_ALL, 0); grantReset(TSDB_GRANT_ALL, 0);
tsMgmtIsRunning = true; tsMgmtIsRunning = true;
mPrint("mnode is initialized successfully"); mInfo("mnode is initialized successfully");
return 0; return 0;
} }
...@@ -115,7 +115,7 @@ int32_t mnodeInitSystem() { ...@@ -115,7 +115,7 @@ int32_t mnodeInitSystem() {
} }
void mnodeCleanupSystem() { void mnodeCleanupSystem() {
mPrint("starting to clean up mnode"); mInfo("starting to clean up mnode");
tsMgmtIsRunning = false; tsMgmtIsRunning = false;
dnodeFreeMnodeWqueue(); dnodeFreeMnodeWqueue();
...@@ -124,21 +124,21 @@ void mnodeCleanupSystem() { ...@@ -124,21 +124,21 @@ void mnodeCleanupSystem() {
mnodeCleanupComponents(sizeof(tsMnodeComponents) / sizeof(tsMnodeComponents[0]) - 1); mnodeCleanupComponents(sizeof(tsMnodeComponents) / sizeof(tsMnodeComponents[0]) - 1);
mnodeCleanupTimer(); mnodeCleanupTimer();
mPrint("mnode is cleaned up"); mInfo("mnode is cleaned up");
} }
void mnodeStopSystem() { void mnodeStopSystem() {
if (sdbIsMaster()) { if (sdbIsMaster()) {
mTrace("it is a master mnode, it could not be stopped"); mDebug("it is a master mnode, it could not be stopped");
return; return;
} }
mnodeCleanupSystem(); mnodeCleanupSystem();
if (remove(tsMnodeDir) != 0) { if (remove(tsMnodeDir) != 0) {
mPrint("failed to remove mnode file, reason:%s", strerror(errno)); mInfo("failed to remove mnode file, reason:%s", strerror(errno));
} else { } else {
mPrint("mnode file is removed"); mInfo("mnode file is removed");
} }
} }
......
...@@ -81,7 +81,7 @@ static int32_t mnodeMnodeActionDelete(SSdbOper *pOper) { ...@@ -81,7 +81,7 @@ static int32_t mnodeMnodeActionDelete(SSdbOper *pOper) {
pDnode->isMgmt = false; pDnode->isMgmt = false;
mnodeDecDnodeRef(pDnode); mnodeDecDnodeRef(pDnode);
mTrace("mnode:%d, is dropped from sdb", pMnode->mnodeId); mDebug("mnode:%d, is dropped from sdb", pMnode->mnodeId);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -159,7 +159,7 @@ int32_t mnodeInitMnodes() { ...@@ -159,7 +159,7 @@ int32_t mnodeInitMnodes() {
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_MNODE, mnodeGetMnodeMeta); mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_MNODE, mnodeGetMnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_MNODE, mnodeRetrieveMnodes); mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_MNODE, mnodeRetrieveMnodes);
mTrace("table:mnodes table is created"); mDebug("table:mnodes table is created");
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -204,7 +204,7 @@ char *mnodeGetMnodeRoleStr(int32_t role) { ...@@ -204,7 +204,7 @@ char *mnodeGetMnodeRoleStr(int32_t role) {
} }
void mnodeUpdateMnodeIpSet() { void mnodeUpdateMnodeIpSet() {
mPrint("update mnodes ipset, numOfIps:%d ", mnodeGetMnodesNum()); mInfo("update mnodes ipset, numOfIps:%d ", mnodeGetMnodesNum());
mnodeMnodeWrLock(); mnodeMnodeWrLock();
...@@ -223,11 +223,11 @@ void mnodeUpdateMnodeIpSet() { ...@@ -223,11 +223,11 @@ void mnodeUpdateMnodeIpSet() {
if (pDnode != NULL) { if (pDnode != NULL) {
strcpy(tsMnodeIpSetForShell.fqdn[index], pDnode->dnodeFqdn); strcpy(tsMnodeIpSetForShell.fqdn[index], pDnode->dnodeFqdn);
tsMnodeIpSetForShell.port[index] = htons(pDnode->dnodePort); tsMnodeIpSetForShell.port[index] = htons(pDnode->dnodePort);
mTrace("mnode:%d, for shell fqdn:%s %d", pDnode->dnodeId, tsMnodeIpSetForShell.fqdn[index], htons(tsMnodeIpSetForShell.port[index])); mDebug("mnode:%d, for shell fqdn:%s %d", pDnode->dnodeId, tsMnodeIpSetForShell.fqdn[index], htons(tsMnodeIpSetForShell.port[index]));
strcpy(tsMnodeIpSetForPeer.fqdn[index], pDnode->dnodeFqdn); strcpy(tsMnodeIpSetForPeer.fqdn[index], pDnode->dnodeFqdn);
tsMnodeIpSetForPeer.port[index] = htons(pDnode->dnodePort + TSDB_PORT_DNODEDNODE); tsMnodeIpSetForPeer.port[index] = htons(pDnode->dnodePort + TSDB_PORT_DNODEDNODE);
mTrace("mnode:%d, for peer fqdn:%s %d", pDnode->dnodeId, tsMnodeIpSetForPeer.fqdn[index], htons(tsMnodeIpSetForPeer.port[index])); mDebug("mnode:%d, for peer fqdn:%s %d", pDnode->dnodeId, tsMnodeIpSetForPeer.fqdn[index], htons(tsMnodeIpSetForPeer.port[index]));
tsMnodeInfos.nodeInfos[index].nodeId = htonl(pMnode->mnodeId); tsMnodeInfos.nodeInfos[index].nodeId = htonl(pMnode->mnodeId);
strcpy(tsMnodeInfos.nodeInfos[index].nodeEp, pDnode->dnodeEp); strcpy(tsMnodeInfos.nodeInfos[index].nodeEp, pDnode->dnodeEp);
...@@ -238,7 +238,7 @@ void mnodeUpdateMnodeIpSet() { ...@@ -238,7 +238,7 @@ void mnodeUpdateMnodeIpSet() {
tsMnodeInfos.inUse = index; tsMnodeInfos.inUse = index;
} }
mPrint("mnode:%d, ep:%s %s", pDnode->dnodeId, pDnode->dnodeEp, pMnode->role == TAOS_SYNC_ROLE_MASTER ? "master" : ""); mInfo("mnode:%d, ep:%s %s", pDnode->dnodeId, pDnode->dnodeEp, pMnode->role == TAOS_SYNC_ROLE_MASTER ? "master" : "");
index++; index++;
} }
......
...@@ -58,9 +58,9 @@ int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg) { ...@@ -58,9 +58,9 @@ int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg) {
rpcRsp->rsp = ipSet; rpcRsp->rsp = ipSet;
rpcRsp->len = sizeof(SRpcIpSet); rpcRsp->len = sizeof(SRpcIpSet);
mTrace("%p, msg:%s in mpeer queue, will be redireced inUse:%d", pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], ipSet->inUse); mDebug("%p, msg:%s in mpeer queue, will be redireced inUse:%d", pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], ipSet->inUse);
for (int32_t i = 0; i < ipSet->numOfIps; ++i) { for (int32_t i = 0; i < ipSet->numOfIps; ++i) {
mTrace("mnode index:%d ip:%s:%d", i, ipSet->fqdn[i], htons(ipSet->port[i])); mDebug("mnode index:%d ip:%s:%d", i, ipSet->fqdn[i], htons(ipSet->port[i]));
} }
return TSDB_CODE_RPC_REDIRECT; return TSDB_CODE_RPC_REDIRECT;
......
...@@ -74,7 +74,7 @@ int32_t mnodeInitProfile() { ...@@ -74,7 +74,7 @@ int32_t mnodeInitProfile() {
void mnodeCleanupProfile() { void mnodeCleanupProfile() {
if (tsMnodeConnCache != NULL) { if (tsMnodeConnCache != NULL) {
mPrint("conn cache is cleanup"); mInfo("conn cache is cleanup");
taosCacheCleanup(tsMnodeConnCache); taosCacheCleanup(tsMnodeConnCache);
tsMnodeConnCache = NULL; tsMnodeConnCache = NULL;
} }
...@@ -104,7 +104,7 @@ SConnObj *mnodeCreateConn(char *user, uint32_t ip, uint16_t port) { ...@@ -104,7 +104,7 @@ SConnObj *mnodeCreateConn(char *user, uint32_t ip, uint16_t port) {
sprintf(key, "%u", connId); sprintf(key, "%u", connId);
SConnObj *pConn = taosCachePut(tsMnodeConnCache, key, &connObj, sizeof(connObj), CONN_KEEP_TIME); SConnObj *pConn = taosCachePut(tsMnodeConnCache, key, &connObj, sizeof(connObj), CONN_KEEP_TIME);
mTrace("connId:%d, is created, user:%s ip:%s:%u", connId, user, taosIpStr(ip), port); mDebug("connId:%d, is created, user:%s ip:%s:%u", connId, user, taosIpStr(ip), port);
return pConn; return pConn;
} }
...@@ -131,7 +131,7 @@ SConnObj *mnodeAccquireConn(uint32_t connId, char *user, uint32_t ip, uint16_t p ...@@ -131,7 +131,7 @@ SConnObj *mnodeAccquireConn(uint32_t connId, char *user, uint32_t ip, uint16_t p
return NULL; return NULL;
} }
// mTrace("connId:%d, is incoming, user:%s ip:%s:%u", connId, pConn->user, taosIpStr(pConn->ip), pConn->port); // mDebug("connId:%d, is incoming, user:%s ip:%s:%u", connId, pConn->user, taosIpStr(pConn->ip), pConn->port);
pConn->lastAccess = expireTime; pConn->lastAccess = expireTime;
return pConn; return pConn;
} }
...@@ -141,7 +141,7 @@ static void mnodeFreeConn(void *data) { ...@@ -141,7 +141,7 @@ static void mnodeFreeConn(void *data) {
tfree(pConn->pQueries); tfree(pConn->pQueries);
tfree(pConn->pStreams); tfree(pConn->pStreams);
mTrace("connId:%d, is destroyed", pConn->connId); mDebug("connId:%d, is destroyed", pConn->connId);
} }
static void *mnodeGetNextConn(SHashMutableIterator *pIter, SConnObj **pConn) { static void *mnodeGetNextConn(SHashMutableIterator *pIter, SConnObj **pConn) {
...@@ -534,14 +534,14 @@ static int32_t mnodeProcessKillQueryMsg(SMnodeMsg *pMsg) { ...@@ -534,14 +534,14 @@ static int32_t mnodeProcessKillQueryMsg(SMnodeMsg *pMsg) {
if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS; if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS;
SCMKillQueryMsg *pKill = pMsg->rpcMsg.pCont; SCMKillQueryMsg *pKill = pMsg->rpcMsg.pCont;
mPrint("kill query msg is received, queryId:%s", pKill->queryId); mInfo("kill query msg is received, queryId:%s", pKill->queryId);
const char delim = ':'; const char delim = ':';
char* connIdStr = strtok(pKill->queryId, &delim); char* connIdStr = strtok(pKill->queryId, &delim);
char* queryIdStr = strtok(NULL, &delim); char* queryIdStr = strtok(NULL, &delim);
if (queryIdStr == NULL || connIdStr == NULL) { if (queryIdStr == NULL || connIdStr == NULL) {
mPrint("failed to kill query, queryId:%s", pKill->queryId); mInfo("failed to kill query, queryId:%s", pKill->queryId);
return TSDB_CODE_MND_INVALID_QUERY_ID; return TSDB_CODE_MND_INVALID_QUERY_ID;
} }
...@@ -552,7 +552,7 @@ static int32_t mnodeProcessKillQueryMsg(SMnodeMsg *pMsg) { ...@@ -552,7 +552,7 @@ static int32_t mnodeProcessKillQueryMsg(SMnodeMsg *pMsg) {
mError("connId:%s, failed to kill queryId:%d, conn not exist", connIdStr, queryId); mError("connId:%s, failed to kill queryId:%d, conn not exist", connIdStr, queryId);
return TSDB_CODE_MND_INVALID_CONN_ID; return TSDB_CODE_MND_INVALID_CONN_ID;
} else { } else {
mPrint("connId:%s, queryId:%d is killed by user:%s", connIdStr, queryId, pUser->user); mInfo("connId:%s, queryId:%d is killed by user:%s", connIdStr, queryId, pUser->user);
pConn->queryId = queryId; pConn->queryId = queryId;
taosCacheRelease(tsMnodeConnCache, (void **)&pConn, false); taosCacheRelease(tsMnodeConnCache, (void **)&pConn, false);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -564,14 +564,14 @@ static int32_t mnodeProcessKillStreamMsg(SMnodeMsg *pMsg) { ...@@ -564,14 +564,14 @@ static int32_t mnodeProcessKillStreamMsg(SMnodeMsg *pMsg) {
if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS; if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS;
SCMKillQueryMsg *pKill = pMsg->rpcMsg.pCont; SCMKillQueryMsg *pKill = pMsg->rpcMsg.pCont;
mPrint("kill stream msg is received, streamId:%s", pKill->queryId); mInfo("kill stream msg is received, streamId:%s", pKill->queryId);
const char delim = ':'; const char delim = ':';
char* connIdStr = strtok(pKill->queryId, &delim); char* connIdStr = strtok(pKill->queryId, &delim);
char* streamIdStr = strtok(NULL, &delim); char* streamIdStr = strtok(NULL, &delim);
if (streamIdStr == NULL || connIdStr == NULL) { if (streamIdStr == NULL || connIdStr == NULL) {
mPrint("failed to kill stream, streamId:%s", pKill->queryId); mInfo("failed to kill stream, streamId:%s", pKill->queryId);
return TSDB_CODE_MND_INVALID_STREAM_ID; return TSDB_CODE_MND_INVALID_STREAM_ID;
} }
...@@ -582,7 +582,7 @@ static int32_t mnodeProcessKillStreamMsg(SMnodeMsg *pMsg) { ...@@ -582,7 +582,7 @@ static int32_t mnodeProcessKillStreamMsg(SMnodeMsg *pMsg) {
mError("connId:%s, failed to kill streamId:%d, conn not exist", connIdStr, streamId); mError("connId:%s, failed to kill streamId:%d, conn not exist", connIdStr, streamId);
return TSDB_CODE_MND_INVALID_CONN_ID; return TSDB_CODE_MND_INVALID_CONN_ID;
} else { } else {
mPrint("connId:%s, streamId:%d is killed by user:%s", connIdStr, streamId, pUser->user); mInfo("connId:%s, streamId:%d is killed by user:%s", connIdStr, streamId, pUser->user);
pConn->streamId = streamId; pConn->streamId = streamId;
taosCacheRelease(tsMnodeConnCache, (void **)&pConn, false); taosCacheRelease(tsMnodeConnCache, (void **)&pConn, false);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -599,7 +599,7 @@ static int32_t mnodeProcessKillConnectionMsg(SMnodeMsg *pMsg) { ...@@ -599,7 +599,7 @@ static int32_t mnodeProcessKillConnectionMsg(SMnodeMsg *pMsg) {
mError("connId:%s, failed to kill, conn not exist", pKill->queryId); mError("connId:%s, failed to kill, conn not exist", pKill->queryId);
return TSDB_CODE_MND_INVALID_CONN_ID; return TSDB_CODE_MND_INVALID_CONN_ID;
} else { } else {
mPrint("connId:%s, is killed by user:%s", pKill->queryId, pUser->user); mInfo("connId:%s, is killed by user:%s", pKill->queryId, pUser->user);
pConn->killed = 1; pConn->killed = 1;
taosCacheRelease(tsMnodeConnCache, (void**)&pConn, false); taosCacheRelease(tsMnodeConnCache, (void**)&pConn, false);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
......
...@@ -54,9 +54,9 @@ int32_t mnodeProcessRead(SMnodeMsg *pMsg) { ...@@ -54,9 +54,9 @@ int32_t mnodeProcessRead(SMnodeMsg *pMsg) {
rpcRsp->rsp = ipSet; rpcRsp->rsp = ipSet;
rpcRsp->len = sizeof(SRpcIpSet); rpcRsp->len = sizeof(SRpcIpSet);
mTrace("%p, msg:%s in mread queue, will be redireced, inUse:%d", pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], ipSet->inUse); mDebug("%p, msg:%s in mread queue, will be redireced, inUse:%d", pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], ipSet->inUse);
for (int32_t i = 0; i < ipSet->numOfIps; ++i) { for (int32_t i = 0; i < ipSet->numOfIps; ++i) {
mTrace("mnode index:%d ip:%s:%d", i, ipSet->fqdn[i], htons(ipSet->port[i])); mDebug("mnode index:%d ip:%s:%d", i, ipSet->fqdn[i], htons(ipSet->port[i]));
} }
return TSDB_CODE_RPC_REDIRECT; return TSDB_CODE_RPC_REDIRECT;
......
...@@ -181,7 +181,7 @@ static int32_t sdbInitWal() { ...@@ -181,7 +181,7 @@ static int32_t sdbInitWal() {
return -1; return -1;
} }
sdbTrace("open sdb wal for restore"); sdbDebug("open sdb wal for restore");
walRestore(tsSdbObj.wal, NULL, sdbWrite); walRestore(tsSdbObj.wal, NULL, sdbWrite);
return 0; return 0;
} }
...@@ -198,10 +198,10 @@ static void sdbRestoreTables() { ...@@ -198,10 +198,10 @@ static void sdbRestoreTables() {
totalRows += pTable->numOfRows; totalRows += pTable->numOfRows;
numOfTables++; numOfTables++;
sdbTrace("table:%s, is restored, numOfRows:%" PRId64, pTable->tableName, pTable->numOfRows); sdbDebug("table:%s, is restored, numOfRows:%" PRId64, pTable->tableName, pTable->numOfRows);
} }
sdbTrace("sdb is restored, version:%" PRId64 " totalRows:%d numOfTables:%d", tsSdbObj.version, totalRows, numOfTables); sdbDebug("sdb is restored, version:%" PRId64 " totalRows:%d numOfTables:%d", tsSdbObj.version, totalRows, numOfTables);
} }
void sdbUpdateMnodeRoles() { void sdbUpdateMnodeRoles() {
...@@ -210,12 +210,12 @@ void sdbUpdateMnodeRoles() { ...@@ -210,12 +210,12 @@ void sdbUpdateMnodeRoles() {
SNodesRole roles = {0}; SNodesRole roles = {0};
syncGetNodesRole(tsSdbObj.sync, &roles); syncGetNodesRole(tsSdbObj.sync, &roles);
sdbPrint("update mnodes sync roles, total:%d", tsSdbObj.cfg.replica); sdbInfo("update mnodes sync roles, total:%d", tsSdbObj.cfg.replica);
for (int32_t i = 0; i < tsSdbObj.cfg.replica; ++i) { for (int32_t i = 0; i < tsSdbObj.cfg.replica; ++i) {
SMnodeObj *pMnode = mnodeGetMnode(roles.nodeId[i]); SMnodeObj *pMnode = mnodeGetMnode(roles.nodeId[i]);
if (pMnode != NULL) { if (pMnode != NULL) {
pMnode->role = roles.role[i]; pMnode->role = roles.role[i];
sdbPrint("mnode:%d, role:%s", pMnode->mnodeId, mnodeGetMnodeRoleStr(pMnode->role)); sdbInfo("mnode:%d, role:%s", pMnode->mnodeId, mnodeGetMnodeRoleStr(pMnode->role));
if (pMnode->mnodeId == dnodeGetDnodeId()) tsSdbObj.role = pMnode->role; if (pMnode->mnodeId == dnodeGetDnodeId()) tsSdbObj.role = pMnode->role;
mnodeDecMnodeRef(pMnode); mnodeDecMnodeRef(pMnode);
} }
...@@ -234,7 +234,7 @@ static int sdbGetWalInfo(void *ahandle, char *name, uint32_t *index) { ...@@ -234,7 +234,7 @@ static int sdbGetWalInfo(void *ahandle, char *name, uint32_t *index) {
} }
static void sdbNotifyRole(void *ahandle, int8_t role) { static void sdbNotifyRole(void *ahandle, int8_t role) {
sdbPrint("mnode role changed from %s to %s", mnodeGetMnodeRoleStr(tsSdbObj.role), mnodeGetMnodeRoleStr(role)); sdbInfo("mnode role changed from %s to %s", mnodeGetMnodeRoleStr(tsSdbObj.role), mnodeGetMnodeRoleStr(role));
if (role == TAOS_SYNC_ROLE_MASTER && tsSdbObj.role != TAOS_SYNC_ROLE_MASTER) { if (role == TAOS_SYNC_ROLE_MASTER && tsSdbObj.role != TAOS_SYNC_ROLE_MASTER) {
balanceReset(); balanceReset();
...@@ -247,7 +247,7 @@ static void sdbNotifyRole(void *ahandle, int8_t role) { ...@@ -247,7 +247,7 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
static void sdbConfirmForward(void *ahandle, void *param, int32_t code) { static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
tsSdbObj.code = code; tsSdbObj.code = code;
sem_post(&tsSdbObj.sem); sem_post(&tsSdbObj.sem);
sdbTrace("forward request confirmed, version:%" PRIu64 ", result:%s", (int64_t)param, tstrerror(code)); sdbDebug("forward request confirmed, version:%" PRIu64 ", result:%s", (int64_t)param, tstrerror(code));
} }
static int32_t sdbForwardToPeer(SWalHead *pHead) { static int32_t sdbForwardToPeer(SWalHead *pHead) {
...@@ -255,7 +255,7 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) { ...@@ -255,7 +255,7 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
int32_t code = syncForwardToPeer(tsSdbObj.sync, pHead, (void*)pHead->version, TAOS_QTYPE_RPC); int32_t code = syncForwardToPeer(tsSdbObj.sync, pHead, (void*)pHead->version, TAOS_QTYPE_RPC);
if (code > 0) { if (code > 0) {
sdbTrace("forward request is sent, version:%" PRIu64 ", code:%d", pHead->version, code); sdbDebug("forward request is sent, version:%" PRIu64 ", code:%d", pHead->version, code);
sem_wait(&tsSdbObj.sem); sem_wait(&tsSdbObj.sem);
return tsSdbObj.code; return tsSdbObj.code;
} }
...@@ -311,9 +311,9 @@ void sdbUpdateSync() { ...@@ -311,9 +311,9 @@ void sdbUpdateSync() {
if (!hasThisDnode) return; if (!hasThisDnode) return;
if (memcmp(&syncCfg, &tsSdbObj.cfg, sizeof(SSyncCfg)) == 0) return; if (memcmp(&syncCfg, &tsSdbObj.cfg, sizeof(SSyncCfg)) == 0) return;
sdbPrint("work as mnode, replica:%d", syncCfg.replica); sdbInfo("work as mnode, replica:%d", syncCfg.replica);
for (int32_t i = 0; i < syncCfg.replica; ++i) { for (int32_t i = 0; i < syncCfg.replica; ++i) {
sdbPrint("mnode:%d, %s:%d", syncCfg.nodeInfo[i].nodeId, syncCfg.nodeInfo[i].nodeFqdn, syncCfg.nodeInfo[i].nodePort); sdbInfo("mnode:%d, %s:%d", syncCfg.nodeInfo[i].nodeId, syncCfg.nodeInfo[i].nodeFqdn, syncCfg.nodeInfo[i].nodePort);
} }
SSyncInfo syncInfo = {0}; SSyncInfo syncInfo = {0};
...@@ -389,7 +389,7 @@ void sdbIncRef(void *handle, void *pObj) { ...@@ -389,7 +389,7 @@ void sdbIncRef(void *handle, void *pObj) {
int32_t * pRefCount = (int32_t *)(pObj + pTable->refCountPos); int32_t * pRefCount = (int32_t *)(pObj + pTable->refCountPos);
atomic_add_fetch_32(pRefCount, 1); atomic_add_fetch_32(pRefCount, 1);
if (0 && (pTable->tableId == SDB_TABLE_CTABLE || pTable->tableId == SDB_TABLE_DB)) { if (0 && (pTable->tableId == SDB_TABLE_CTABLE || pTable->tableId == SDB_TABLE_DB)) {
sdbTrace("add ref to table:%s record:%p:%s:%d", pTable->tableName, pObj, sdbGetKeyStrFromObj(pTable, pObj), *pRefCount); sdbDebug("add ref to table:%s record:%p:%s:%d", pTable->tableName, pObj, sdbGetKeyStrFromObj(pTable, pObj), *pRefCount);
} }
} }
...@@ -400,12 +400,12 @@ void sdbDecRef(void *handle, void *pObj) { ...@@ -400,12 +400,12 @@ void sdbDecRef(void *handle, void *pObj) {
int32_t * pRefCount = (int32_t *)(pObj + pTable->refCountPos); int32_t * pRefCount = (int32_t *)(pObj + pTable->refCountPos);
int32_t refCount = atomic_sub_fetch_32(pRefCount, 1); int32_t refCount = atomic_sub_fetch_32(pRefCount, 1);
if (0 && (pTable->tableId == SDB_TABLE_CTABLE || pTable->tableId == SDB_TABLE_DB)) { if (0 && (pTable->tableId == SDB_TABLE_CTABLE || pTable->tableId == SDB_TABLE_DB)) {
sdbTrace("def ref of table:%s record:%p:%s:%d", pTable->tableName, pObj, sdbGetKeyStrFromObj(pTable, pObj), *pRefCount); sdbDebug("def ref of table:%s record:%p:%s:%d", pTable->tableName, pObj, sdbGetKeyStrFromObj(pTable, pObj), *pRefCount);
} }
int8_t *updateEnd = pObj + pTable->refCountPos - 1; int8_t *updateEnd = pObj + pTable->refCountPos - 1;
if (refCount <= 0 && *updateEnd) { if (refCount <= 0 && *updateEnd) {
sdbTrace("table:%s, record:%p:%s:%d is destroyed", pTable->tableName, pObj, sdbGetKeyStrFromObj(pTable, pObj), *pRefCount); sdbDebug("table:%s, record:%p:%s:%d is destroyed", pTable->tableName, pObj, sdbGetKeyStrFromObj(pTable, pObj), *pRefCount);
SSdbOper oper = {.pObj = pObj}; SSdbOper oper = {.pObj = pObj};
(*pTable->destroyFp)(&oper); (*pTable->destroyFp)(&oper);
} }
...@@ -469,7 +469,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) { ...@@ -469,7 +469,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
atomic_add_fetch_32(&pTable->autoIndex, 1); atomic_add_fetch_32(&pTable->autoIndex, 1);
} }
sdbTrace("table:%s, insert record:%s to hash, rowSize:%d numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName, sdbDebug("table:%s, insert record:%s to hash, rowSize:%d numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName,
sdbGetKeyStrFromObj(pTable, pOper->pObj), pOper->rowSize, pTable->numOfRows, sdbGetVersion()); sdbGetKeyStrFromObj(pTable, pOper->pObj), pOper->rowSize, pTable->numOfRows, sdbGetVersion());
(*pTable->insertFp)(pOper); (*pTable->insertFp)(pOper);
...@@ -488,7 +488,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) { ...@@ -488,7 +488,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) {
taosHashRemove(pTable->iHandle, key, keySize); taosHashRemove(pTable->iHandle, key, keySize);
atomic_sub_fetch_32(&pTable->numOfRows, 1); atomic_sub_fetch_32(&pTable->numOfRows, 1);
sdbTrace("table:%s, delete record:%s from hash, numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName, sdbDebug("table:%s, delete record:%s from hash, numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName,
sdbGetKeyStrFromObj(pTable, pOper->pObj), pTable->numOfRows, sdbGetVersion()); sdbGetKeyStrFromObj(pTable, pOper->pObj), pTable->numOfRows, sdbGetVersion());
int8_t *updateEnd = pOper->pObj + pTable->refCountPos - 1; int8_t *updateEnd = pOper->pObj + pTable->refCountPos - 1;
...@@ -499,7 +499,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) { ...@@ -499,7 +499,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) {
} }
static int32_t sdbUpdateHash(SSdbTable *pTable, SSdbOper *pOper) { static int32_t sdbUpdateHash(SSdbTable *pTable, SSdbOper *pOper) {
sdbTrace("table:%s, update record:%s in hash, numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName, sdbDebug("table:%s, update record:%s in hash, numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName,
sdbGetKeyStrFromObj(pTable, pOper->pObj), pTable->numOfRows, sdbGetVersion()); sdbGetKeyStrFromObj(pTable, pOper->pObj), pTable->numOfRows, sdbGetVersion());
(*pTable->updateFp)(pOper); (*pTable->updateFp)(pOper);
...@@ -525,7 +525,7 @@ static int sdbWrite(void *param, void *data, int type) { ...@@ -525,7 +525,7 @@ static int sdbWrite(void *param, void *data, int type) {
if (pHead->version <= tsSdbObj.version) { if (pHead->version <= tsSdbObj.version) {
pthread_mutex_unlock(&tsSdbObj.mutex); pthread_mutex_unlock(&tsSdbObj.mutex);
if (type == TAOS_QTYPE_FWD && tsSdbObj.sync != NULL) { if (type == TAOS_QTYPE_FWD && tsSdbObj.sync != NULL) {
sdbTrace("forward request is received, version:%" PRIu64 " confirm it", pHead->version); sdbDebug("forward request is received, version:%" PRIu64 " confirm it", pHead->version);
syncConfirmForward(tsSdbObj.sync, pHead->version, TSDB_CODE_SUCCESS); syncConfirmForward(tsSdbObj.sync, pHead->version, TSDB_CODE_SUCCESS);
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -551,7 +551,7 @@ static int sdbWrite(void *param, void *data, int type) { ...@@ -551,7 +551,7 @@ static int sdbWrite(void *param, void *data, int type) {
// from app, oper is created // from app, oper is created
if (pOper != NULL) { if (pOper != NULL) {
sdbTrace("record from app is disposed, table:%s action:%s record:%s version:%" PRIu64 " result:%s", sdbDebug("record from app is disposed, table:%s action:%s record:%s version:%" PRIu64 " result:%s",
pTable->tableName, sdbGetActionStr(action), sdbGetKeyStr(pTable, pHead->cont), pHead->version, pTable->tableName, sdbGetActionStr(action), sdbGetKeyStr(pTable, pHead->cont), pHead->version,
tstrerror(code)); tstrerror(code));
return code; return code;
...@@ -559,11 +559,11 @@ static int sdbWrite(void *param, void *data, int type) { ...@@ -559,11 +559,11 @@ static int sdbWrite(void *param, void *data, int type) {
// from wal or forward msg, oper not created, should add into hash // from wal or forward msg, oper not created, should add into hash
if (tsSdbObj.sync != NULL) { if (tsSdbObj.sync != NULL) {
sdbTrace("record from wal forward is disposed, table:%s action:%s record:%s version:%" PRIu64 " confirm it", sdbDebug("record from wal forward is disposed, table:%s action:%s record:%s version:%" PRIu64 " confirm it",
pTable->tableName, sdbGetActionStr(action), sdbGetKeyStr(pTable, pHead->cont), pHead->version); pTable->tableName, sdbGetActionStr(action), sdbGetKeyStr(pTable, pHead->cont), pHead->version);
syncConfirmForward(tsSdbObj.sync, pHead->version, code); syncConfirmForward(tsSdbObj.sync, pHead->version, code);
} else { } else {
sdbTrace("record from wal restore is disposed, table:%s action:%s record:%s version:%" PRIu64, pTable->tableName, sdbDebug("record from wal restore is disposed, table:%s action:%s record:%s version:%" PRIu64, pTable->tableName,
sdbGetActionStr(action), sdbGetKeyStr(pTable, pHead->cont), pHead->version); sdbGetActionStr(action), sdbGetKeyStr(pTable, pHead->cont), pHead->version);
} }
...@@ -630,7 +630,7 @@ int32_t sdbInsertRow(SSdbOper *pOper) { ...@@ -630,7 +630,7 @@ int32_t sdbInsertRow(SSdbOper *pOper) {
memcpy(pNewOper, pOper, sizeof(SSdbOper)); memcpy(pNewOper, pOper, sizeof(SSdbOper));
if (pNewOper->pMsg != NULL) { if (pNewOper->pMsg != NULL) {
sdbTrace("app:%p:%p, table:%s record:%p:%s, insert action is add to sdb queue, ", pNewOper->pMsg->rpcMsg.ahandle, sdbDebug("app:%p:%p, table:%s record:%p:%s, insert action is add to sdb queue, ", pNewOper->pMsg->rpcMsg.ahandle,
pNewOper->pMsg, pTable->tableName, pOper->pObj, sdbGetKeyStrFromObj(pTable, pOper->pObj)); pNewOper->pMsg, pTable->tableName, pOper->pObj, sdbGetKeyStrFromObj(pTable, pOper->pObj));
} }
...@@ -645,7 +645,7 @@ int32_t sdbDeleteRow(SSdbOper *pOper) { ...@@ -645,7 +645,7 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
SSdbRow *pMeta = sdbGetRowMetaFromObj(pTable, pOper->pObj); SSdbRow *pMeta = sdbGetRowMetaFromObj(pTable, pOper->pObj);
if (pMeta == NULL) { if (pMeta == NULL) {
sdbTrace("table:%s, record is not there, delete failed", pTable->tableName); sdbDebug("table:%s, record is not there, delete failed", pTable->tableName);
return TSDB_CODE_MND_SDB_OBJ_NOT_THERE; return TSDB_CODE_MND_SDB_OBJ_NOT_THERE;
} }
...@@ -680,7 +680,7 @@ int32_t sdbDeleteRow(SSdbOper *pOper) { ...@@ -680,7 +680,7 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
memcpy(pNewOper, pOper, sizeof(SSdbOper)); memcpy(pNewOper, pOper, sizeof(SSdbOper));
if (pNewOper->pMsg != NULL) { if (pNewOper->pMsg != NULL) {
sdbTrace("app:%p:%p, table:%s record:%p:%s, delete action is add to sdb queue, ", pNewOper->pMsg->rpcMsg.ahandle, sdbDebug("app:%p:%p, table:%s record:%p:%s, delete action is add to sdb queue, ", pNewOper->pMsg->rpcMsg.ahandle,
pNewOper->pMsg, pTable->tableName, pOper->pObj, sdbGetKeyStrFromObj(pTable, pOper->pObj)); pNewOper->pMsg, pTable->tableName, pOper->pObj, sdbGetKeyStrFromObj(pTable, pOper->pObj));
} }
...@@ -695,7 +695,7 @@ int32_t sdbUpdateRow(SSdbOper *pOper) { ...@@ -695,7 +695,7 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
SSdbRow *pMeta = sdbGetRowMetaFromObj(pTable, pOper->pObj); SSdbRow *pMeta = sdbGetRowMetaFromObj(pTable, pOper->pObj);
if (pMeta == NULL) { if (pMeta == NULL) {
sdbTrace("table:%s, record is not there, update failed", pTable->tableName); sdbDebug("table:%s, record is not there, update failed", pTable->tableName);
return TSDB_CODE_MND_SDB_OBJ_NOT_THERE; return TSDB_CODE_MND_SDB_OBJ_NOT_THERE;
} }
...@@ -730,7 +730,7 @@ int32_t sdbUpdateRow(SSdbOper *pOper) { ...@@ -730,7 +730,7 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
memcpy(pNewOper, pOper, sizeof(SSdbOper)); memcpy(pNewOper, pOper, sizeof(SSdbOper));
if (pNewOper->pMsg != NULL) { if (pNewOper->pMsg != NULL) {
sdbTrace("app:%p:%p, table:%s record:%p:%s, update action is add to sdb queue, ", pNewOper->pMsg->rpcMsg.ahandle, sdbDebug("app:%p:%p, table:%s record:%p:%s, update action is add to sdb queue, ", pNewOper->pMsg->rpcMsg.ahandle,
pNewOper->pMsg, pTable->tableName, pOper->pObj, sdbGetKeyStrFromObj(pTable, pOper->pObj)); pNewOper->pMsg, pTable->tableName, pOper->pObj, sdbGetKeyStrFromObj(pTable, pOper->pObj));
} }
...@@ -825,7 +825,7 @@ void sdbCloseTable(void *handle) { ...@@ -825,7 +825,7 @@ void sdbCloseTable(void *handle) {
taosHashDestroyIter(pIter); taosHashDestroyIter(pIter);
taosHashCleanup(pTable->iHandle); taosHashCleanup(pTable->iHandle);
sdbTrace("table:%s, is closed, numOfTables:%d", pTable->tableName, tsSdbObj.numOfTables); sdbDebug("table:%s, is closed, numOfTables:%d", pTable->tableName, tsSdbObj.numOfTables);
free(pTable); free(pTable);
} }
...@@ -841,7 +841,7 @@ int32_t sdbInitWriteWorker() { ...@@ -841,7 +841,7 @@ int32_t sdbInitWriteWorker() {
sdbAllocWriteQueue(); sdbAllocWriteQueue();
mPrint("sdb write is opened"); mInfo("sdb write is opened");
return 0; return 0;
} }
...@@ -863,7 +863,7 @@ void sdbCleanupWriteWorker() { ...@@ -863,7 +863,7 @@ void sdbCleanupWriteWorker() {
sdbFreeWritequeue(); sdbFreeWritequeue();
tfree(tsSdbPool.writeWorker); tfree(tsSdbPool.writeWorker);
mPrint("sdb write is closed"); mInfo("sdb write is closed");
} }
int32_t sdbAllocWriteQueue() { int32_t sdbAllocWriteQueue() {
...@@ -901,10 +901,10 @@ int32_t sdbAllocWriteQueue() { ...@@ -901,10 +901,10 @@ int32_t sdbAllocWriteQueue() {
} }
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
mTrace("sdb write worker:%d is launched, total:%d", pWorker->workerId, tsSdbPool.num); mDebug("sdb write worker:%d is launched, total:%d", pWorker->workerId, tsSdbPool.num);
} }
mTrace("sdb write queue:%p is allocated", tsSdbWriteQueue); mDebug("sdb write queue:%p is allocated", tsSdbWriteQueue);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -938,7 +938,7 @@ static void *sdbWorkerFp(void *param) { ...@@ -938,7 +938,7 @@ static void *sdbWorkerFp(void *param) {
while (1) { while (1) {
numOfMsgs = taosReadAllQitemsFromQset(tsSdbWriteQset, tsSdbWriteQall, &unUsed); numOfMsgs = taosReadAllQitemsFromQset(tsSdbWriteQset, tsSdbWriteQall, &unUsed);
if (numOfMsgs == 0) { if (numOfMsgs == 0) {
sdbTrace("sdbWorkerFp: got no message from qset, exiting..."); sdbDebug("sdbWorkerFp: got no message from qset, exiting...");
break; break;
} }
...@@ -953,9 +953,9 @@ static void *sdbWorkerFp(void *param) { ...@@ -953,9 +953,9 @@ static void *sdbWorkerFp(void *param) {
} }
if (pOper != NULL && pOper->pMsg != NULL) { if (pOper != NULL && pOper->pMsg != NULL) {
sdbTrace("app:%p:%p, table:%s record:%p:%s version:%" PRIu64 ", will be processed in sdb queue", sdbDebug("app:%p:%p, table:%s record:%p:%s version:%" PRIu64 ", will be processed in sdb queue",
pOper->pMsg->rpcMsg.ahandle, pOper->pMsg, ((SSdbTable *)pOper->table)->tableName, pOper->pObj, pOper->pMsg->rpcMsg.ahandle, pOper->pMsg, ((SSdbTable *)pOper->table)->tableName, pOper->pObj,
sdbGetKeyStr(pOper->table, pOper->pObj), pHead->version); sdbGetKeyStr(pOper->table, pHead->cont), pHead->version);
} }
int32_t code = sdbWrite(pOper, pHead, type); int32_t code = sdbWrite(pOper, pHead, type);
...@@ -971,12 +971,12 @@ static void *sdbWorkerFp(void *param) { ...@@ -971,12 +971,12 @@ static void *sdbWorkerFp(void *param) {
if (type == TAOS_QTYPE_RPC) { if (type == TAOS_QTYPE_RPC) {
pOper = (SSdbOper *)item; pOper = (SSdbOper *)item;
if (pOper != NULL && pOper->cb != NULL) { if (pOper != NULL && pOper->cb != NULL) {
sdbTrace("app:%p:%p, will do callback func, index:%d", pOper->pMsg->rpcMsg.ahandle, pOper->pMsg, i); sdbDebug("app:%p:%p, will do callback func, index:%d", pOper->pMsg->rpcMsg.ahandle, pOper->pMsg, i);
pOper->retCode = (*pOper->cb)(pOper->pMsg, pOper->retCode); pOper->retCode = (*pOper->cb)(pOper->pMsg, pOper->retCode);
} }
if (pOper != NULL && pOper->pMsg != NULL) { if (pOper != NULL && pOper->pMsg != NULL) {
sdbTrace("app:%p:%p, msg is processed, result:%s", pOper->pMsg->rpcMsg.ahandle, pOper->pMsg, sdbDebug("app:%p:%p, msg is processed, result:%s", pOper->pMsg->rpcMsg.ahandle, pOper->pMsg,
tstrerror(pOper->retCode)); tstrerror(pOper->retCode));
} }
......
...@@ -71,7 +71,7 @@ int32_t mnodeInitShow() { ...@@ -71,7 +71,7 @@ int32_t mnodeInitShow() {
void mnodeCleanUpShow() { void mnodeCleanUpShow() {
if (tsMnodeShowCache != NULL) { if (tsMnodeShowCache != NULL) {
mPrint("show cache is cleanup"); mInfo("show cache is cleanup");
taosCacheCleanup(tsMnodeShowCache); taosCacheCleanup(tsMnodeShowCache);
tsMnodeShowCache = NULL; tsMnodeShowCache = NULL;
} }
...@@ -139,7 +139,7 @@ static int32_t mnodeProcessShowMsg(SMnodeMsg *pMsg) { ...@@ -139,7 +139,7 @@ static int32_t mnodeProcessShowMsg(SMnodeMsg *pMsg) {
pShowRsp->qhandle = htobe64((uint64_t) pShow); pShowRsp->qhandle = htobe64((uint64_t) pShow);
int32_t code = (*tsMnodeShowMetaFp[pShowMsg->type])(&pShowRsp->tableMeta, pShow, pMsg->rpcMsg.handle); int32_t code = (*tsMnodeShowMetaFp[pShowMsg->type])(&pShowRsp->tableMeta, pShow, pMsg->rpcMsg.handle);
mTrace("%p, show type:%s index:%d, get meta finished, numOfRows:%d cols:%d result:%s", pShow, mDebug("%p, show type:%s index:%d, get meta finished, numOfRows:%d cols:%d result:%s", pShow,
mnodeGetShowType(pShowMsg->type), pShow->index, pShow->numOfRows, pShow->numOfColumns, tstrerror(code)); mnodeGetShowType(pShowMsg->type), pShow->index, pShow->numOfRows, pShow->numOfColumns, tstrerror(code));
if (code == TSDB_CODE_SUCCESS) { if (code == TSDB_CODE_SUCCESS) {
...@@ -172,11 +172,11 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) { ...@@ -172,11 +172,11 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
return TSDB_CODE_MND_INVALID_SHOWOBJ; return TSDB_CODE_MND_INVALID_SHOWOBJ;
} }
mTrace("%p, show type:%s index:%d, start retrieve data, numOfReads:%d numOfRows:%d", pShow, mDebug("%p, show type:%s index:%d, start retrieve data, numOfReads:%d numOfRows:%d", pShow,
mnodeGetShowType(pShow->type), pShow->index, pShow->numOfReads, pShow->numOfRows); mnodeGetShowType(pShow->type), pShow->index, pShow->numOfReads, pShow->numOfRows);
if (mnodeCheckShowFinished(pShow)) { if (mnodeCheckShowFinished(pShow)) {
mTrace("%p, show is already read finished, numOfReads:%d numOfRows:%d", pShow, pShow->numOfReads, pShow->numOfRows); mDebug("%p, show is already read finished, numOfReads:%d numOfRows:%d", pShow, pShow->numOfReads, pShow->numOfRows);
pShow->numOfReads = pShow->numOfRows; pShow->numOfReads = pShow->numOfRows;
} }
...@@ -201,7 +201,7 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) { ...@@ -201,7 +201,7 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE)
rowsRead = (*tsMnodeShowRetrieveFp[pShow->type])(pShow, pRsp->data, rowsToRead, pMsg->rpcMsg.handle); rowsRead = (*tsMnodeShowRetrieveFp[pShow->type])(pShow, pRsp->data, rowsToRead, pMsg->rpcMsg.handle);
mTrace("%p, show type:%s index:%d, stop retrieve data, rowsRead:%d rowsToRead:%d", pShow, mDebug("%p, show type:%s index:%d, stop retrieve data, rowsRead:%d rowsToRead:%d", pShow,
mnodeGetShowType(pShow->type), pShow->index, rowsRead, rowsToRead); mnodeGetShowType(pShow->type), pShow->index, rowsRead, rowsToRead);
if (rowsRead < 0) { if (rowsRead < 0) {
...@@ -219,10 +219,10 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) { ...@@ -219,10 +219,10 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
if (rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) { if (rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) {
pRsp->completed = 1; pRsp->completed = 1;
mTrace("%p, retrieve completed", pShow); mDebug("%p, retrieve completed", pShow);
mnodeReleaseShowObj(pShow, true); mnodeReleaseShowObj(pShow, true);
} else { } else {
mTrace("%p, retrieve not completed yet", pShow); mDebug("%p, retrieve not completed yet", pShow);
mnodeReleaseShowObj(pShow, false); mnodeReleaseShowObj(pShow, false);
} }
...@@ -335,7 +335,7 @@ connect_over: ...@@ -335,7 +335,7 @@ connect_over:
rpcFreeCont(pConnectRsp); rpcFreeCont(pConnectRsp);
mLError("user:%s login from %s, result:%s", connInfo.user, taosIpStr(connInfo.clientIp), tstrerror(code)); mLError("user:%s login from %s, result:%s", connInfo.user, taosIpStr(connInfo.clientIp), tstrerror(code));
} else { } else {
mLPrint("user:%s login from %s, result:%s", connInfo.user, taosIpStr(connInfo.clientIp), tstrerror(code)); mLInfo("user:%s login from %s, result:%s", connInfo.user, taosIpStr(connInfo.clientIp), tstrerror(code));
pMsg->rpcRsp.rsp = pConnectRsp; pMsg->rpcRsp.rsp = pConnectRsp;
pMsg->rpcRsp.len = sizeof(SCMConnectRsp); pMsg->rpcRsp.len = sizeof(SCMConnectRsp);
} }
...@@ -368,7 +368,7 @@ static bool mnodeAccquireShowObj(SShowObj *pShow) { ...@@ -368,7 +368,7 @@ static bool mnodeAccquireShowObj(SShowObj *pShow) {
SShowObj *pSaved = taosCacheAcquireByName(tsMnodeShowCache, key); SShowObj *pSaved = taosCacheAcquireByName(tsMnodeShowCache, key);
if (pSaved == pShow) { if (pSaved == pShow) {
mTrace("%p, show is accquired from cache", pShow); mDebug("%p, show is accquired from cache", pShow);
return true; return true;
} else { } else {
return false; return false;
...@@ -384,7 +384,7 @@ static void *mnodePutShowObj(SShowObj *pShow, int32_t size) { ...@@ -384,7 +384,7 @@ static void *mnodePutShowObj(SShowObj *pShow, int32_t size) {
SShowObj *newQhandle = taosCachePut(tsMnodeShowCache, key, pShow, size, 6); SShowObj *newQhandle = taosCachePut(tsMnodeShowCache, key, pShow, size, 6);
free(pShow); free(pShow);
mTrace("%p, show is put into cache, index:%s", newQhandle, key); mDebug("%p, show is put into cache, index:%s", newQhandle, key);
return newQhandle; return newQhandle;
} }
...@@ -394,11 +394,11 @@ static void *mnodePutShowObj(SShowObj *pShow, int32_t size) { ...@@ -394,11 +394,11 @@ static void *mnodePutShowObj(SShowObj *pShow, int32_t size) {
static void mnodeFreeShowObj(void *data) { static void mnodeFreeShowObj(void *data) {
SShowObj *pShow = data; SShowObj *pShow = data;
sdbFreeIter(pShow->pIter); sdbFreeIter(pShow->pIter);
mTrace("%p, show is destroyed", pShow); mDebug("%p, show is destroyed", pShow);
} }
static void mnodeReleaseShowObj(void *pShow, bool forceRemove) { static void mnodeReleaseShowObj(void *pShow, bool forceRemove) {
mTrace("%p, show is released, force:%s", pShow, forceRemove ? "true" : "false"); mDebug("%p, show is released, force:%s", pShow, forceRemove ? "true" : "false");
taosCacheRelease(tsMnodeShowCache, &pShow, forceRemove); taosCacheRelease(tsMnodeShowCache, &pShow, forceRemove);
} }
......
此差异已折叠。
...@@ -104,7 +104,7 @@ static int32_t mnodeUserActionDecode(SSdbOper *pOper) { ...@@ -104,7 +104,7 @@ static int32_t mnodeUserActionDecode(SSdbOper *pOper) {
static int32_t mnodeUserActionRestored() { static int32_t mnodeUserActionRestored() {
int32_t numOfRows = sdbGetNumOfRows(tsUserSdb); int32_t numOfRows = sdbGetNumOfRows(tsUserSdb);
if (numOfRows <= 0 && dnodeIsFirstDeploy()) { if (numOfRows <= 0 && dnodeIsFirstDeploy()) {
mPrint("dnode first deploy, create root user"); mInfo("dnode first deploy, create root user");
SAcctObj *pAcct = mnodeGetAcct(TSDB_DEFAULT_USER); SAcctObj *pAcct = mnodeGetAcct(TSDB_DEFAULT_USER);
mnodeCreateUser(pAcct, TSDB_DEFAULT_USER, TSDB_DEFAULT_PASS, NULL); mnodeCreateUser(pAcct, TSDB_DEFAULT_USER, TSDB_DEFAULT_PASS, NULL);
mnodeCreateUser(pAcct, "monitor", tsInternalPass, NULL); mnodeCreateUser(pAcct, "monitor", tsInternalPass, NULL);
...@@ -148,7 +148,7 @@ int32_t mnodeInitUsers() { ...@@ -148,7 +148,7 @@ int32_t mnodeInitUsers() {
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_USER, mnodeRetrieveUsers); mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_USER, mnodeRetrieveUsers);
mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_AUTH, mnodeProcessAuthMsg); mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_AUTH, mnodeProcessAuthMsg);
mTrace("table:%s, hash is created", tableDesc.tableName); mDebug("table:%s, hash is created", tableDesc.tableName);
return 0; return 0;
} }
...@@ -182,7 +182,7 @@ static int32_t mnodeUpdateUser(SUserObj *pUser, void *pMsg) { ...@@ -182,7 +182,7 @@ static int32_t mnodeUpdateUser(SUserObj *pUser, void *pMsg) {
int32_t code = sdbUpdateRow(&oper); int32_t code = sdbUpdateRow(&oper);
if (code == TSDB_CODE_SUCCESS) { if (code == TSDB_CODE_SUCCESS) {
mLPrint("user:%s, is altered by %s", pUser->user, mnodeGetUserFromMsg(pMsg)); mLInfo("user:%s, is altered by %s", pUser->user, mnodeGetUserFromMsg(pMsg));
if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
...@@ -205,7 +205,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) { ...@@ -205,7 +205,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) {
SUserObj *pUser = mnodeGetUser(name); SUserObj *pUser = mnodeGetUser(name);
if (pUser != NULL) { if (pUser != NULL) {
mTrace("user:%s, is already there", name); mDebug("user:%s, is already there", name);
mnodeDecUserRef(pUser); mnodeDecUserRef(pUser);
return TSDB_CODE_MND_USER_ALREADY_EXIST; return TSDB_CODE_MND_USER_ALREADY_EXIST;
} }
...@@ -238,7 +238,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) { ...@@ -238,7 +238,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) {
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
tfree(pUser); tfree(pUser);
} else { } else {
mLPrint("user:%s, is created by %s", pUser->user, mnodeGetUserFromMsg(pMsg)); mLInfo("user:%s, is created by %s", pUser->user, mnodeGetUserFromMsg(pMsg));
if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
...@@ -255,7 +255,7 @@ static int32_t mnodeDropUser(SUserObj *pUser, void *pMsg) { ...@@ -255,7 +255,7 @@ static int32_t mnodeDropUser(SUserObj *pUser, void *pMsg) {
int32_t code = sdbDeleteRow(&oper); int32_t code = sdbDeleteRow(&oper);
if (code == TSDB_CODE_SUCCESS) { if (code == TSDB_CODE_SUCCESS) {
mLPrint("user:%s, is dropped by %s", pUser->user, mnodeGetUserFromMsg(pMsg)); mLInfo("user:%s, is dropped by %s", pUser->user, mnodeGetUserFromMsg(pMsg));
if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; if (pMsg != NULL) code = TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
...@@ -541,13 +541,13 @@ void mnodeDropAllUsers(SAcctObj *pAcct) { ...@@ -541,13 +541,13 @@ void mnodeDropAllUsers(SAcctObj *pAcct) {
sdbFreeIter(pIter); sdbFreeIter(pIter);
mTrace("acct:%s, all users:%d is dropped from sdb", pAcct->user, numOfUsers); mDebug("acct:%s, all users:%d is dropped from sdb", pAcct->user, numOfUsers);
} }
int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) { int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) {
if (!sdbIsMaster()) { if (!sdbIsMaster()) {
*secret = 0; *secret = 0;
mTrace("user:%s, failed to auth user, reason:%s", user, tstrerror(TSDB_CODE_RPC_NOT_READY)); mDebug("user:%s, failed to auth user, reason:%s", user, tstrerror(TSDB_CODE_RPC_NOT_READY));
return TSDB_CODE_RPC_NOT_READY; return TSDB_CODE_RPC_NOT_READY;
} }
...@@ -563,7 +563,7 @@ int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, cha ...@@ -563,7 +563,7 @@ int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, cha
memcpy(secret, pUser->pass, TSDB_KEY_LEN); memcpy(secret, pUser->pass, TSDB_KEY_LEN);
mnodeDecUserRef(pUser); mnodeDecUserRef(pUser);
mTrace("user:%s, auth info is returned", user); mDebug("user:%s, auth info is returned", user);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
} }
......
...@@ -129,7 +129,7 @@ static void mnodeVgroupUpdateIdPool(SVgObj *pVgroup) { ...@@ -129,7 +129,7 @@ static void mnodeVgroupUpdateIdPool(SVgObj *pVgroup) {
SDbObj *pDb = pVgroup->pDb; SDbObj *pDb = pVgroup->pDb;
if (pDb != NULL) { if (pDb != NULL) {
if (pDb->cfg.maxTables != oldTables) { if (pDb->cfg.maxTables != oldTables) {
mPrint("vgId:%d tables change from %d to %d", pVgroup->vgId, oldTables, pDb->cfg.maxTables); mInfo("vgId:%d tables change from %d to %d", pVgroup->vgId, oldTables, pDb->cfg.maxTables);
taosUpdateIdPool(pVgroup->idPool, pDb->cfg.maxTables); taosUpdateIdPool(pVgroup->idPool, pDb->cfg.maxTables);
int32_t size = sizeof(SChildTableObj *) * pDb->cfg.maxTables; int32_t size = sizeof(SChildTableObj *) * pDb->cfg.maxTables;
pVgroup->tableList = (SChildTableObj **)realloc(pVgroup->tableList, size); pVgroup->tableList = (SChildTableObj **)realloc(pVgroup->tableList, size);
...@@ -166,7 +166,7 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) { ...@@ -166,7 +166,7 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) {
mnodeDecVgroupRef(pVgroup); mnodeDecVgroupRef(pVgroup);
mTrace("vgId:%d, is updated, numOfVnode:%d", pVgroup->vgId, pVgroup->numOfVnodes); mDebug("vgId:%d, is updated, numOfVnode:%d", pVgroup->vgId, pVgroup->numOfVnodes);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -228,7 +228,7 @@ int32_t mnodeInitVgroups() { ...@@ -228,7 +228,7 @@ int32_t mnodeInitVgroups() {
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mnodeProcessDropVnodeRsp); mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mnodeProcessDropVnodeRsp);
mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mnodeProcessVnodeCfgMsg); mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mnodeProcessVnodeCfgMsg);
mTrace("table:vgroups is created"); mDebug("table:vgroups is created");
return 0; return 0;
} }
...@@ -342,9 +342,9 @@ static int32_t mnodeCreateVgroupCb(SMnodeMsg *pMsg, int32_t code) { ...@@ -342,9 +342,9 @@ static int32_t mnodeCreateVgroupCb(SMnodeMsg *pMsg, int32_t code) {
SVgObj *pVgroup = pMsg->pVgroup; SVgObj *pVgroup = pMsg->pVgroup;
SDbObj *pDb = pMsg->pDb; SDbObj *pDb = pMsg->pDb;
mPrint("vgId:%d, is created in mnode, db:%s replica:%d", pVgroup->vgId, pDb->name, pVgroup->numOfVnodes); mInfo("vgId:%d, is created in mnode, db:%s replica:%d", pVgroup->vgId, pDb->name, pVgroup->numOfVnodes);
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
mPrint("vgId:%d, index:%d, dnode:%d", pVgroup->vgId, i, pVgroup->vnodeGid[i].dnodeId); mInfo("vgId:%d, index:%d, dnode:%d", pVgroup->vgId, i, pVgroup->vnodeGid[i].dnodeId);
} }
mnodeIncVgroupRef(pVgroup); mnodeIncVgroupRef(pVgroup);
...@@ -394,7 +394,7 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle) { ...@@ -394,7 +394,7 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle) {
if (ahandle != NULL) { if (ahandle != NULL) {
mnodeSendDropVgroupMsg(pVgroup, ahandle); mnodeSendDropVgroupMsg(pVgroup, ahandle);
} else { } else {
mTrace("vgId:%d, replica:%d is deleting from sdb", pVgroup->vgId, pVgroup->numOfVnodes); mDebug("vgId:%d, replica:%d is deleting from sdb", pVgroup->vgId, pVgroup->numOfVnodes);
mnodeSendDropVgroupMsg(pVgroup, NULL); mnodeSendDropVgroupMsg(pVgroup, NULL);
SSdbOper oper = { SSdbOper oper = {
.type = SDB_OPER_GLOBAL, .type = SDB_OPER_GLOBAL,
...@@ -662,11 +662,11 @@ void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) { ...@@ -662,11 +662,11 @@ void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) {
} }
void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) { void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) {
mTrace("vgId:%d, send create all vnodes msg, numOfVnodes:%d db:%s", pVgroup->vgId, pVgroup->numOfVnodes, mDebug("vgId:%d, send create all vnodes msg, numOfVnodes:%d db:%s", pVgroup->vgId, pVgroup->numOfVnodes,
pVgroup->dbName); pVgroup->dbName);
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp); SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
mTrace("vgId:%d, index:%d, send create vnode msg to dnode %s, ahandle:%p", pVgroup->vgId, mDebug("vgId:%d, index:%d, send create vnode msg to dnode %s, ahandle:%p", pVgroup->vgId,
i, pVgroup->vnodeGid[i].pDnode->dnodeEp, ahandle); i, pVgroup->vnodeGid[i].pDnode->dnodeEp, ahandle);
mnodeSendCreateVnodeMsg(pVgroup, &ipSet, ahandle); mnodeSendCreateVnodeMsg(pVgroup, &ipSet, ahandle);
} }
...@@ -684,7 +684,7 @@ static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg) { ...@@ -684,7 +684,7 @@ static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg) {
} }
SVgObj *pVgroup = mnodeMsg->pVgroup; SVgObj *pVgroup = mnodeMsg->pVgroup;
mTrace("vgId:%d, create vnode rsp received, result:%s received:%d successed:%d expected:%d, thandle:%p ahandle:%p", mDebug("vgId:%d, create vnode rsp received, result:%s received:%d successed:%d expected:%d, thandle:%p ahandle:%p",
pVgroup->vgId, tstrerror(rpcMsg->code), mnodeMsg->received, mnodeMsg->successed, mnodeMsg->expected, pVgroup->vgId, tstrerror(rpcMsg->code), mnodeMsg->received, mnodeMsg->successed, mnodeMsg->expected,
mnodeMsg->rpcMsg.handle, rpcMsg->handle); mnodeMsg->rpcMsg.handle, rpcMsg->handle);
...@@ -728,16 +728,16 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) { ...@@ -728,16 +728,16 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) {
} }
static void mnodeSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) { static void mnodeSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) {
mTrace("vgId:%d, send drop all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle); mDebug("vgId:%d, send drop all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle);
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp); SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
mTrace("vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p", pVgroup->vgId, pVgroup->vnodeGid[i].dnodeId, ahandle); mDebug("vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p", pVgroup->vgId, pVgroup->vnodeGid[i].dnodeId, ahandle);
mnodeSendDropVnodeMsg(pVgroup->vgId, &ipSet, ahandle); mnodeSendDropVnodeMsg(pVgroup->vgId, &ipSet, ahandle);
} }
} }
static void mnodeProcessDropVnodeRsp(SRpcMsg *rpcMsg) { static void mnodeProcessDropVnodeRsp(SRpcMsg *rpcMsg) {
mTrace("drop vnode rsp is received, handle:%p", rpcMsg->handle); mDebug("drop vnode rsp is received, handle:%p", rpcMsg->handle);
if (rpcMsg->handle == NULL) return; if (rpcMsg->handle == NULL) return;
SMnodeMsg *mnodeMsg = rpcMsg->handle; SMnodeMsg *mnodeMsg = rpcMsg->handle;
...@@ -748,7 +748,7 @@ static void mnodeProcessDropVnodeRsp(SRpcMsg *rpcMsg) { ...@@ -748,7 +748,7 @@ static void mnodeProcessDropVnodeRsp(SRpcMsg *rpcMsg) {
} }
SVgObj *pVgroup = mnodeMsg->pVgroup; SVgObj *pVgroup = mnodeMsg->pVgroup;
mTrace("vgId:%d, drop vnode rsp received, result:%s received:%d successed:%d expected:%d, thandle:%p ahandle:%p", mDebug("vgId:%d, drop vnode rsp received, result:%s received:%d successed:%d expected:%d, thandle:%p ahandle:%p",
pVgroup->vgId, tstrerror(rpcMsg->code), mnodeMsg->received, mnodeMsg->successed, mnodeMsg->expected, pVgroup->vgId, tstrerror(rpcMsg->code), mnodeMsg->received, mnodeMsg->successed, mnodeMsg->expected,
mnodeMsg->rpcMsg.handle, rpcMsg->handle); mnodeMsg->rpcMsg.handle, rpcMsg->handle);
...@@ -774,19 +774,19 @@ static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) { ...@@ -774,19 +774,19 @@ static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) {
SDnodeObj *pDnode = mnodeGetDnode(pCfg->dnodeId); SDnodeObj *pDnode = mnodeGetDnode(pCfg->dnodeId);
if (pDnode == NULL) { if (pDnode == NULL) {
mTrace("dnode:%s, vgId:%d, invalid dnode", taosIpStr(pCfg->dnodeId), pCfg->vgId); mDebug("dnode:%s, vgId:%d, invalid dnode", taosIpStr(pCfg->dnodeId), pCfg->vgId);
return TSDB_CODE_MND_VGROUP_NOT_EXIST; return TSDB_CODE_MND_VGROUP_NOT_EXIST;
} }
mnodeDecDnodeRef(pDnode); mnodeDecDnodeRef(pDnode);
SVgObj *pVgroup = mnodeGetVgroup(pCfg->vgId); SVgObj *pVgroup = mnodeGetVgroup(pCfg->vgId);
if (pVgroup == NULL) { if (pVgroup == NULL) {
mTrace("dnode:%s, vgId:%d, no vgroup info", taosIpStr(pCfg->dnodeId), pCfg->vgId); mDebug("dnode:%s, vgId:%d, no vgroup info", taosIpStr(pCfg->dnodeId), pCfg->vgId);
return TSDB_CODE_MND_VGROUP_NOT_EXIST; return TSDB_CODE_MND_VGROUP_NOT_EXIST;
} }
mnodeDecVgroupRef(pVgroup); mnodeDecVgroupRef(pVgroup);
mTrace("vgId:%d, send create vnode msg to dnode %s for vnode cfg msg", pVgroup->vgId, pDnode->dnodeEp); mDebug("vgId:%d, send create vnode msg to dnode %s for vnode cfg msg", pVgroup->vgId, pDnode->dnodeEp);
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pDnode->dnodeEp); SRpcIpSet ipSet = mnodeGetIpSetFromIp(pDnode->dnodeEp);
mnodeSendCreateVnodeMsg(pVgroup, &ipSet, NULL); mnodeSendCreateVnodeMsg(pVgroup, &ipSet, NULL);
...@@ -798,7 +798,7 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) { ...@@ -798,7 +798,7 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
SVgObj *pVgroup = NULL; SVgObj *pVgroup = NULL;
int32_t numOfVgroups = 0; int32_t numOfVgroups = 0;
mPrint("dnode:%d, all vgroups will be dropped from sdb", pDropDnode->dnodeId); mInfo("dnode:%d, all vgroups will be dropped from sdb", pDropDnode->dnodeId);
while (1) { while (1) {
pIter = mnodeGetNextVgroup(pIter, &pVgroup); pIter = mnodeGetNextVgroup(pIter, &pVgroup);
...@@ -819,14 +819,14 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) { ...@@ -819,14 +819,14 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
sdbFreeIter(pIter); sdbFreeIter(pIter);
mPrint("dnode:%d, all vgroups is dropped from sdb", pDropDnode->dnodeId); mInfo("dnode:%d, all vgroups is dropped from sdb", pDropDnode->dnodeId);
} }
void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb) { void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb) {
void * pIter = NULL; void * pIter = NULL;
SVgObj *pVgroup = NULL; SVgObj *pVgroup = NULL;
mPrint("db:%s, all vgroups will be update in sdb", pAlterDb->name); mInfo("db:%s, all vgroups will be update in sdb", pAlterDb->name);
while (1) { while (1) {
pIter = mnodeGetNextVgroup(pIter, &pVgroup); pIter = mnodeGetNextVgroup(pIter, &pVgroup);
...@@ -841,7 +841,7 @@ void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb) { ...@@ -841,7 +841,7 @@ void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb) {
sdbFreeIter(pIter); sdbFreeIter(pIter);
mPrint("db:%s, all vgroups is updated in sdb", pAlterDb->name); mInfo("db:%s, all vgroups is updated in sdb", pAlterDb->name);
} }
void mnodeDropAllDbVgroups(SDbObj *pDropDb) { void mnodeDropAllDbVgroups(SDbObj *pDropDb) {
...@@ -849,7 +849,7 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) { ...@@ -849,7 +849,7 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) {
int32_t numOfVgroups = 0; int32_t numOfVgroups = 0;
SVgObj *pVgroup = NULL; SVgObj *pVgroup = NULL;
mPrint("db:%s, all vgroups will be dropped from sdb", pDropDb->name); mInfo("db:%s, all vgroups will be dropped from sdb", pDropDb->name);
while (1) { while (1) {
pIter = mnodeGetNextVgroup(pIter, &pVgroup); pIter = mnodeGetNextVgroup(pIter, &pVgroup);
if (pVgroup == NULL) break; if (pVgroup == NULL) break;
...@@ -869,7 +869,7 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) { ...@@ -869,7 +869,7 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) {
sdbFreeIter(pIter); sdbFreeIter(pIter);
mPrint("db:%s, all vgroups:%d is dropped from sdb", pDropDb->name, numOfVgroups); mInfo("db:%s, all vgroups:%d is dropped from sdb", pDropDb->name, numOfVgroups);
} }
void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) { void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) {
...@@ -877,7 +877,7 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) { ...@@ -877,7 +877,7 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) {
int32_t numOfVgroups = 0; int32_t numOfVgroups = 0;
SVgObj *pVgroup = NULL; SVgObj *pVgroup = NULL;
mPrint("db:%s, all vgroups will be dropped in dnode", pDropDb->name); mInfo("db:%s, all vgroups will be dropped in dnode", pDropDb->name);
while (1) { while (1) {
pIter = mnodeGetNextVgroup(pIter, &pVgroup); pIter = mnodeGetNextVgroup(pIter, &pVgroup);
if (pVgroup == NULL) break; if (pVgroup == NULL) break;
...@@ -891,5 +891,5 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) { ...@@ -891,5 +891,5 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) {
sdbFreeIter(pIter); sdbFreeIter(pIter);
mPrint("db:%s, all vgroups:%d drop msg is sent to dnode", pDropDb->name, numOfVgroups); mInfo("db:%s, all vgroups:%d drop msg is sent to dnode", pDropDb->name, numOfVgroups);
} }
...@@ -54,10 +54,10 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) { ...@@ -54,10 +54,10 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) {
rpcRsp->rsp = ipSet; rpcRsp->rsp = ipSet;
rpcRsp->len = sizeof(SRpcIpSet); rpcRsp->len = sizeof(SRpcIpSet);
mTrace("app:%p:%p, msg:%s will be redireced inUse:%d", pMsg->rpcMsg.ahandle, pMsg, taosMsg[pMsg->rpcMsg.msgType], mDebug("app:%p:%p, msg:%s will be redireced inUse:%d", pMsg->rpcMsg.ahandle, pMsg, taosMsg[pMsg->rpcMsg.msgType],
ipSet->inUse); ipSet->inUse);
for (int32_t i = 0; i < ipSet->numOfIps; ++i) { for (int32_t i = 0; i < ipSet->numOfIps; ++i) {
mTrace("app:%p:%p, mnode index:%d ip:%s:%d", pMsg->rpcMsg.ahandle, pMsg, i, ipSet->fqdn[i], mDebug("app:%p:%p, mnode index:%d ip:%s:%d", pMsg->rpcMsg.ahandle, pMsg, i, ipSet->fqdn[i],
htons(ipSet->port[i])); htons(ipSet->port[i]));
} }
......
...@@ -111,7 +111,7 @@ int taosGetPrivateIp(char *const ip) { ...@@ -111,7 +111,7 @@ int taosGetPrivateIp(char *const ip) {
return 0; return 0;
} else { } else {
if (hasLoCard) { if (hasLoCard) {
uPrint("no net card was found, use lo:127.0.0.1 as default"); uInfo("no net card was found, use lo:127.0.0.1 as default");
strcpy(ip, "127.0.0.1"); strcpy(ip, "127.0.0.1");
return 0; return 0;
} }
...@@ -179,7 +179,7 @@ void taosGetSystemTimezone() { ...@@ -179,7 +179,7 @@ void taosGetSystemTimezone() {
strcpy(tsTimezone, tz); strcpy(tsTimezone, tz);
} }
cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("timezone not configured, use default"); uInfo("timezone not configured, use default");
} }
} }
...@@ -191,7 +191,7 @@ void taosGetSystemLocale() { ...@@ -191,7 +191,7 @@ void taosGetSystemLocale() {
if (locale != NULL) { if (locale != NULL) {
tstrncpy(tsLocale, locale, sizeof(tsLocale)); tstrncpy(tsLocale, locale, sizeof(tsLocale));
cfg_locale->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_locale->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("locale not configured, set to default:%s", tsLocale); uInfo("locale not configured, set to default:%s", tsLocale);
} }
} }
...@@ -199,7 +199,7 @@ void taosGetSystemLocale() { ...@@ -199,7 +199,7 @@ void taosGetSystemLocale() {
if (cfg_charset && cfg_charset->cfgStatus < TAOS_CFG_CSTATUS_DEFAULT) { if (cfg_charset && cfg_charset->cfgStatus < TAOS_CFG_CSTATUS_DEFAULT) {
strcpy(tsCharset, "cp936"); strcpy(tsCharset, "cp936");
cfg_charset->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_charset->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("charset not configured, set to default:%s", tsCharset); uInfo("charset not configured, set to default:%s", tsCharset);
} }
} }
......
...@@ -204,7 +204,7 @@ static void taosGetSystemTimezone() { ...@@ -204,7 +204,7 @@ static void taosGetSystemTimezone() {
sprintf(tsTimezone, "%s (%s, %s%02d00)", buf, tzname[daylight], tz >= 0 ? "+" : "-", abs(tz)); sprintf(tsTimezone, "%s (%s, %s%02d00)", buf, tzname[daylight], tz >= 0 ? "+" : "-", abs(tz));
// cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; // cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("timezone not configured, set to system default:%s", tsTimezone); uInfo("timezone not configured, set to system default:%s", tsTimezone);
} }
/* /*
...@@ -411,7 +411,7 @@ bool taosGetBandSpeed(float *bandSpeedKb) { ...@@ -411,7 +411,7 @@ bool taosGetBandSpeed(float *bandSpeedKb) {
double totalBytes = (double)(curBytes - lastBytes) / 1024 * 8; // Kb double totalBytes = (double)(curBytes - lastBytes) / 1024 * 8; // Kb
*bandSpeedKb = (float)(totalBytes / (double)(curTime - lastTime)); *bandSpeedKb = (float)(totalBytes / (double)(curTime - lastTime));
// uPrint("bandwidth lastBytes:%ld, lastTime:%ld, curBytes:%ld, curTime:%ld, // uInfo("bandwidth lastBytes:%ld, lastTime:%ld, curBytes:%ld, curTime:%ld,
// speed:%f", lastBytes, lastTime, curBytes, curTime, *bandSpeed); // speed:%f", lastBytes, lastTime, curBytes, curTime, *bandSpeed);
lastTime = curTime; lastTime = curTime;
...@@ -517,29 +517,29 @@ void taosGetSystemInfo() { ...@@ -517,29 +517,29 @@ void taosGetSystemInfo() {
} }
void taosPrintOsInfo() { void taosPrintOsInfo() {
uPrint(" os pageSize: %" PRId64 "(KB)", tsPageSize); uInfo(" os pageSize: %" PRId64 "(KB)", tsPageSize);
uPrint(" os openMax: %" PRId64, tsOpenMax); uInfo(" os openMax: %" PRId64, tsOpenMax);
uPrint(" os streamMax: %" PRId64, tsStreamMax); uInfo(" os streamMax: %" PRId64, tsStreamMax);
uPrint(" os numOfCores: %d", tsNumOfCores); uInfo(" os numOfCores: %d", tsNumOfCores);
uPrint(" os totalDisk: %f(GB)", tsTotalDataDirGB); uInfo(" os totalDisk: %f(GB)", tsTotalDataDirGB);
uPrint(" os totalMemory: %d(MB)", tsTotalMemoryMB); uInfo(" os totalMemory: %d(MB)", tsTotalMemoryMB);
struct utsname buf; struct utsname buf;
if (uname(&buf)) { if (uname(&buf)) {
uPrint(" can't fetch os info"); uInfo(" can't fetch os info");
return; return;
} }
uPrint(" os sysname: %s", buf.sysname); uInfo(" os sysname: %s", buf.sysname);
uPrint(" os nodename: %s", buf.nodename); uInfo(" os nodename: %s", buf.nodename);
uPrint(" os release: %s", buf.release); uInfo(" os release: %s", buf.release);
uPrint(" os version: %s", buf.version); uInfo(" os version: %s", buf.version);
uPrint(" os machine: %s", buf.machine); uInfo(" os machine: %s", buf.machine);
uPrint("=================================="); uInfo("==================================");
} }
void taosKillSystem() { void taosKillSystem() {
// SIGINT // SIGINT
uPrint("taosd will shut down soon"); uInfo("taosd will shut down soon");
kill(tsProcId, 2); kill(tsProcId, 2);
} }
...@@ -553,11 +553,11 @@ void taosSetCoreDump() { ...@@ -553,11 +553,11 @@ void taosSetCoreDump() {
struct rlimit rlim; struct rlimit rlim;
struct rlimit rlim_new; struct rlimit rlim_new;
if (getrlimit(RLIMIT_CORE, &rlim) == 0) { if (getrlimit(RLIMIT_CORE, &rlim) == 0) {
uPrint("the old unlimited para: rlim_cur=%" PRIu64 ", rlim_max=%" PRIu64, rlim.rlim_cur, rlim.rlim_max); uInfo("the old unlimited para: rlim_cur=%" PRIu64 ", rlim_max=%" PRIu64, rlim.rlim_cur, rlim.rlim_max);
rlim_new.rlim_cur = RLIM_INFINITY; rlim_new.rlim_cur = RLIM_INFINITY;
rlim_new.rlim_max = RLIM_INFINITY; rlim_new.rlim_max = RLIM_INFINITY;
if (setrlimit(RLIMIT_CORE, &rlim_new) != 0) { if (setrlimit(RLIMIT_CORE, &rlim_new) != 0) {
uPrint("set unlimited fail, error: %s", strerror(errno)); uInfo("set unlimited fail, error: %s", strerror(errno));
rlim_new.rlim_cur = rlim.rlim_max; rlim_new.rlim_cur = rlim.rlim_max;
rlim_new.rlim_max = rlim.rlim_max; rlim_new.rlim_max = rlim.rlim_max;
(void)setrlimit(RLIMIT_CORE, &rlim_new); (void)setrlimit(RLIMIT_CORE, &rlim_new);
...@@ -565,7 +565,7 @@ void taosSetCoreDump() { ...@@ -565,7 +565,7 @@ void taosSetCoreDump() {
} }
if (getrlimit(RLIMIT_CORE, &rlim) == 0) { if (getrlimit(RLIMIT_CORE, &rlim) == 0) {
uPrint("the new unlimited para: rlim_cur=%" PRIu64 ", rlim_max=%" PRIu64, rlim.rlim_cur, rlim.rlim_max); uInfo("the new unlimited para: rlim_cur=%" PRIu64 ", rlim_max=%" PRIu64, rlim.rlim_cur, rlim.rlim_max);
} }
#ifndef _TD_ARM_ #ifndef _TD_ARM_
...@@ -589,10 +589,10 @@ void taosSetCoreDump() { ...@@ -589,10 +589,10 @@ void taosSetCoreDump() {
old_len = sizeof(old_usespid); old_len = sizeof(old_usespid);
if (syscall(SYS__sysctl, &args) == -1) { if (syscall(SYS__sysctl, &args) == -1) {
uPrint("_sysctl(kern_core_uses_pid) set fail: %s", strerror(errno)); uInfo("_sysctl(kern_core_uses_pid) set fail: %s", strerror(errno));
} }
uPrint("The old core_uses_pid[%" PRIu64 "]: %d", old_len, old_usespid); uInfo("The old core_uses_pid[%" PRIu64 "]: %d", old_len, old_usespid);
old_usespid = 0; old_usespid = 0;
...@@ -606,10 +606,10 @@ void taosSetCoreDump() { ...@@ -606,10 +606,10 @@ void taosSetCoreDump() {
old_len = sizeof(old_usespid); old_len = sizeof(old_usespid);
if (syscall(SYS__sysctl, &args) == -1) { if (syscall(SYS__sysctl, &args) == -1) {
uPrint("_sysctl(kern_core_uses_pid) get fail: %s", strerror(errno)); uInfo("_sysctl(kern_core_uses_pid) get fail: %s", strerror(errno));
} }
uPrint("The new core_uses_pid[%" PRIu64 "]: %d", old_len, old_usespid); uInfo("The new core_uses_pid[%" PRIu64 "]: %d", old_len, old_usespid);
#endif #endif
#if 0 #if 0
...@@ -619,7 +619,7 @@ void taosSetCoreDump() { ...@@ -619,7 +619,7 @@ void taosSetCoreDump() {
if (opendir(coredump_dir) == NULL) { if (opendir(coredump_dir) == NULL) {
status = mkdir(coredump_dir, S_IRWXU | S_IRWXG | S_IRWXO); status = mkdir(coredump_dir, S_IRWXU | S_IRWXG | S_IRWXO);
if (status) { if (status) {
uPrint("mkdir fail, error: %s\n", strerror(errno)); uInfo("mkdir fail, error: %s\n", strerror(errno));
} }
} }
...@@ -643,10 +643,10 @@ void taosSetCoreDump() { ...@@ -643,10 +643,10 @@ void taosSetCoreDump() {
old_len = sizeof(old_corefile); old_len = sizeof(old_corefile);
if (syscall(SYS__sysctl, &args) == -1) { if (syscall(SYS__sysctl, &args) == -1) {
uPrint("_sysctl(kern_core_pattern) set fail: %s", strerror(errno)); uInfo("_sysctl(kern_core_pattern) set fail: %s", strerror(errno));
} }
uPrint("The old kern_core_pattern: %*s\n", old_len, old_corefile); uInfo("The old kern_core_pattern: %*s\n", old_len, old_corefile);
memset(&args, 0, sizeof(struct __sysctl_args)); memset(&args, 0, sizeof(struct __sysctl_args));
...@@ -658,10 +658,10 @@ void taosSetCoreDump() { ...@@ -658,10 +658,10 @@ void taosSetCoreDump() {
old_len = sizeof(old_corefile); old_len = sizeof(old_corefile);
if (syscall(SYS__sysctl, &args) == -1) { if (syscall(SYS__sysctl, &args) == -1) {
uPrint("_sysctl(kern_core_pattern) get fail: %s", strerror(errno)); uInfo("_sysctl(kern_core_pattern) get fail: %s", strerror(errno));
} }
uPrint("The new kern_core_pattern: %*s\n", old_len, old_corefile); uInfo("The new kern_core_pattern: %*s\n", old_len, old_corefile);
#endif #endif
} }
......
...@@ -216,7 +216,7 @@ void taosGetSystemTimezone() { ...@@ -216,7 +216,7 @@ void taosGetSystemTimezone() {
strcpy(tsTimezone, tz); strcpy(tsTimezone, tz);
} }
cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("timezone not configured, use default"); uInfo("timezone not configured, use default");
} }
} }
...@@ -228,7 +228,7 @@ void taosGetSystemLocale() { ...@@ -228,7 +228,7 @@ void taosGetSystemLocale() {
if (locale != NULL) { if (locale != NULL) {
tstrncpy(tsLocale, locale, sizeof(tsLocale)); tstrncpy(tsLocale, locale, sizeof(tsLocale));
cfg_locale->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_locale->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("locale not configured, set to default:%s", tsLocale); uInfo("locale not configured, set to default:%s", tsLocale);
} }
} }
...@@ -236,7 +236,7 @@ void taosGetSystemLocale() { ...@@ -236,7 +236,7 @@ void taosGetSystemLocale() {
if (cfg_charset && cfg_charset->cfgStatus < TAOS_CFG_CSTATUS_DEFAULT) { if (cfg_charset && cfg_charset->cfgStatus < TAOS_CFG_CSTATUS_DEFAULT) {
strcpy(tsCharset, "cp936"); strcpy(tsCharset, "cp936");
cfg_charset->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_charset->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
uPrint("charset not configured, set to default:%s", tsCharset); uInfo("charset not configured, set to default:%s", tsCharset);
} }
} }
......
...@@ -20,10 +20,14 @@ ...@@ -20,10 +20,14 @@
extern int32_t httpDebugFlag; extern int32_t httpDebugFlag;
#define httpError(...) { if (httpDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR HTP ", 255, __VA_ARGS__); }} #define httpFatal(...) { if (httpDebugFlag & DEBUG_FATAL) { taosPrintLog("HTP FATAL ", httpDebugFlag, __VA_ARGS__); }}
#define httpWarn(...) { if (httpDebugFlag & DEBUG_WARN) { taosPrintLog("WARN HTP ", httpDebugFlag, __VA_ARGS__); }} #define httpError(...) { if (httpDebugFlag & DEBUG_ERROR) { taosPrintLog("HTP ERROR ", httpDebugFlag, __VA_ARGS__); }}
#define httpTrace(...) { if (httpDebugFlag & DEBUG_TRACE) { taosPrintLog("HTP ", httpDebugFlag, __VA_ARGS__); }} #define httpWarn(...) { if (httpDebugFlag & DEBUG_WARN) { taosPrintLog("HTP WARN ", httpDebugFlag, __VA_ARGS__); }}
#define httpDump(...) { if (httpDebugFlag & DEBUG_TRACE) { taosPrintLongString("HTP ", httpDebugFlag, __VA_ARGS__); }} #define httpInfo(...) { if (httpDebugFlag & DEBUG_INFO) { taosPrintLog("HTP INFO ", httpDebugFlag, __VA_ARGS__); }}
#define httpPrint(...) { taosPrintLog("HTP ", 255, __VA_ARGS__); } #define httpDebug(...) { if (httpDebugFlag & DEBUG_DEBUG) { taosPrintLog("HTP DEBUG ", httpDebugFlag, __VA_ARGS__); }}
#define httpTrace(...) { if (httpDebugFlag & DEBUG_TRACE) { taosPrintLog("HTP TRACE ", httpDebugFlag, __VA_ARGS__); }}
#define httpDebugDump(...) { if (httpDebugFlag & DEBUG_DEBUG) { taosPrintLongString("HTP DEBUG ", httpDebugFlag, __VA_ARGS__); }}
#define httpTraceDump(...) { if (httpDebugFlag & DEBUG_TRACE) { taosPrintLongString("HTP TRACE ", httpDebugFlag, __VA_ARGS__); }}
#endif #endif
...@@ -67,7 +67,7 @@ bool gcGetPassFromUrl(HttpContext* pContext) { ...@@ -67,7 +67,7 @@ bool gcGetPassFromUrl(HttpContext* pContext) {
} }
bool gcProcessLoginRequest(HttpContext* pContext) { bool gcProcessLoginRequest(HttpContext* pContext) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, process grafana login msg", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, process grafana login msg", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
pContext->reqType = HTTP_REQTYPE_LOGIN; pContext->reqType = HTTP_REQTYPE_LOGIN;
return true; return true;
...@@ -143,7 +143,7 @@ bool gcProcessLoginRequest(HttpContext* pContext) { ...@@ -143,7 +143,7 @@ bool gcProcessLoginRequest(HttpContext* pContext) {
//}] //}]
bool gcProcessQueryRequest(HttpContext* pContext) { bool gcProcessQueryRequest(HttpContext* pContext) {
httpTrace("context:%p, fd:%d, ip:%s, process grafana query msg", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, process grafana query msg", pContext, pContext->fd, pContext->ipstr);
HttpParser* pParser = &pContext->parser; HttpParser* pParser = &pContext->parser;
char* filter = pParser->data.pos; char* filter = pParser->data.pos;
...@@ -183,7 +183,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) { ...@@ -183,7 +183,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) {
cJSON* refId = cJSON_GetObjectItem(query, "refId"); cJSON* refId = cJSON_GetObjectItem(query, "refId");
if (refId == NULL || refId->valuestring == NULL || strlen(refId->valuestring) == 0) { if (refId == NULL || refId->valuestring == NULL || strlen(refId->valuestring) == 0) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, refId is null", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, refId is null", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
continue; continue;
} }
...@@ -211,7 +211,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) { ...@@ -211,7 +211,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) {
cJSON* sql = cJSON_GetObjectItem(query, "sql"); cJSON* sql = cJSON_GetObjectItem(query, "sql");
if (sql == NULL || sql->valuestring == NULL || strlen(sql->valuestring) == 0) { if (sql == NULL || sql->valuestring == NULL || strlen(sql->valuestring) == 0) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, sql is null", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, sql is null", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
continue; continue;
} }
...@@ -251,7 +251,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) { ...@@ -251,7 +251,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) {
} }
bool gcProcessHeartbeatRequest(HttpContext* pContext) { bool gcProcessHeartbeatRequest(HttpContext* pContext) {
httpTrace("context:%p, fd:%d, ip:%s, process grafana heartbeat msg", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, process grafana heartbeat msg", pContext, pContext->fd, pContext->ipstr);
pContext->reqType = HTTP_REQTYPE_HEARTBEAT; pContext->reqType = HTTP_REQTYPE_HEARTBEAT;
pContext->encodeMethod = &gcHeartBeatMethod; pContext->encodeMethod = &gcHeartBeatMethod;
return true; return true;
......
...@@ -63,7 +63,7 @@ bool httpParseBasicAuthToken(HttpContext *pContext, char *token, int len) { ...@@ -63,7 +63,7 @@ bool httpParseBasicAuthToken(HttpContext *pContext, char *token, int len) {
pContext->pass[pass_len] = 0; pContext->pass[pass_len] = 0;
free(base64); free(base64);
httpTrace("context:%p, fd:%d, ip:%s, basic token parsed success, user:%s", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, basic token parsed success, user:%s", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
return true; return true;
} }
...@@ -93,7 +93,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) { ...@@ -93,7 +93,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
tstrncpy(pContext->user, descrypt, sizeof(pContext->user)); tstrncpy(pContext->user, descrypt, sizeof(pContext->user));
tstrncpy(pContext->pass, descrypt + TSDB_USER_LEN, sizeof(pContext->pass)); tstrncpy(pContext->pass, descrypt + TSDB_USER_LEN, sizeof(pContext->pass));
httpTrace("context:%p, fd:%d, ip:%s, taosd token:%s parsed success, user:%s", pContext, pContext->fd, httpDebug("context:%p, fd:%d, ip:%s, taosd token:%s parsed success, user:%s", pContext, pContext->fd,
pContext->ipstr, token, pContext->user); pContext->ipstr, token, pContext->user);
free(base64); free(base64);
free(descrypt); free(descrypt);
...@@ -116,7 +116,7 @@ bool httpGenTaosdAuthToken(HttpContext *pContext, char *token, int maxLen) { ...@@ -116,7 +116,7 @@ bool httpGenTaosdAuthToken(HttpContext *pContext, char *token, int maxLen) {
free(encrypt); free(encrypt);
free(base64); free(base64);
httpTrace("context:%p, fd:%d, ip:%s, gen taosd token:%s", pContext, pContext->fd, pContext->ipstr, token); httpDebug("context:%p, fd:%d, ip:%s, gen taosd token:%s", pContext, pContext->fd, pContext->ipstr, token);
return true; return true;
} }
...@@ -53,7 +53,7 @@ static void httpDestroyContext(void *data) { ...@@ -53,7 +53,7 @@ static void httpDestroyContext(void *data) {
httpFreeJsonBuf(pContext); httpFreeJsonBuf(pContext);
httpFreeMultiCmds(pContext); httpFreeMultiCmds(pContext);
httpTrace("context:%p, is destroyed, refCount:%d", pContext, pContext->refCount); httpDebug("context:%p, is destroyed, refCount:%d", pContext, pContext->refCount);
tfree(pContext); tfree(pContext);
} }
...@@ -70,7 +70,7 @@ bool httpInitContexts() { ...@@ -70,7 +70,7 @@ bool httpInitContexts() {
void httpCleanupContexts() { void httpCleanupContexts() {
if (tsHttpServer.contextCache != NULL) { if (tsHttpServer.contextCache != NULL) {
SCacheObj *cache = tsHttpServer.contextCache; SCacheObj *cache = tsHttpServer.contextCache;
httpPrint("context cache is cleanuping, size:%zu", taosHashGetSize(cache->pHashTable)); httpInfo("context cache is cleanuping, size:%zu", taosHashGetSize(cache->pHashTable));
taosCacheCleanup(tsHttpServer.contextCache); taosCacheCleanup(tsHttpServer.contextCache);
tsHttpServer.contextCache = NULL; tsHttpServer.contextCache = NULL;
} }
...@@ -113,7 +113,7 @@ HttpContext *httpCreateContext(int32_t fd) { ...@@ -113,7 +113,7 @@ HttpContext *httpCreateContext(int32_t fd) {
HttpContext **ppContext = taosCachePut(tsHttpServer.contextCache, contextStr, &pContext, sizeof(HttpContext *), 3); HttpContext **ppContext = taosCachePut(tsHttpServer.contextCache, contextStr, &pContext, sizeof(HttpContext *), 3);
pContext->ppContext = ppContext; pContext->ppContext = ppContext;
httpTrace("context:%p, fd:%d, is created, item:%p", pContext, fd, ppContext); httpDebug("context:%p, fd:%d, is created, item:%p", pContext, fd, ppContext);
// set the ref to 0 // set the ref to 0
taosCacheRelease(tsHttpServer.contextCache, (void**)&ppContext, false); taosCacheRelease(tsHttpServer.contextCache, (void**)&ppContext, false);
...@@ -131,7 +131,7 @@ HttpContext *httpGetContext(void *ptr) { ...@@ -131,7 +131,7 @@ HttpContext *httpGetContext(void *ptr) {
HttpContext *pContext = *ppContext; HttpContext *pContext = *ppContext;
if (pContext) { if (pContext) {
int32_t refCount = atomic_add_fetch_32(&pContext->refCount, 1); int32_t refCount = atomic_add_fetch_32(&pContext->refCount, 1);
httpTrace("context:%p, fd:%d, is accquired, refCount:%d", pContext, pContext->fd, refCount); httpDebug("context:%p, fd:%d, is accquired, refCount:%d", pContext, pContext->fd, refCount);
return pContext; return pContext;
} }
} }
...@@ -141,7 +141,7 @@ HttpContext *httpGetContext(void *ptr) { ...@@ -141,7 +141,7 @@ HttpContext *httpGetContext(void *ptr) {
void httpReleaseContext(HttpContext *pContext) { void httpReleaseContext(HttpContext *pContext) {
int32_t refCount = atomic_sub_fetch_32(&pContext->refCount, 1); int32_t refCount = atomic_sub_fetch_32(&pContext->refCount, 1);
assert(refCount >= 0); assert(refCount >= 0);
httpTrace("context:%p, fd:%d, is releasd, refCount:%d", pContext, pContext->fd, refCount); httpDebug("context:%p, fd:%d, is releasd, refCount:%d", pContext, pContext->fd, refCount);
HttpContext **ppContext = pContext->ppContext; HttpContext **ppContext = pContext->ppContext;
taosCacheRelease(tsHttpServer.contextCache, (void **)(&ppContext), false); taosCacheRelease(tsHttpServer.contextCache, (void **)(&ppContext), false);
...@@ -164,7 +164,7 @@ bool httpInitContext(HttpContext *pContext) { ...@@ -164,7 +164,7 @@ bool httpInitContext(HttpContext *pContext) {
memset(pParser, 0, sizeof(HttpParser)); memset(pParser, 0, sizeof(HttpParser));
pParser->pCur = pParser->pLast = pParser->buffer; pParser->pCur = pParser->pLast = pParser->buffer;
httpTrace("context:%p, fd:%d, ip:%s, thread:%s, accessTimes:%d, parsed:%d", httpDebug("context:%p, fd:%d, ip:%s, thread:%s, accessTimes:%d, parsed:%d",
pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->accessTimes, pContext->parsed); pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->accessTimes, pContext->parsed);
return true; return true;
} }
...@@ -181,18 +181,18 @@ void httpCloseContextByApp(HttpContext *pContext) { ...@@ -181,18 +181,18 @@ void httpCloseContextByApp(HttpContext *pContext) {
if (keepAlive) { if (keepAlive) {
if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_HANDLING, HTTP_CONTEXT_STATE_READY)) { if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_HANDLING, HTTP_CONTEXT_STATE_READY)) {
httpTrace("context:%p, fd:%d, ip:%s, last state:handling, keepAlive:true, reuse connect", httpDebug("context:%p, fd:%d, ip:%s, last state:handling, keepAlive:true, reuse connect",
pContext, pContext->fd, pContext->ipstr); pContext, pContext->fd, pContext->ipstr);
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_CLOSED)) { } else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_CLOSED)) {
httpRemoveContextFromEpoll(pContext); httpRemoveContextFromEpoll(pContext);
httpTrace("context:%p, fd:%d, ip:%s, last state:dropping, keepAlive:true, close connect", httpDebug("context:%p, fd:%d, ip:%s, last state:dropping, keepAlive:true, close connect",
pContext, pContext->fd, pContext->ipstr); pContext, pContext->fd, pContext->ipstr);
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_READY)) { } else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_READY)) {
httpTrace("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, reuse connect", httpDebug("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, reuse connect",
pContext, pContext->fd, pContext->ipstr); pContext, pContext->fd, pContext->ipstr);
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) { } else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) {
httpRemoveContextFromEpoll(pContext); httpRemoveContextFromEpoll(pContext);
httpTrace("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, close connect", httpDebug("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, close connect",
pContext, pContext->fd, pContext->ipstr); pContext, pContext->fd, pContext->ipstr);
} else { } else {
httpRemoveContextFromEpoll(pContext); httpRemoveContextFromEpoll(pContext);
...@@ -201,7 +201,7 @@ void httpCloseContextByApp(HttpContext *pContext) { ...@@ -201,7 +201,7 @@ void httpCloseContextByApp(HttpContext *pContext) {
} }
} else { } else {
httpRemoveContextFromEpoll(pContext); httpRemoveContextFromEpoll(pContext);
httpTrace("context:%p, fd:%d, ip:%s, last state:%s:%d, keepAlive:false, close connect", httpDebug("context:%p, fd:%d, ip:%s, last state:%s:%d, keepAlive:false, close connect",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->state); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->state);
} }
...@@ -210,13 +210,13 @@ void httpCloseContextByApp(HttpContext *pContext) { ...@@ -210,13 +210,13 @@ void httpCloseContextByApp(HttpContext *pContext) {
void httpCloseContextByServer(HttpContext *pContext) { void httpCloseContextByServer(HttpContext *pContext) {
if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_HANDLING, HTTP_CONTEXT_STATE_DROPPING)) { if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_HANDLING, HTTP_CONTEXT_STATE_DROPPING)) {
httpTrace("context:%p, fd:%d, ip:%s, epoll finished, still used by app", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, epoll finished, still used by app", pContext, pContext->fd, pContext->ipstr);
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_DROPPING)) { } else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_DROPPING)) {
httpTrace("context:%p, fd:%d, ip:%s, epoll already finished, wait app finished", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, epoll already finished, wait app finished", pContext, pContext->fd, pContext->ipstr);
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_CLOSED)) { } else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_CLOSED)) {
httpTrace("context:%p, fd:%d, ip:%s, epoll finished, close context", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, epoll finished, close context", pContext, pContext->fd, pContext->ipstr);
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) { } else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) {
httpTrace("context:%p, fd:%d, ip:%s, epoll finished, will be closed soon", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, epoll finished, will be closed soon", pContext, pContext->fd, pContext->ipstr);
} else { } else {
httpError("context:%p, fd:%d, ip:%s, unknown state:%d", pContext, pContext->fd, pContext->ipstr, pContext->state); httpError("context:%p, fd:%d, ip:%s, unknown state:%d", pContext, pContext->fd, pContext->ipstr, pContext->state);
} }
......
...@@ -124,7 +124,7 @@ bool httpParseHttpVersion(HttpContext* pContext) { ...@@ -124,7 +124,7 @@ bool httpParseHttpVersion(HttpContext* pContext) {
else else
pContext->httpVersion = HTTP_VERSION_10; pContext->httpVersion = HTTP_VERSION_10;
httpTrace("context:%p, fd:%d, ip:%s, httpVersion:1.%d", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, httpVersion:1.%d", pContext, pContext->fd, pContext->ipstr,
pContext->httpVersion); pContext->httpVersion);
return true; return true;
} }
...@@ -157,7 +157,7 @@ bool httpGetHttpMethod(HttpContext* pContext) { ...@@ -157,7 +157,7 @@ bool httpGetHttpMethod(HttpContext* pContext) {
pParser->method.pos[pParser->method.len] = 0; pParser->method.pos[pParser->method.len] = 0;
pParser->pLast = pSeek + 1; pParser->pLast = pSeek + 1;
httpTrace("context:%p, fd:%d, ip:%s, httpMethod:%s", pContext, pContext->fd, pContext->ipstr, pParser->method.pos); httpDebug("context:%p, fd:%d, ip:%s, httpMethod:%s", pContext, pContext->fd, pContext->ipstr, pParser->method.pos);
return true; return true;
} }
...@@ -186,23 +186,23 @@ bool httpParseHead(HttpContext* pContext) { ...@@ -186,23 +186,23 @@ bool httpParseHead(HttpContext* pContext) {
HttpParser* pParser = &pContext->parser; HttpParser* pParser = &pContext->parser;
if (strncasecmp(pParser->pLast, "Content-Length: ", 16) == 0) { if (strncasecmp(pParser->pLast, "Content-Length: ", 16) == 0) {
pParser->data.len = (int32_t)atoi(pParser->pLast + 16); pParser->data.len = (int32_t)atoi(pParser->pLast + 16);
httpTrace("context:%p, fd:%d, ip:%s, Content-Length:%d", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, Content-Length:%d", pContext, pContext->fd, pContext->ipstr,
pParser->data.len); pParser->data.len);
} else if (strncasecmp(pParser->pLast, "Accept-Encoding: ", 17) == 0) { } else if (strncasecmp(pParser->pLast, "Accept-Encoding: ", 17) == 0) {
if (tsHttpEnableCompress && strstr(pParser->pLast + 17, "gzip") != NULL) { if (tsHttpEnableCompress && strstr(pParser->pLast + 17, "gzip") != NULL) {
pContext->acceptEncoding = HTTP_COMPRESS_GZIP; pContext->acceptEncoding = HTTP_COMPRESS_GZIP;
httpTrace("context:%p, fd:%d, ip:%s, Accept-Encoding:gzip", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, Accept-Encoding:gzip", pContext, pContext->fd, pContext->ipstr);
} else { } else {
pContext->acceptEncoding = HTTP_COMPRESS_IDENTITY; pContext->acceptEncoding = HTTP_COMPRESS_IDENTITY;
httpTrace("context:%p, fd:%d, ip:%s, Accept-Encoding:identity", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, Accept-Encoding:identity", pContext, pContext->fd, pContext->ipstr);
} }
} else if (strncasecmp(pParser->pLast, "Content-Encoding: ", 18) == 0) { } else if (strncasecmp(pParser->pLast, "Content-Encoding: ", 18) == 0) {
if (strstr(pParser->pLast + 18, "gzip") != NULL) { if (strstr(pParser->pLast + 18, "gzip") != NULL) {
pContext->contentEncoding = HTTP_COMPRESS_GZIP; pContext->contentEncoding = HTTP_COMPRESS_GZIP;
httpTrace("context:%p, fd:%d, ip:%s, Content-Encoding:gzip", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, Content-Encoding:gzip", pContext, pContext->fd, pContext->ipstr);
} else { } else {
pContext->contentEncoding = HTTP_COMPRESS_IDENTITY; pContext->contentEncoding = HTTP_COMPRESS_IDENTITY;
httpTrace("context:%p, fd:%d, ip:%s, Content-Encoding:identity", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, Content-Encoding:identity", pContext, pContext->fd, pContext->ipstr);
} }
} else if (strncasecmp(pParser->pLast, "Connection: ", 12) == 0) { } else if (strncasecmp(pParser->pLast, "Connection: ", 12) == 0) {
if (strncasecmp(pParser->pLast + 12, "Keep-Alive", 10) == 0) { if (strncasecmp(pParser->pLast + 12, "Keep-Alive", 10) == 0) {
...@@ -210,7 +210,7 @@ bool httpParseHead(HttpContext* pContext) { ...@@ -210,7 +210,7 @@ bool httpParseHead(HttpContext* pContext) {
} else { } else {
pContext->httpKeepAlive = HTTP_KEEPALIVE_DISABLE; pContext->httpKeepAlive = HTTP_KEEPALIVE_DISABLE;
} }
httpTrace("context:%p, fd:%d, ip:%s, keepAlive:%d", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, keepAlive:%d", pContext, pContext->fd, pContext->ipstr,
pContext->httpKeepAlive); pContext->httpKeepAlive);
} else if (strncasecmp(pParser->pLast, "Transfer-Encoding: ", 19) == 0) { } else if (strncasecmp(pParser->pLast, "Transfer-Encoding: ", 19) == 0) {
if (strncasecmp(pParser->pLast + 19, "chunked", 7) == 0) { if (strncasecmp(pParser->pLast + 19, "chunked", 7) == 0) {
...@@ -281,7 +281,7 @@ bool httpReadChunkedBody(HttpContext* pContext, HttpParser* pParser) { ...@@ -281,7 +281,7 @@ bool httpReadChunkedBody(HttpContext* pContext, HttpParser* pParser) {
httpParseChunkedBody(pContext, pParser, false); httpParseChunkedBody(pContext, pParser, false);
return HTTP_CHECK_BODY_SUCCESS; return HTTP_CHECK_BODY_SUCCESS;
} else { } else {
httpTrace("context:%p, fd:%d, ip:%s, chunked body not finished, continue read", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, chunked body not finished, continue read", pContext, pContext->fd, pContext->ipstr);
if (!httpReadDataImp(pContext)) { if (!httpReadDataImp(pContext)) {
httpError("context:%p, fd:%d, ip:%s, read chunked request error", pContext, pContext->fd, pContext->ipstr); httpError("context:%p, fd:%d, ip:%s, read chunked request error", pContext, pContext->fd, pContext->ipstr);
return HTTP_CHECK_BODY_ERROR; return HTTP_CHECK_BODY_ERROR;
...@@ -299,7 +299,7 @@ int httpReadUnChunkedBody(HttpContext* pContext, HttpParser* pParser) { ...@@ -299,7 +299,7 @@ int httpReadUnChunkedBody(HttpContext* pContext, HttpParser* pParser) {
httpSendErrorResp(pContext, HTTP_PARSE_BODY_ERROR); httpSendErrorResp(pContext, HTTP_PARSE_BODY_ERROR);
return HTTP_CHECK_BODY_ERROR; return HTTP_CHECK_BODY_ERROR;
} else if (dataReadLen < pParser->data.len) { } else if (dataReadLen < pParser->data.len) {
httpTrace("context:%p, fd:%d, ip:%s, un-chunked body not finished, read size:%d dataReadLen:%d < pContext->data.len:%d, continue read", httpDebug("context:%p, fd:%d, ip:%s, un-chunked body not finished, read size:%d dataReadLen:%d < pContext->data.len:%d, continue read",
pContext, pContext->fd, pContext->ipstr, pContext->parser.bufsize, dataReadLen, pParser->data.len); pContext, pContext->fd, pContext->ipstr, pContext->parser.bufsize, dataReadLen, pParser->data.len);
return HTTP_CHECK_BODY_CONTINUE; return HTTP_CHECK_BODY_CONTINUE;
} else { } else {
...@@ -313,7 +313,7 @@ bool httpParseRequest(HttpContext* pContext) { ...@@ -313,7 +313,7 @@ bool httpParseRequest(HttpContext* pContext) {
return true; return true;
} }
httpTrace("context:%p, fd:%d, ip:%s, thread:%s, numOfFds:%d, read size:%d, raw data:\n%s", httpDebug("context:%p, fd:%d, ip:%s, thread:%s, numOfFds:%d, read size:%d, raw data:\n%s",
pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->pThread->numOfFds, pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->pThread->numOfFds,
pContext->parser.bufsize, pContext->parser.buffer); pContext->parser.bufsize, pContext->parser.buffer);
...@@ -351,7 +351,7 @@ bool httpParseRequest(HttpContext* pContext) { ...@@ -351,7 +351,7 @@ bool httpParseRequest(HttpContext* pContext) {
pParser->pLast = ++pParser->pCur; pParser->pLast = ++pParser->pCur;
} while (1); } while (1);
httpTrace("context:%p, fd:%d, ip:%s, parse http head ok", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, parse http head ok", pContext, pContext->fd, pContext->ipstr);
pContext->parsed = true; pContext->parsed = true;
return true; return true;
...@@ -389,7 +389,7 @@ bool httpDecodeRequest(HttpContext* pContext) { ...@@ -389,7 +389,7 @@ bool httpDecodeRequest(HttpContext* pContext) {
bool httpProcessData(HttpContext* pContext) { bool httpProcessData(HttpContext* pContext) {
if (!httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_HANDLING)) { if (!httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_HANDLING)) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s not in ready state, stop process request", httpDebug("context:%p, fd:%d, ip:%s, state:%s not in ready state, stop process request",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state)); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state));
httpCloseContextByApp(pContext); httpCloseContextByApp(pContext);
return false; return false;
...@@ -397,7 +397,7 @@ bool httpProcessData(HttpContext* pContext) { ...@@ -397,7 +397,7 @@ bool httpProcessData(HttpContext* pContext) {
// handle Cross-domain request // handle Cross-domain request
if (strcmp(pContext->parser.method.pos, "OPTIONS") == 0) { if (strcmp(pContext->parser.method.pos, "OPTIONS") == 0) {
httpTrace("context:%p, fd:%d, ip:%s, process options request", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, process options request", pContext, pContext->fd, pContext->ipstr);
httpSendOptionResp(pContext, "process options request success"); httpSendOptionResp(pContext, "process options request success");
} else { } else {
if (!httpDecodeRequest(pContext)) { if (!httpDecodeRequest(pContext)) {
......
...@@ -52,13 +52,13 @@ int httpWriteBufByFd(struct HttpContext* pContext, const char* buf, int sz) { ...@@ -52,13 +52,13 @@ int httpWriteBufByFd(struct HttpContext* pContext, const char* buf, int sz) {
} }
if (len < 0) { if (len < 0) {
httpTrace("context:%p, fd:%d, ip:%s, socket write errno:%d, times:%d", httpDebug("context:%p, fd:%d, ip:%s, socket write errno:%d, times:%d",
pContext, pContext->fd, pContext->ipstr, errno, countWait); pContext, pContext->fd, pContext->ipstr, errno, countWait);
if (++countWait > HTTP_WRITE_RETRY_TIMES) break; if (++countWait > HTTP_WRITE_RETRY_TIMES) break;
taosMsleep(HTTP_WRITE_WAIT_TIME_MS); taosMsleep(HTTP_WRITE_WAIT_TIME_MS);
continue; continue;
} else if (len == 0) { } else if (len == 0) {
httpTrace("context:%p, fd:%d, ip:%s, socket write errno:%d, connect already closed", httpDebug("context:%p, fd:%d, ip:%s, socket write errno:%d, connect already closed",
pContext, pContext->fd, pContext->ipstr, errno); pContext, pContext->fd, pContext->ipstr, errno);
break; break;
} else { } else {
...@@ -76,7 +76,7 @@ int httpWriteBuf(struct HttpContext *pContext, const char *buf, int sz) { ...@@ -76,7 +76,7 @@ int httpWriteBuf(struct HttpContext *pContext, const char *buf, int sz) {
httpError("context:%p, fd:%d, ip:%s, dataSize:%d, writeSize:%d, failed to send response:\n%s", httpError("context:%p, fd:%d, ip:%s, dataSize:%d, writeSize:%d, failed to send response:\n%s",
pContext, pContext->fd, pContext->ipstr, sz, writeSz, buf); pContext, pContext->fd, pContext->ipstr, sz, writeSz, buf);
} else { } else {
httpTrace("context:%p, fd:%d, ip:%s, dataSize:%d, writeSize:%d, response:\n%s", httpDebug("context:%p, fd:%d, ip:%s, dataSize:%d, writeSize:%d, response:\n%s",
pContext, pContext->fd, pContext->ipstr, sz, writeSz, buf); pContext, pContext->fd, pContext->ipstr, sz, writeSz, buf);
} }
...@@ -99,7 +99,7 @@ int httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) { ...@@ -99,7 +99,7 @@ int httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) {
uint64_t srcLen = (uint64_t) (buf->lst - buf->buf); uint64_t srcLen = (uint64_t) (buf->lst - buf->buf);
if (buf->pContext->fd <= 0) { if (buf->pContext->fd <= 0) {
httpTrace("context:%p, fd:%d, ip:%s, write json body error", buf->pContext, buf->pContext->fd, buf->pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, write json body error", buf->pContext, buf->pContext->fd, buf->pContext->ipstr);
buf->pContext->fd = -1; buf->pContext->fd = -1;
} }
...@@ -113,11 +113,11 @@ int httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) { ...@@ -113,11 +113,11 @@ int httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) {
if (buf->pContext->acceptEncoding == HTTP_COMPRESS_IDENTITY) { if (buf->pContext->acceptEncoding == HTTP_COMPRESS_IDENTITY) {
if (buf->lst == buf->buf) { if (buf->lst == buf->buf) {
httpTrace("context:%p, fd:%d, ip:%s, no data need dump", buf->pContext, buf->pContext->fd, buf->pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, no data need dump", buf->pContext, buf->pContext->fd, buf->pContext->ipstr);
return 0; // there is no data to dump. return 0; // there is no data to dump.
} else { } else {
int len = sprintf(sLen, "%lx\r\n", srcLen); int len = sprintf(sLen, "%lx\r\n", srcLen);
httpTrace("context:%p, fd:%d, ip:%s, write body, chunkSize:%" PRIu64 ", response:\n%s", httpDebug("context:%p, fd:%d, ip:%s, write body, chunkSize:%" PRIu64 ", response:\n%s",
buf->pContext, buf->pContext->fd, buf->pContext->ipstr, srcLen, buf->buf); buf->pContext, buf->pContext->fd, buf->pContext->ipstr, srcLen, buf->buf);
httpWriteBufNoTrace(buf->pContext, sLen, len); httpWriteBufNoTrace(buf->pContext, sLen, len);
remain = httpWriteBufNoTrace(buf->pContext, buf->buf, (int) srcLen); remain = httpWriteBufNoTrace(buf->pContext, buf->buf, (int) srcLen);
...@@ -129,12 +129,12 @@ int httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) { ...@@ -129,12 +129,12 @@ int httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) {
if (ret == 0) { if (ret == 0) {
if (compressBufLen > 0) { if (compressBufLen > 0) {
int len = sprintf(sLen, "%x\r\n", compressBufLen); int len = sprintf(sLen, "%x\r\n", compressBufLen);
httpTrace("context:%p, fd:%d, ip:%s, write body, chunkSize:%" PRIu64 ", compressSize:%d, last:%d, response:\n%s", httpDebug("context:%p, fd:%d, ip:%s, write body, chunkSize:%" PRIu64 ", compressSize:%d, last:%d, response:\n%s",
buf->pContext, buf->pContext->fd, buf->pContext->ipstr, srcLen, compressBufLen, isTheLast, buf->buf); buf->pContext, buf->pContext->fd, buf->pContext->ipstr, srcLen, compressBufLen, isTheLast, buf->buf);
httpWriteBufNoTrace(buf->pContext, sLen, len); httpWriteBufNoTrace(buf->pContext, sLen, len);
remain = httpWriteBufNoTrace(buf->pContext, (const char *) compressBuf, (int) compressBufLen); remain = httpWriteBufNoTrace(buf->pContext, (const char *) compressBuf, (int) compressBufLen);
} else { } else {
httpTrace("context:%p, fd:%d, ip:%s, last:%d, compress already dumped, response:\n%s", httpDebug("context:%p, fd:%d, ip:%s, last:%d, compress already dumped, response:\n%s",
buf->pContext, buf->pContext->fd, buf->pContext->ipstr, isTheLast, buf->buf); buf->pContext, buf->pContext->fd, buf->pContext->ipstr, isTheLast, buf->buf);
return 0; // there is no data to dump. return 0; // there is no data to dump.
} }
...@@ -173,7 +173,7 @@ void httpWriteJsonBufHead(JsonBuf* buf) { ...@@ -173,7 +173,7 @@ void httpWriteJsonBufHead(JsonBuf* buf) {
void httpWriteJsonBufEnd(JsonBuf* buf) { void httpWriteJsonBufEnd(JsonBuf* buf) {
if (buf->pContext->fd <= 0) { if (buf->pContext->fd <= 0) {
httpTrace("context:%p, fd:%d, ip:%s, json buf fd is 0", buf->pContext, buf->pContext->fd, buf->pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, json buf fd is 0", buf->pContext, buf->pContext->fd, buf->pContext->ipstr);
buf->pContext->fd = -1; buf->pContext->fd = -1;
} }
...@@ -192,7 +192,7 @@ void httpInitJsonBuf(JsonBuf* buf, struct HttpContext* pContext) { ...@@ -192,7 +192,7 @@ void httpInitJsonBuf(JsonBuf* buf, struct HttpContext* pContext) {
httpGzipCompressInit(buf->pContext); httpGzipCompressInit(buf->pContext);
} }
httpTrace("context:%p, fd:%d, ip:%s, json buffer initialized", buf->pContext, buf->pContext->fd, buf->pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, json buffer initialized", buf->pContext, buf->pContext->fd, buf->pContext->ipstr);
} }
void httpJsonItemToken(JsonBuf* buf) { void httpJsonItemToken(JsonBuf* buf) {
......
...@@ -68,7 +68,7 @@ void httpCleanUpConnect() { ...@@ -68,7 +68,7 @@ void httpCleanUpConnect() {
tfree(pServer->pThreads); tfree(pServer->pThreads);
pServer->pThreads = NULL; pServer->pThreads = NULL;
httpTrace("http server:%s is cleaned up", pServer->label); httpDebug("http server:%s is cleaned up", pServer->label);
} }
bool httpReadDataImp(HttpContext *pContext) { bool httpReadDataImp(HttpContext *pContext) {
...@@ -81,7 +81,7 @@ bool httpReadDataImp(HttpContext *pContext) { ...@@ -81,7 +81,7 @@ bool httpReadDataImp(HttpContext *pContext) {
break; break;
} else if (nread < 0) { } else if (nread < 0) {
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) {
httpTrace("context:%p, fd:%d, ip:%s, read from socket error:%d, wait another event", httpDebug("context:%p, fd:%d, ip:%s, read from socket error:%d, wait another event",
pContext, pContext->fd, pContext->ipstr, errno); pContext, pContext->fd, pContext->ipstr, errno);
break; break;
} else { } else {
...@@ -109,7 +109,7 @@ bool httpReadDataImp(HttpContext *pContext) { ...@@ -109,7 +109,7 @@ bool httpReadDataImp(HttpContext *pContext) {
static bool httpDecompressData(HttpContext *pContext) { static bool httpDecompressData(HttpContext *pContext) {
if (pContext->contentEncoding != HTTP_COMPRESS_GZIP) { if (pContext->contentEncoding != HTTP_COMPRESS_GZIP) {
httpDump("context:%p, fd:%d, ip:%s, content:%s", pContext, pContext->fd, pContext->ipstr, pContext->parser.data.pos); httpTraceDump("context:%p, fd:%d, ip:%s, content:%s", pContext, pContext->fd, pContext->ipstr, pContext->parser.data.pos);
return true; return true;
} }
...@@ -125,7 +125,7 @@ static bool httpDecompressData(HttpContext *pContext) { ...@@ -125,7 +125,7 @@ static bool httpDecompressData(HttpContext *pContext) {
if (ret == 0) { if (ret == 0) {
memcpy(pContext->parser.data.pos, decompressBuf, decompressBufLen); memcpy(pContext->parser.data.pos, decompressBuf, decompressBufLen);
pContext->parser.data.pos[decompressBufLen] = 0; pContext->parser.data.pos[decompressBufLen] = 0;
httpDump("context:%p, fd:%d, ip:%s, rawSize:%d, decompressSize:%d, content:%s", httpTraceDump("context:%p, fd:%d, ip:%s, rawSize:%d, decompressSize:%d, content:%s",
pContext, pContext->fd, pContext->ipstr, pContext->parser.data.len, decompressBufLen, decompressBuf); pContext, pContext->fd, pContext->ipstr, pContext->parser.data.len, decompressBufLen, decompressBuf);
pContext->parser.data.len = decompressBufLen; pContext->parser.data.len = decompressBufLen;
} else { } else {
...@@ -154,10 +154,10 @@ static bool httpReadData(HttpContext *pContext) { ...@@ -154,10 +154,10 @@ static bool httpReadData(HttpContext *pContext) {
int ret = httpCheckReadCompleted(pContext); int ret = httpCheckReadCompleted(pContext);
if (ret == HTTP_CHECK_BODY_CONTINUE) { if (ret == HTTP_CHECK_BODY_CONTINUE) {
//httpTrace("context:%p, fd:%d, ip:%s, not finished yet, wait another event", pContext, pContext->fd, pContext->ipstr); //httpDebug("context:%p, fd:%d, ip:%s, not finished yet, wait another event", pContext, pContext->fd, pContext->ipstr);
return false; return false;
} else if (ret == HTTP_CHECK_BODY_SUCCESS){ } else if (ret == HTTP_CHECK_BODY_SUCCESS){
httpTrace("context:%p, fd:%d, ip:%s, thread:%s, read size:%d, dataLen:%d", httpDebug("context:%p, fd:%d, ip:%s, thread:%s, read size:%d, dataLen:%d",
pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->parser.bufsize, pContext->parser.data.len); pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->parser.bufsize, pContext->parser.data.len);
if (httpDecompressData(pContext)) { if (httpDecompressData(pContext)) {
return true; return true;
...@@ -188,7 +188,7 @@ static void httpProcessHttpData(void *param) { ...@@ -188,7 +188,7 @@ static void httpProcessHttpData(void *param) {
//-1 means uncertainty, 0-nowait, 1-wait 1 ms, set it from -1 to 1 //-1 means uncertainty, 0-nowait, 1-wait 1 ms, set it from -1 to 1
fdNum = epoll_wait(pThread->pollFd, events, HTTP_MAX_EVENTS, 1); fdNum = epoll_wait(pThread->pollFd, events, HTTP_MAX_EVENTS, 1);
if (pThread->stop) { if (pThread->stop) {
httpTrace("%p, http thread get stop event, exiting...", pThread); httpDebug("%p, http thread get stop event, exiting...", pThread);
break; break;
} }
if (fdNum <= 0) continue; if (fdNum <= 0) continue;
...@@ -203,42 +203,42 @@ static void httpProcessHttpData(void *param) { ...@@ -203,42 +203,42 @@ static void httpProcessHttpData(void *param) {
} }
if (events[i].events & EPOLLPRI) { if (events[i].events & EPOLLPRI) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s, EPOLLPRI events occured, accessed:%d, close connect", httpDebug("context:%p, fd:%d, ip:%s, state:%s, EPOLLPRI events occured, accessed:%d, close connect",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes);
httpCloseContextByServer(pContext); httpCloseContextByServer(pContext);
continue; continue;
} }
if (events[i].events & EPOLLRDHUP) { if (events[i].events & EPOLLRDHUP) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s, EPOLLRDHUP events occured, accessed:%d, close connect", httpDebug("context:%p, fd:%d, ip:%s, state:%s, EPOLLRDHUP events occured, accessed:%d, close connect",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes);
httpCloseContextByServer(pContext); httpCloseContextByServer(pContext);
continue; continue;
} }
if (events[i].events & EPOLLERR) { if (events[i].events & EPOLLERR) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s, EPOLLERR events occured, accessed:%d, close connect", httpDebug("context:%p, fd:%d, ip:%s, state:%s, EPOLLERR events occured, accessed:%d, close connect",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes);
httpCloseContextByServer(pContext); httpCloseContextByServer(pContext);
continue; continue;
} }
if (events[i].events & EPOLLHUP) { if (events[i].events & EPOLLHUP) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s, EPOLLHUP events occured, accessed:%d, close connect", httpDebug("context:%p, fd:%d, ip:%s, state:%s, EPOLLHUP events occured, accessed:%d, close connect",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes);
httpCloseContextByServer(pContext); httpCloseContextByServer(pContext);
continue; continue;
} }
if (!httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_READY)) { if (!httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_READY)) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s, not in ready state, ignore read events", httpDebug("context:%p, fd:%d, ip:%s, state:%s, not in ready state, ignore read events",
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state)); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state));
httpReleaseContext(pContext); httpReleaseContext(pContext);
continue; continue;
} }
if (pServer->status != HTTP_SERVER_RUNNING) { if (pServer->status != HTTP_SERVER_RUNNING) {
httpTrace("context:%p, fd:%d, ip:%s, state:%s, server is not running, accessed:%d, close connect", pContext, httpDebug("context:%p, fd:%d, ip:%s, state:%s, server is not running, accessed:%d, close connect", pContext,
pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes); pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->accessTimes);
httpSendErrorResp(pContext, HTTP_SERVER_OFFLINE); httpSendErrorResp(pContext, HTTP_SERVER_OFFLINE);
httpNotifyContextClose(pContext); httpNotifyContextClose(pContext);
...@@ -273,7 +273,7 @@ static void *httpAcceptHttpConnection(void *arg) { ...@@ -273,7 +273,7 @@ static void *httpAcceptHttpConnection(void *arg) {
taosIpStr(pServer->serverIp), pServer->serverPort, strerror(errno)); taosIpStr(pServer->serverIp), pServer->serverPort, strerror(errno));
return NULL; return NULL;
} else { } else {
httpPrint("http server init success at %u", pServer->serverPort); httpInfo("http server init success at %u", pServer->serverPort);
pServer->status = HTTP_SERVER_RUNNING; pServer->status = HTTP_SERVER_RUNNING;
} }
...@@ -282,7 +282,7 @@ static void *httpAcceptHttpConnection(void *arg) { ...@@ -282,7 +282,7 @@ static void *httpAcceptHttpConnection(void *arg) {
connFd = (int)accept(pServer->fd, (struct sockaddr *)&clientAddr, &addrlen); connFd = (int)accept(pServer->fd, (struct sockaddr *)&clientAddr, &addrlen);
if (connFd == -1) { if (connFd == -1) {
if (errno == EINVAL) { if (errno == EINVAL) {
httpTrace("http server:%s socket was shutdown, exiting...", pServer->label); httpDebug("http server:%s socket was shutdown, exiting...", pServer->label);
break; break;
} }
httpError("http server:%s, accept connect failure, errno:%d reason:%s", pServer->label, errno, strerror(errno)); httpError("http server:%s, accept connect failure, errno:%d reason:%s", pServer->label, errno, strerror(errno));
...@@ -331,7 +331,7 @@ static void *httpAcceptHttpConnection(void *arg) { ...@@ -331,7 +331,7 @@ static void *httpAcceptHttpConnection(void *arg) {
// notify the data process, add into the FdObj list // notify the data process, add into the FdObj list
atomic_add_fetch_32(&pThread->numOfFds, 1); atomic_add_fetch_32(&pThread->numOfFds, 1);
httpTrace("context:%p, fd:%d, ip:%s, thread:%s numOfFds:%d totalFds:%d, accept a new connection", pContext, connFd, httpDebug("context:%p, fd:%d, ip:%s, thread:%s numOfFds:%d totalFds:%d, accept a new connection", pContext, connFd,
pContext->ipstr, pThread->label, pThread->numOfFds, totalFds); pContext->ipstr, pThread->label, pThread->numOfFds, totalFds);
// pick up next thread for next connection // pick up next thread for next connection
...@@ -378,7 +378,7 @@ bool httpInitConnect() { ...@@ -378,7 +378,7 @@ bool httpInitConnect() {
} }
pthread_attr_destroy(&thattr); pthread_attr_destroy(&thattr);
httpTrace("http thread:%p:%s, initialized", pThread, pThread->label); httpDebug("http thread:%p:%s, initialized", pThread, pThread->label);
pThread++; pThread++;
} }
...@@ -391,7 +391,7 @@ bool httpInitConnect() { ...@@ -391,7 +391,7 @@ bool httpInitConnect() {
} }
pthread_attr_destroy(&thattr); pthread_attr_destroy(&thattr);
httpTrace("http server:%s, initialized, ip:%s:%u, numOfThreads:%d", pServer->label, taosIpStr(pServer->serverIp), httpDebug("http server:%s, initialized, ip:%s:%u, numOfThreads:%d", pServer->label, taosIpStr(pServer->serverIp),
pServer->serverPort, pServer->numOfThreads); pServer->serverPort, pServer->numOfThreads);
return true; return true;
} }
...@@ -47,7 +47,7 @@ void httpCreateSession(HttpContext *pContext, void *taos) { ...@@ -47,7 +47,7 @@ void httpCreateSession(HttpContext *pContext, void *taos) {
return; return;
} }
httpTrace("context:%p, fd:%d, ip:%s, user:%s, create a new session:%p:%p sessionRef:%d", pContext, pContext->fd, httpDebug("context:%p, fd:%d, ip:%s, user:%s, create a new session:%p:%p sessionRef:%d", pContext, pContext->fd,
pContext->ipstr, pContext->user, pContext->session, pContext->session->taos, pContext->session->refCount); pContext->ipstr, pContext->user, pContext->session, pContext->session->taos, pContext->session->refCount);
pthread_mutex_unlock(&server->serverMutex); pthread_mutex_unlock(&server->serverMutex);
} }
...@@ -62,10 +62,10 @@ static void httpFetchSessionImp(HttpContext *pContext) { ...@@ -62,10 +62,10 @@ static void httpFetchSessionImp(HttpContext *pContext) {
pContext->session = taosCacheAcquireByName(server->sessionCache, sessionId); pContext->session = taosCacheAcquireByName(server->sessionCache, sessionId);
if (pContext->session != NULL) { if (pContext->session != NULL) {
atomic_add_fetch_32(&pContext->session->refCount, 1); atomic_add_fetch_32(&pContext->session->refCount, 1);
httpTrace("context:%p, fd:%d, ip:%s, user:%s, find an exist session:%p:%p, sessionRef:%d", pContext, pContext->fd, httpDebug("context:%p, fd:%d, ip:%s, user:%s, find an exist session:%p:%p, sessionRef:%d", pContext, pContext->fd,
pContext->ipstr, pContext->user, pContext->session, pContext->session->taos, pContext->session->refCount); pContext->ipstr, pContext->user, pContext->session, pContext->session->taos, pContext->session->refCount);
} else { } else {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, session not found", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, session not found", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
} }
...@@ -88,7 +88,7 @@ void httpReleaseSession(HttpContext *pContext) { ...@@ -88,7 +88,7 @@ void httpReleaseSession(HttpContext *pContext) {
int32_t refCount = atomic_sub_fetch_32(&pContext->session->refCount, 1); int32_t refCount = atomic_sub_fetch_32(&pContext->session->refCount, 1);
assert(refCount >= 0); assert(refCount >= 0);
httpTrace("context:%p, release session:%p:%p, sessionRef:%d", pContext, pContext->session, pContext->session->taos, httpDebug("context:%p, release session:%p:%p, sessionRef:%d", pContext, pContext->session, pContext->session->taos,
pContext->session->refCount); pContext->session->refCount);
taosCacheRelease(tsHttpServer.sessionCache, (void **)&pContext->session, false); taosCacheRelease(tsHttpServer.sessionCache, (void **)&pContext->session, false);
...@@ -97,7 +97,7 @@ void httpReleaseSession(HttpContext *pContext) { ...@@ -97,7 +97,7 @@ void httpReleaseSession(HttpContext *pContext) {
static void httpDestroySession(void *data) { static void httpDestroySession(void *data) {
HttpSession *session = data; HttpSession *session = data;
httpTrace("session:%p:%p, is destroyed, sessionRef:%d", session, session->taos, session->refCount); httpDebug("session:%p:%p, is destroyed, sessionRef:%d", session, session->taos, session->refCount);
if (session->taos != NULL) { if (session->taos != NULL) {
taos_close(session->taos); taos_close(session->taos);
...@@ -108,7 +108,7 @@ static void httpDestroySession(void *data) { ...@@ -108,7 +108,7 @@ static void httpDestroySession(void *data) {
void httpCleanUpSessions() { void httpCleanUpSessions() {
if (tsHttpServer.sessionCache != NULL) { if (tsHttpServer.sessionCache != NULL) {
SCacheObj *cache = tsHttpServer.sessionCache; SCacheObj *cache = tsHttpServer.sessionCache;
httpPrint("session cache is cleanuping, size:%zu", taosHashGetSize(cache->pHashTable)); httpInfo("session cache is cleanuping, size:%zu", taosHashGetSize(cache->pHashTable));
taosCacheCleanup(tsHttpServer.sessionCache); taosCacheCleanup(tsHttpServer.sessionCache);
tsHttpServer.sessionCache = NULL; tsHttpServer.sessionCache = NULL;
} }
......
此差异已折叠。
...@@ -60,7 +60,7 @@ int httpInitSystem() { ...@@ -60,7 +60,7 @@ int httpInitSystem() {
} }
int httpStartSystem() { int httpStartSystem() {
httpPrint("start http server ..."); httpInfo("start http server ...");
if (tsHttpServer.status != HTTP_SERVER_INIT) { if (tsHttpServer.status != HTTP_SERVER_INIT) {
httpError("http server is already started"); httpError("http server is already started");
...@@ -92,7 +92,7 @@ void httpStopSystem() { ...@@ -92,7 +92,7 @@ void httpStopSystem() {
} }
void httpCleanUpSystem() { void httpCleanUpSystem() {
httpPrint("http server cleanup"); httpInfo("http server cleanup");
httpStopSystem(); httpStopSystem();
httpCleanupContexts(); httpCleanupContexts();
......
...@@ -80,14 +80,14 @@ bool restGetPassFromUrl(HttpContext* pContext) { ...@@ -80,14 +80,14 @@ bool restGetPassFromUrl(HttpContext* pContext) {
} }
bool restProcessLoginRequest(HttpContext* pContext) { bool restProcessLoginRequest(HttpContext* pContext) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, process restful login msg", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, process restful login msg", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
pContext->reqType = HTTP_REQTYPE_LOGIN; pContext->reqType = HTTP_REQTYPE_LOGIN;
return true; return true;
} }
bool restProcessSqlRequest(HttpContext* pContext, int timestampFmt) { bool restProcessSqlRequest(HttpContext* pContext, int timestampFmt) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, process restful sql msg", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, process restful sql msg", pContext, pContext->fd, pContext->ipstr,
pContext->user); pContext->user);
char* sql = pContext->parser.data.pos; char* sql = pContext->parser.data.pos;
......
...@@ -151,7 +151,7 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, ...@@ -151,7 +151,7 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
} }
if (cmd->numOfRows >= tsRestRowLimit) { if (cmd->numOfRows >= tsRestRowLimit) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, retrieve rows:%d larger than limit:%d, abort retrieve", pContext, httpDebug("context:%p, fd:%d, ip:%s, user:%s, retrieve rows:%d larger than limit:%d, abort retrieve", pContext,
pContext->fd, pContext->ipstr, pContext->user, cmd->numOfRows, tsRestRowLimit); pContext->fd, pContext->ipstr, pContext->user, cmd->numOfRows, tsRestRowLimit);
return false; return false;
} }
...@@ -162,7 +162,7 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, ...@@ -162,7 +162,7 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
return false; return false;
} }
else { else {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, total rows:%d retrieved", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, user:%s, total rows:%d retrieved", pContext, pContext->fd, pContext->ipstr,
pContext->user, cmd->numOfRows); pContext->user, cmd->numOfRows);
return true; return true;
} }
......
...@@ -266,7 +266,7 @@ int tgReadSchema(char *fileName) { ...@@ -266,7 +266,7 @@ int tgReadSchema(char *fileName) {
return -1; return -1;
} }
httpPrint("open telegraf schema file:%s success", fileName); httpInfo("open telegraf schema file:%s success", fileName);
fseek(fp, 0, SEEK_END); fseek(fp, 0, SEEK_END);
int32_t contentSize = (int32_t)ftell(fp); int32_t contentSize = (int32_t)ftell(fp);
if (contentSize <= 0) { if (contentSize <= 0) {
...@@ -290,7 +290,7 @@ int tgReadSchema(char *fileName) { ...@@ -290,7 +290,7 @@ int tgReadSchema(char *fileName) {
free(content); free(content);
fclose(fp); fclose(fp);
httpPrint("parse telegraf schema file:%s, schema size:%d", fileName, schemaNum); httpInfo("parse telegraf schema file:%s, schema size:%d", fileName, schemaNum);
return schemaNum; return schemaNum;
} }
...@@ -800,7 +800,7 @@ bool tgProcessSingleMetric(HttpContext *pContext, cJSON *metric, char *db) { ...@@ -800,7 +800,7 @@ bool tgProcessSingleMetric(HttpContext *pContext, cJSON *metric, char *db) {
} }
*/ */
bool tgProcessQueryRequest(HttpContext *pContext, char *db) { bool tgProcessQueryRequest(HttpContext *pContext, char *db) {
httpTrace("context:%p, fd:%d, ip:%s, process telegraf query msg", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, process telegraf query msg", pContext, pContext->fd, pContext->ipstr);
HttpParser *pParser = &pContext->parser; HttpParser *pParser = &pContext->parser;
char * filter = pParser->data.pos; char * filter = pParser->data.pos;
...@@ -818,7 +818,7 @@ bool tgProcessQueryRequest(HttpContext *pContext, char *db) { ...@@ -818,7 +818,7 @@ bool tgProcessQueryRequest(HttpContext *pContext, char *db) {
cJSON *metrics = cJSON_GetObjectItem(root, "metrics"); cJSON *metrics = cJSON_GetObjectItem(root, "metrics");
if (metrics != NULL) { if (metrics != NULL) {
int size = cJSON_GetArraySize(metrics); int size = cJSON_GetArraySize(metrics);
httpTrace("context:%p, fd:%d, ip:%s, multiple metrics:%d at one time", pContext, pContext->fd, pContext->ipstr, httpDebug("context:%p, fd:%d, ip:%s, multiple metrics:%d at one time", pContext, pContext->fd, pContext->ipstr,
size); size);
if (size <= 0) { if (size <= 0) {
httpSendErrorResp(pContext, HTTP_TG_METRICS_NULL); httpSendErrorResp(pContext, HTTP_TG_METRICS_NULL);
...@@ -859,7 +859,7 @@ bool tgProcessQueryRequest(HttpContext *pContext, char *db) { ...@@ -859,7 +859,7 @@ bool tgProcessQueryRequest(HttpContext *pContext, char *db) {
} }
} }
} else { } else {
httpTrace("context:%p, fd:%d, ip:%s, single metric", pContext, pContext->fd, pContext->ipstr); httpDebug("context:%p, fd:%d, ip:%s, single metric", pContext, pContext->fd, pContext->ipstr);
if (!httpMallocMultiCmds(pContext, 3, HTTP_BUFFER_SIZE)) { if (!httpMallocMultiCmds(pContext, 3, HTTP_BUFFER_SIZE)) {
httpSendErrorResp(pContext, HTTP_NO_ENOUGH_MEMORY); httpSendErrorResp(pContext, HTTP_NO_ENOUGH_MEMORY);
......
此差异已折叠。
此差异已折叠。
...@@ -43,7 +43,7 @@ char* converJsonToSql(char* json, char* _dbname, char* _tablename) { ...@@ -43,7 +43,7 @@ char* converJsonToSql(char* json, char* _dbname, char* _tablename) {
{ {
cJSON* item = cJSON_GetArrayItem(jPlayload, i); cJSON* item = cJSON_GetArrayItem(jPlayload, i);
if (cJSON_Object == item->type) { if (cJSON_Object == item->type) {
mqttPrint("The item '%s' is not supported", item->string); mqttInfo("The item '%s' is not supported", item->string);
} else { } else {
strcat(_names, item->string); strcat(_names, item->string);
if (i < count - 1) { if (i < count - 1) {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -114,7 +114,7 @@ SKVStore *tdOpenKVStore(char *fname, iterFunc iFunc, afterFunc aFunc, void *appH ...@@ -114,7 +114,7 @@ SKVStore *tdOpenKVStore(char *fname, iterFunc iFunc, afterFunc aFunc, void *appH
goto _err; goto _err;
} }
} else { } else {
uTrace("file %s exists, try to recover the KV store", pStore->fsnap); uDebug("file %s exists, try to recover the KV store", pStore->fsnap);
if (tdLoadKVStoreHeader(pStore->sfd, pStore->fsnap, &info) < 0) { if (tdLoadKVStoreHeader(pStore->sfd, pStore->fsnap, &info) < 0) {
if (terrno != TSDB_CODE_COM_FILE_CORRUPTED) goto _err; if (terrno != TSDB_CODE_COM_FILE_CORRUPTED) goto _err;
} else { } else {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册