Merge branch '3.0' into fix/TD-29904-3.0
This commit is contained in:
commit
3528c3c280
|
@ -30,6 +30,11 @@ static tb_uid_t processSuid(tb_uid_t suid, char* db) { return suid + MurmurHash3
|
|||
|
||||
static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* schemaTag, char* name, int64_t id,
|
||||
int8_t t, SColCmprWrapper* pColCmprRow) {
|
||||
int8_t buildDefaultCompress = 0;
|
||||
if (pColCmprRow->nCols <= 0) {
|
||||
buildDefaultCompress = 1;
|
||||
}
|
||||
|
||||
char* string = NULL;
|
||||
cJSON* json = cJSON_CreateObject();
|
||||
if (json == NULL) {
|
||||
|
@ -70,13 +75,20 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
|
|||
cJSON_AddItemToObject(column, "isPrimarykey", isPk);
|
||||
cJSON_AddItemToArray(columns, column);
|
||||
|
||||
if (pColCmprRow == NULL || pColCmprRow->nCols <= i) {
|
||||
if (pColCmprRow == NULL) {
|
||||
continue;
|
||||
}
|
||||
SColCmpr* pColCmpr = pColCmprRow->pColCmpr + i;
|
||||
const char* encode = columnEncodeStr(COMPRESS_L1_TYPE_U32(pColCmpr->alg));
|
||||
const char* compress = columnCompressStr(COMPRESS_L2_TYPE_U32(pColCmpr->alg));
|
||||
const char* level = columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(pColCmpr->alg));
|
||||
|
||||
uint32_t alg = 0;
|
||||
if (buildDefaultCompress) {
|
||||
alg = createDefaultColCmprByType(s->type);
|
||||
} else {
|
||||
SColCmpr* pColCmpr = pColCmprRow->pColCmpr + i;
|
||||
alg = pColCmpr->alg;
|
||||
}
|
||||
const char* encode = columnEncodeStr(COMPRESS_L1_TYPE_U32(alg));
|
||||
const char* compress = columnCompressStr(COMPRESS_L2_TYPE_U32(alg));
|
||||
const char* level = columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(alg));
|
||||
|
||||
cJSON* encodeJson = cJSON_CreateString(encode);
|
||||
cJSON_AddItemToObject(column, "encode", encodeJson);
|
||||
|
@ -767,14 +779,25 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
|
|||
code = TSDB_CODE_INVALID_PARA;
|
||||
goto end;
|
||||
}
|
||||
|
||||
int8_t createDefaultCompress = 0;
|
||||
SColCmprWrapper* p = &req.colCmpr;
|
||||
if (p->nCols == 0) {
|
||||
createDefaultCompress = 1;
|
||||
}
|
||||
// build create stable
|
||||
pReq.pColumns = taosArrayInit(req.schemaRow.nCols, sizeof(SFieldWithOptions));
|
||||
for (int32_t i = 0; i < req.schemaRow.nCols; i++) {
|
||||
SSchema* pSchema = req.schemaRow.pSchema + i;
|
||||
SFieldWithOptions field = {.type = pSchema->type, .flags = pSchema->flags, .bytes = pSchema->bytes};
|
||||
strcpy(field.name, pSchema->name);
|
||||
SColCmpr *p = &req.colCmpr.pColCmpr[i];
|
||||
field.compress = p->alg;
|
||||
|
||||
if (createDefaultCompress) {
|
||||
field.compress = createDefaultColCmprByType(pSchema->type);
|
||||
} else {
|
||||
SColCmpr* p = &req.colCmpr.pColCmpr[i];
|
||||
field.compress = p->alg;
|
||||
}
|
||||
taosArrayPush(pReq.pColumns, &field);
|
||||
}
|
||||
pReq.pTags = taosArrayInit(req.schemaTag.nCols, sizeof(SField));
|
||||
|
|
|
@ -27,6 +27,8 @@ static S3UriStyle uriStyleG = S3UriStylePath;
|
|||
static int retriesG = 5;
|
||||
static int timeoutMsG = 0;
|
||||
|
||||
extern int8_t tsS3Oss;
|
||||
|
||||
int32_t s3Begin() {
|
||||
S3Status status;
|
||||
const char *hostname = tsS3Hostname;
|
||||
|
@ -42,6 +44,9 @@ int32_t s3Begin() {
|
|||
}
|
||||
|
||||
protocolG = !tsS3Https;
|
||||
if (tsS3Oss) {
|
||||
uriStyleG = S3UriStyleVirtualHost;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -32,22 +32,22 @@
|
|||
SConfig *tsCfg = NULL;
|
||||
|
||||
// cluster
|
||||
char tsFirst[TSDB_EP_LEN] = {0};
|
||||
char tsSecond[TSDB_EP_LEN] = {0};
|
||||
char tsLocalFqdn[TSDB_FQDN_LEN] = {0};
|
||||
char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port
|
||||
char tsVersionName[16] = "community";
|
||||
uint16_t tsServerPort = 6030;
|
||||
int32_t tsVersion = 30000000;
|
||||
int32_t tsStatusInterval = 1; // second
|
||||
int32_t tsNumOfSupportVnodes = 256;
|
||||
char tsEncryptAlgorithm[16] = {0};
|
||||
char tsEncryptScope[100] = {0};
|
||||
EEncryptAlgor tsiEncryptAlgorithm = 0;
|
||||
EEncryptScope tsiEncryptScope = 0;
|
||||
//char tsAuthCode[500] = {0};
|
||||
//char tsEncryptKey[17] = {0};
|
||||
char tsEncryptKey[17] = {0};
|
||||
char tsFirst[TSDB_EP_LEN] = {0};
|
||||
char tsSecond[TSDB_EP_LEN] = {0};
|
||||
char tsLocalFqdn[TSDB_FQDN_LEN] = {0};
|
||||
char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port
|
||||
char tsVersionName[16] = "community";
|
||||
uint16_t tsServerPort = 6030;
|
||||
int32_t tsVersion = 30000000;
|
||||
int32_t tsStatusInterval = 1; // second
|
||||
int32_t tsNumOfSupportVnodes = 256;
|
||||
char tsEncryptAlgorithm[16] = {0};
|
||||
char tsEncryptScope[100] = {0};
|
||||
EEncryptAlgor tsiEncryptAlgorithm = 0;
|
||||
EEncryptScope tsiEncryptScope = 0;
|
||||
// char tsAuthCode[500] = {0};
|
||||
// char tsEncryptKey[17] = {0};
|
||||
char tsEncryptKey[17] = {0};
|
||||
|
||||
// common
|
||||
int32_t tsMaxShellConns = 50000;
|
||||
|
@ -296,6 +296,7 @@ char tsS3AccessKeySecret[TSDB_FQDN_LEN] = "<accesskeysecrect>";
|
|||
char tsS3BucketName[TSDB_FQDN_LEN] = "<bucketname>";
|
||||
char tsS3AppId[TSDB_FQDN_LEN] = "<appid>";
|
||||
int8_t tsS3Enabled = false;
|
||||
int8_t tsS3Oss = false;
|
||||
int8_t tsS3StreamEnabled = false;
|
||||
|
||||
int8_t tsS3Https = true;
|
||||
|
@ -310,7 +311,7 @@ bool tsExperimental = true;
|
|||
|
||||
int32_t tsMaxTsmaNum = 3;
|
||||
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
|
||||
|
||||
#ifndef _STORAGE
|
||||
int32_t taosSetTfsCfg(SConfig *pCfg) {
|
||||
|
@ -366,6 +367,10 @@ int32_t taosSetS3Cfg(SConfig *pCfg) {
|
|||
tstrncpy(tsS3AppId, appid + 1, TSDB_FQDN_LEN);
|
||||
}
|
||||
}
|
||||
char *oss = strstr(tsS3Endpoint, "aliyuncs.");
|
||||
if (oss) {
|
||||
tsS3Oss = true;
|
||||
}
|
||||
if (tsS3BucketName[0] != '<') {
|
||||
#if defined(USE_COS) || defined(USE_S3)
|
||||
#ifdef TD_ENTERPRISE
|
||||
|
@ -563,11 +568,12 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
|||
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, CFG_SCOPE_BOTH, CFG_DYN_BOTH) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags, CFG_SCOPE_CLIENT,
|
||||
CFG_DYN_CLIENT) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "countAlwaysReturnValue", tsCountAlwaysReturnValue, 0, 1, CFG_SCOPE_BOTH, CFG_DYN_CLIENT) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "maxTsmaCalcDelay", tsMaxTsmaCalcDelay, 600, 86400, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) !=
|
||||
0)
|
||||
if (cfgAddInt32(pCfg, "maxTsmaCalcDelay", tsMaxTsmaCalcDelay, 600, 86400, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "tsmaDataDeleteMark", tsmaDataDeleteMark, 60 * 60 * 1000, INT64_MAX, CFG_SCOPE_CLIENT,
|
||||
CFG_DYN_CLIENT) != 0)
|
||||
|
@ -618,11 +624,12 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
|
||||
tsNumOfSupportVnodes = tsNumOfCores * 2;
|
||||
tsNumOfSupportVnodes = TMAX(tsNumOfSupportVnodes, 2);
|
||||
if (cfgAddInt32(pCfg, "supportVnodes", tsNumOfSupportVnodes, 0, 4096, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "supportVnodes", tsNumOfSupportVnodes, 0, 4096, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0)
|
||||
return -1;
|
||||
|
||||
if (cfgAddString(pCfg, "encryptAlgorithm", tsEncryptAlgorithm, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddString(pCfg, "encryptScope", tsEncryptScope, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
//if (cfgAddString(pCfg, "authCode", tsAuthCode, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
// if (cfgAddString(pCfg, "authCode", tsAuthCode, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "statusInterval", tsStatusInterval, 1, 30, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "minSlidingTime", tsMinSlidingTime, 1, 1000000, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0)
|
||||
|
@ -749,8 +756,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddInt32(pCfg, "tmqMaxTopicNum", tmqMaxTopicNum, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0)
|
||||
return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "tmqRowSize", tmqRowSize, 1, 1000000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "tmqRowSize", tmqRowSize, 1, 1000000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "maxTsmaNum", tsMaxTsmaNum, 0, 3, CFG_SCOPE_SERVER, CFG_DYN_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
||||
|
@ -1181,7 +1187,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsQueryBufferSize = cfgGetItem(pCfg, "queryBufferSize")->i32;
|
||||
tstrncpy(tsEncryptAlgorithm, cfgGetItem(pCfg, "encryptAlgorithm")->str, 16);
|
||||
tstrncpy(tsEncryptScope, cfgGetItem(pCfg, "encryptScope")->str, 100);
|
||||
//tstrncpy(tsAuthCode, cfgGetItem(pCfg, "authCode")->str, 100);
|
||||
// tstrncpy(tsAuthCode, cfgGetItem(pCfg, "authCode")->str, 100);
|
||||
|
||||
tsNumOfRpcThreads = cfgGetItem(pCfg, "numOfRpcThreads")->i32;
|
||||
tsNumOfRpcSessions = cfgGetItem(pCfg, "numOfRpcSessions")->i32;
|
||||
|
|
Loading…
Reference in New Issue