Merge pull request #5408 from taosdata/hotfix/sangshuduo/TD-3228-taosdemo-support-quorum
Hotfix/sangshuduo/td 3228 taosdemo support quorum
This commit is contained in:
commit
e0f94ef3b5
|
@ -2179,6 +2179,10 @@ static int createDatabases() {
|
|||
dataLen += snprintf(command + dataLen,
|
||||
BUFFER_SIZE - dataLen, " keep %d", g_Dbs.db[i].dbCfg.keep);
|
||||
}
|
||||
if (g_Dbs.db[i].dbCfg.quorum > 1) {
|
||||
dataLen += snprintf(command + dataLen,
|
||||
BUFFER_SIZE - dataLen, " quorum %d", g_Dbs.db[i].dbCfg.quorum);
|
||||
}
|
||||
if (g_Dbs.db[i].dbCfg.replica > 0) {
|
||||
dataLen += snprintf(command + dataLen,
|
||||
BUFFER_SIZE - dataLen, " replica %d", g_Dbs.db[i].dbCfg.replica);
|
||||
|
@ -2212,10 +2216,11 @@ static int createDatabases() {
|
|||
BUFFER_SIZE - dataLen, " cachelast %d", g_Dbs.db[i].dbCfg.cacheLast);
|
||||
}
|
||||
if (g_Dbs.db[i].dbCfg.fsync > 0) {
|
||||
dataLen += snprintf(command + dataLen, BUFFER_SIZE - dataLen, "fsync %d ", g_Dbs.db[i].dbCfg.fsync);
|
||||
dataLen += snprintf(command + dataLen, BUFFER_SIZE - dataLen,
|
||||
" fsync %d", g_Dbs.db[i].dbCfg.fsync);
|
||||
}
|
||||
if ((0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "ms", 2))
|
||||
|| (0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "us", 2))) {
|
||||
if ((0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "ms", strlen("ms")))
|
||||
|| (0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "us", strlen("us")))) {
|
||||
dataLen += snprintf(command + dataLen, BUFFER_SIZE - dataLen,
|
||||
" precision \'%s\';", g_Dbs.db[i].dbCfg.precision);
|
||||
}
|
||||
|
@ -3044,9 +3049,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
|
|||
if (quorum && quorum->type == cJSON_Number) {
|
||||
g_Dbs.db[i].dbCfg.quorum = quorum->valueint;
|
||||
} else if (!quorum) {
|
||||
g_Dbs.db[i].dbCfg.quorum = -1;
|
||||
g_Dbs.db[i].dbCfg.quorum = 1;
|
||||
} else {
|
||||
printf("failed to read json, walLevel not found");
|
||||
printf("failed to read json, quorum input mistake");
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue