tcs/dnode: use tcs interface for dnode
This commit is contained in:
parent
c5b4cc760b
commit
09cf91f256
|
@ -306,6 +306,7 @@ char tsS3AppId[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {"<appid>"};
|
||||||
int8_t tsS3Enabled = false;
|
int8_t tsS3Enabled = false;
|
||||||
int8_t tsS3EnabledCfg = false;
|
int8_t tsS3EnabledCfg = false;
|
||||||
int8_t tsS3Oss[TSDB_MAX_EP_NUM] = {false};
|
int8_t tsS3Oss[TSDB_MAX_EP_NUM] = {false};
|
||||||
|
int8_t tsS3Ablob = false;
|
||||||
int8_t tsS3StreamEnabled = false;
|
int8_t tsS3StreamEnabled = false;
|
||||||
|
|
||||||
int8_t tsS3Https[TSDB_MAX_EP_NUM] = {true};
|
int8_t tsS3Https[TSDB_MAX_EP_NUM] = {true};
|
||||||
|
@ -322,7 +323,6 @@ int32_t tsMaxTsmaNum = 3;
|
||||||
int32_t tsMaxTsmaCalcDelay = 600;
|
int32_t tsMaxTsmaCalcDelay = 600;
|
||||||
int64_t tsmaDataDeleteMark = 1000 * 60 * 60 * 24; // in ms, default to 1d
|
int64_t tsmaDataDeleteMark = 1000 * 60 * 60 * 24; // in ms, default to 1d
|
||||||
|
|
||||||
|
|
||||||
#define TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, pName) \
|
#define TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, pName) \
|
||||||
if ((pItem = cfgGetItem(pCfg, pName)) == NULL) { \
|
if ((pItem = cfgGetItem(pCfg, pName)) == NULL) { \
|
||||||
TAOS_RETURN(TSDB_CODE_CFG_NOT_FOUND); \
|
TAOS_RETURN(TSDB_CODE_CFG_NOT_FOUND); \
|
||||||
|
@ -435,6 +435,7 @@ int32_t taosSetS3Cfg(SConfig *pCfg) {
|
||||||
}
|
}
|
||||||
tsS3Https[i] = (strstr(tsS3Endpoint[i], "https://") != NULL);
|
tsS3Https[i] = (strstr(tsS3Endpoint[i], "https://") != NULL);
|
||||||
tsS3Oss[i] = (strstr(tsS3Endpoint[i], "aliyuncs.") != NULL);
|
tsS3Oss[i] = (strstr(tsS3Endpoint[i], "aliyuncs.") != NULL);
|
||||||
|
tsS3Ablob = (strstr(tsS3Endpoint[i], ".blob.core.windows.net") != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsS3BucketName[0] != '<') {
|
if (tsS3BucketName[0] != '<') {
|
||||||
|
@ -450,7 +451,9 @@ int32_t taosSetS3Cfg(SConfig *pCfg) {
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SConfig *taosGetCfg() { return tsCfg; }
|
struct SConfig *taosGetCfg() {
|
||||||
|
return tsCfg;
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *inputCfgDir, const char *envFile,
|
static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *inputCfgDir, const char *envFile,
|
||||||
char *apolloUrl) {
|
char *apolloUrl) {
|
||||||
|
@ -572,7 +575,8 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
||||||
TAOS_CHECK_RETURN(
|
TAOS_CHECK_RETURN(
|
||||||
cfgAddInt32(pCfg, "compressMsgSize", tsCompressMsgSize, -1, 100000000, CFG_SCOPE_BOTH, CFG_DYN_CLIENT));
|
cfgAddInt32(pCfg, "compressMsgSize", tsCompressMsgSize, -1, 100000000, CFG_SCOPE_BOTH, CFG_DYN_CLIENT));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "queryPolicy", tsQueryPolicy, 1, 4, CFG_SCOPE_CLIENT, CFG_DYN_ENT_CLIENT));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "queryPolicy", tsQueryPolicy, 1, 4, CFG_SCOPE_CLIENT, CFG_DYN_ENT_CLIENT));
|
||||||
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "queryTableNotExistAsEmpty", tsQueryTbNotExistAsEmpty, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
TAOS_CHECK_RETURN(
|
||||||
|
cfgAddBool(pCfg, "queryTableNotExistAsEmpty", tsQueryTbNotExistAsEmpty, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
||||||
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "enableQueryHb", tsEnableQueryHb, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "enableQueryHb", tsEnableQueryHb, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
||||||
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "enableScience", tsEnableScience, CFG_SCOPE_CLIENT, CFG_DYN_NONE));
|
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "enableScience", tsEnableScience, CFG_SCOPE_CLIENT, CFG_DYN_NONE));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "querySmaOptimize", tsQuerySmaOptimize, 0, 1, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "querySmaOptimize", tsQuerySmaOptimize, 0, 1, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
||||||
|
@ -600,7 +604,8 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
||||||
TAOS_CHECK_RETURN(
|
TAOS_CHECK_RETURN(
|
||||||
cfgAddInt32(pCfg, "metaCacheMaxSize", tsMetaCacheMaxSize, -1, INT32_MAX, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
cfgAddInt32(pCfg, "metaCacheMaxSize", tsMetaCacheMaxSize, -1, INT32_MAX, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "randErrorChance", tsRandErrChance, 0, 10000, CFG_SCOPE_BOTH, CFG_DYN_BOTH));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "randErrorChance", tsRandErrChance, 0, 10000, CFG_SCOPE_BOTH, CFG_DYN_BOTH));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "randErrorDivisor", tsRandErrDivisor, 1, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_BOTH));
|
TAOS_CHECK_RETURN(
|
||||||
|
cfgAddInt64(pCfg, "randErrorDivisor", tsRandErrDivisor, 1, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_BOTH));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "randErrorScope", tsRandErrScope, 0, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_BOTH));
|
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "randErrorScope", tsRandErrScope, 0, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_BOTH));
|
||||||
|
|
||||||
tsNumOfRpcThreads = tsNumOfCores / 2;
|
tsNumOfRpcThreads = tsNumOfCores / 2;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "jemalloc/jemalloc.h"
|
#include "jemalloc/jemalloc.h"
|
||||||
#endif
|
#endif
|
||||||
#include "dmUtil.h"
|
#include "dmUtil.h"
|
||||||
|
#include "tcs.h"
|
||||||
|
|
||||||
#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
|
#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
|
||||||
#include "cus_name.h"
|
#include "cus_name.h"
|
||||||
|
@ -325,10 +326,9 @@ static int32_t dmCheckS3() {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
SConfig *pCfg = taosGetCfg();
|
SConfig *pCfg = taosGetCfg();
|
||||||
cfgDumpCfgS3(pCfg, 0, true);
|
cfgDumpCfgS3(pCfg, 0, true);
|
||||||
#if defined(USE_S3)
|
|
||||||
extern int32_t s3CheckCfg();
|
|
||||||
|
|
||||||
code = s3CheckCfg();
|
#if defined(USE_S3)
|
||||||
|
code = tcsCheckCfg();
|
||||||
#endif
|
#endif
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
aux_source_directory(src IMPLEMENT_SRC)
|
aux_source_directory(src IMPLEMENT_SRC)
|
||||||
add_library(dnode STATIC ${IMPLEMENT_SRC})
|
add_library(dnode STATIC ${IMPLEMENT_SRC})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
dnode mgmt_mnode mgmt_qnode mgmt_snode mgmt_vnode mgmt_dnode monitorfw
|
dnode mgmt_mnode mgmt_qnode mgmt_snode mgmt_vnode mgmt_dnode monitorfw tcs
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (TD_ENTERPRISE)
|
IF (TD_ENTERPRISE)
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "libs/function/tudf.h"
|
#include "libs/function/tudf.h"
|
||||||
#include "tgrant.h"
|
#include "tgrant.h"
|
||||||
#include "tcompare.h"
|
#include "tcompare.h"
|
||||||
|
#include "tcs.h"
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#define DM_INIT_AUDIT() \
|
#define DM_INIT_AUDIT() \
|
||||||
|
@ -162,13 +163,6 @@ static int32_t dmCheckDataDirVersionWrapper() {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if defined(USE_S3)
|
|
||||||
|
|
||||||
extern int32_t s3Begin();
|
|
||||||
extern void s3End();
|
|
||||||
extern int8_t tsS3Enabled;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int32_t dmInit() {
|
int32_t dmInit() {
|
||||||
dInfo("start to init dnode env");
|
dInfo("start to init dnode env");
|
||||||
|
@ -186,7 +180,7 @@ int32_t dmInit() {
|
||||||
if ((code = dmInitDnode(dmInstance())) != 0) return code;
|
if ((code = dmInitDnode(dmInstance())) != 0) return code;
|
||||||
if ((code = InitRegexCache() != 0)) return code;
|
if ((code = InitRegexCache() != 0)) return code;
|
||||||
#if defined(USE_S3)
|
#if defined(USE_S3)
|
||||||
if ((code = s3Begin()) != 0) return code;
|
if ((code = tcsInit()) != 0) return code;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dInfo("dnode env is initialized");
|
dInfo("dnode env is initialized");
|
||||||
|
@ -219,7 +213,7 @@ void dmCleanup() {
|
||||||
DestroyRegexCache();
|
DestroyRegexCache();
|
||||||
|
|
||||||
#if defined(USE_S3)
|
#if defined(USE_S3)
|
||||||
s3End();
|
tcsUninit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dInfo("dnode env is cleaned up");
|
dInfo("dnode env is cleaned up");
|
||||||
|
|
Loading…
Reference in New Issue