• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3798

31 Mar 2025 10:39AM UTC coverage: 9.424% (-20.9%) from 30.372%
#3798

push

travis-ci

happyguoxy
test:add test cases

21549 of 307601 branches covered (7.01%)

Branch coverage included in aggregate %.

36084 of 303967 relevant lines covered (11.87%)

58620.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/source/dnode/mnode/impl/src/mndConfig.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#define _DEFAULT_SOURCE
17
#include "audit.h"
18
#include "mndConfig.h"
19
#include "mndDnode.h"
20
#include "mndMnode.h"
21
#include "mndPrivilege.h"
22
#include "mndSync.h"
23
#include "mndTrans.h"
24
#include "mndUser.h"
25
#include "tutil.h"
26
#include "tcompare.h"
27

28
#define CFG_VER_NUMBER    1
29
#define CFG_RESERVE_SIZE  63
30
#define CFG_ALTER_TIMEOUT 3 * 1000
31

32
static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pInMCfgReq, int32_t optLen, int32_t *pOutValue);
33
static int32_t mndProcessShowVariablesReq(SRpcMsg *pReq);
34
static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq);
35
static int32_t mndProcessConfigDnodeRsp(SRpcMsg *pRsp);
36
static int32_t mndProcessConfigReq(SRpcMsg *pReq);
37
static int32_t mndInitWriteCfg(SMnode *pMnode);
38
static int32_t mndSendRebuildReq(SMnode *pMnode);
39
static int32_t mndTryRebuildConfigSdbRsp(SRpcMsg *pRsp);
40
static int32_t initConfigArrayFromSdb(SMnode *pMnode, SArray *array);
41
static int32_t mndTryRebuildConfigSdb(SRpcMsg *pReq);
42
static void    cfgArrayCleanUp(SArray *array);
43
static void    cfgObjArrayCleanUp(SArray *array);
44
int32_t        compareSConfigItemArrays(SMnode *pMnode, const SArray *dArray, SArray *diffArray);
45

46
static int32_t mndConfigUpdateTrans(SMnode *pMnode, const char *name, char *pValue, ECfgDataType dtype,
47
                                    int32_t tsmmConfigVersion);
48

49
int32_t mndSetCreateConfigCommitLogs(STrans *pTrans, SConfigObj *obj);
50

51
int32_t mndInitConfig(SMnode *pMnode) {
×
52
  int32_t   code = 0;
×
53
  SSdbTable table = {.sdbType = SDB_CFG,
×
54
                     .keyType = SDB_KEY_BINARY,
55
                     .encodeFp = (SdbEncodeFp)mnCfgActionEncode,
56
                     .decodeFp = (SdbDecodeFp)mndCfgActionDecode,
57
                     .insertFp = (SdbInsertFp)mndCfgActionInsert,
58
                     .updateFp = (SdbUpdateFp)mndCfgActionUpdate,
59
                     .deleteFp = (SdbDeleteFp)mndCfgActionDelete,
60
                     .deployFp = (SdbDeployFp)mndCfgActionDeploy,
61
                     .afterRestoredFp = (SdbAfterRestoredFp)mndCfgActionAfterRestored};
62

63
  mndSetMsgHandle(pMnode, TDMT_MND_CONFIG, mndProcessConfigReq);
×
64
  mndSetMsgHandle(pMnode, TDMT_MND_CONFIG_DNODE, mndProcessConfigDnodeReq);
×
65
  mndSetMsgHandle(pMnode, TDMT_DND_CONFIG_DNODE_RSP, mndProcessConfigDnodeRsp);
×
66
  mndSetMsgHandle(pMnode, TDMT_MND_SHOW_VARIABLES, mndProcessShowVariablesReq);
×
67
  mndSetMsgHandle(pMnode, TDMT_MND_CONFIG_SDB, mndTryRebuildConfigSdb);
×
68
  mndSetMsgHandle(pMnode, TDMT_MND_CONFIG_SDB_RSP, mndTryRebuildConfigSdbRsp);
×
69

70
  return sdbSetTable(pMnode->pSdb, table);
×
71
}
72

73
SSdbRaw *mnCfgActionEncode(SConfigObj *obj) {
×
74
  int32_t  code = 0;
×
75
  int32_t  lino = 0;
×
76
  void    *buf = NULL;
×
77
  SSdbRaw *pRaw = NULL;
×
78

79
  SEncoder encoder;
80
  tEncoderInit(&encoder, NULL, 0);
×
81
  if ((code = tEncodeSConfigObj(&encoder, obj)) < 0) {
×
82
    tEncoderClear(&encoder);
×
83
    TSDB_CHECK_CODE(code, lino, _over);
×
84
  }
85

86
  int32_t tlen = encoder.pos;
×
87
  tEncoderClear(&encoder);
×
88

89
  int32_t size = sizeof(int32_t) + tlen;
×
90
  pRaw = sdbAllocRaw(SDB_CFG, CFG_VER_NUMBER, size);
×
91
  TSDB_CHECK_NULL(pRaw, code, lino, _over, terrno);
×
92

93
  buf = taosMemoryMalloc(tlen);
×
94
  TSDB_CHECK_NULL(buf, code, lino, _over, terrno);
×
95

96
  tEncoderInit(&encoder, buf, tlen);
×
97
  if ((code = tEncodeSConfigObj(&encoder, obj)) < 0) {
×
98
    tEncoderClear(&encoder);
×
99
    TSDB_CHECK_CODE(code, lino, _over);
×
100
  }
101

102
  tEncoderClear(&encoder);
×
103

104
  int32_t dataPos = 0;
×
105
  SDB_SET_INT32(pRaw, dataPos, tlen, _over);
×
106
  SDB_SET_BINARY(pRaw, dataPos, buf, tlen, _over);
×
107
  SDB_SET_DATALEN(pRaw, dataPos, _over);
×
108

109
_over:
×
110
  taosMemoryFreeClear(buf);
×
111
  if (code != TSDB_CODE_SUCCESS) {
×
112
    mError("cfg:%s, failed to encode to raw:%p at line:%d since %s", obj->name, pRaw, lino, tstrerror(code));
×
113
    sdbFreeRaw(pRaw);
×
114
    terrno = code;
×
115
    return NULL;
×
116
  }
117

118
  terrno = 0;
×
119
  mTrace("cfg:%s, encode to raw:%p, row:%p", obj->name, pRaw, obj);
×
120
  return pRaw;
×
121
}
122

123
SSdbRow *mndCfgActionDecode(SSdbRaw *pRaw) {
×
124
  int32_t     code = 0;
×
125
  int32_t     lino = 0;
×
126
  SSdbRow    *pRow = NULL;
×
127
  SConfigObj *pObj = NULL;
×
128
  void       *buf = NULL;
×
129
  int8_t      sver = 0;
×
130
  int32_t     tlen;
131
  int32_t     dataPos = 0;
×
132

133
  code = sdbGetRawSoftVer(pRaw, &sver);
×
134
  TSDB_CHECK_CODE(code, lino, _over);
×
135

136
  if (sver != CFG_VER_NUMBER) {
×
137
    terrno = TSDB_CODE_SDB_INVALID_DATA_VER;
×
138
    goto _over;
×
139
  }
140

141
  pRow = sdbAllocRow(sizeof(SConfigObj));
×
142
  TSDB_CHECK_NULL(pRow, code, lino, _over, terrno);
×
143

144
  pObj = sdbGetRowObj(pRow);
×
145
  TSDB_CHECK_NULL(pObj, code, lino, _over, terrno);
×
146

147
  SDB_GET_INT32(pRaw, dataPos, &tlen, _over);
×
148

149
  buf = taosMemoryMalloc(tlen + 1);
×
150
  TSDB_CHECK_NULL(buf, code, lino, _over, terrno);
×
151

152
  SDB_GET_BINARY(pRaw, dataPos, buf, tlen, _over);
×
153

154
  SDecoder decoder;
155
  tDecoderInit(&decoder, buf, tlen + 1);
×
156
  code = tDecodeSConfigObj(&decoder, pObj);
×
157
  tDecoderClear(&decoder);
×
158

159
  if (code < 0) {
×
160
    tFreeSConfigObj(pObj);
×
161
  }
162

163
_over:
×
164
  taosMemoryFreeClear(buf);
×
165

166
  if (code != TSDB_CODE_SUCCESS) {
×
167
    mError("cfg:%s, failed to decode from raw:%p since %s at:%d", pObj->name, pRaw, tstrerror(code), lino);
×
168
    taosMemoryFreeClear(pRow);
×
169
    terrno = code;
×
170
    return NULL;
×
171
  } else {
172
    mTrace("config:%s, decode from raw:%p, row:%p", pObj->name, pRaw, pObj);
×
173
    terrno = 0;
×
174
    return pRow;
×
175
  }
176
}
177

178
static int32_t mndCfgActionInsert(SSdb *pSdb, SConfigObj *obj) {
×
179
  mTrace("cfg:%s, perform insert action, row:%p", obj->name, obj);
×
180
  return 0;
×
181
}
182

183
static int32_t mndCfgActionDelete(SSdb *pSdb, SConfigObj *obj) {
×
184
  mTrace("cfg:%s, perform delete action, row:%p", obj->name, obj);
×
185
  tFreeSConfigObj(obj);
×
186
  return 0;
×
187
}
188

189
static int32_t mndCfgActionUpdate(SSdb *pSdb, SConfigObj *pOld, SConfigObj *pNew) {
×
190
  mTrace("cfg:%s, perform update action, old row:%p new row:%p", pOld->name, pOld, pNew);
×
191
  switch (pNew->dtype) {
×
192
    case CFG_DTYPE_NONE:
×
193
      break;
×
194
    case CFG_DTYPE_BOOL:
×
195
      pOld->bval = pNew->bval;
×
196
      break;
×
197
    case CFG_DTYPE_INT32:
×
198
      pOld->i32 = pNew->i32;
×
199
      break;
×
200
    case CFG_DTYPE_INT64:
×
201
      pOld->i64 = pNew->i64;
×
202
      break;
×
203
    case CFG_DTYPE_FLOAT:
×
204
    case CFG_DTYPE_DOUBLE:
205
      pOld->fval = pNew->fval;
×
206
      break;
×
207
    case CFG_DTYPE_STRING:
×
208
    case CFG_DTYPE_DIR:
209
    case CFG_DTYPE_LOCALE:
210
    case CFG_DTYPE_CHARSET:
211
    case CFG_DTYPE_TIMEZONE:
212
      taosMemoryFree(pOld->str);
×
213
      pOld->str = taosStrdup(pNew->str);
×
214
      if (pOld->str == NULL) {
×
215
        return terrno;
×
216
      }
217
      break;
×
218
  }
219
  return TSDB_CODE_SUCCESS;
×
220
}
221

222
static int32_t mndCfgActionDeploy(SMnode *pMnode) { return mndInitWriteCfg(pMnode); }
×
223

224
static int32_t mndCfgActionAfterRestored(SMnode *pMnode) { return mndSendRebuildReq(pMnode); }
×
225

226
static int32_t mndProcessConfigReq(SRpcMsg *pReq) {
×
227
  SMnode    *pMnode = pReq->info.node;
×
228
  SConfigReq configReq = {0};
×
229
  int32_t    code = TSDB_CODE_SUCCESS;
×
230
  SArray    *array = NULL;
×
231

232
  code = tDeserializeSConfigReq(pReq->pCont, pReq->contLen, &configReq);
×
233
  if (code != 0) {
×
234
    mError("failed to deserialize config req, since %s", terrstr());
×
235
    goto _OVER;
×
236
  }
237

238
  SConfigObj *vObj = sdbAcquire(pMnode->pSdb, SDB_CFG, "tsmmConfigVersion");
×
239
  if (vObj == NULL) {
×
240
    mInfo("failed to acquire mnd config version, since %s", terrstr());
×
241
    goto _OVER;
×
242
  }
243

244
  array = taosArrayInit(16, sizeof(SConfigItem));
×
245
  if (array == NULL) {
×
246
    code = TSDB_CODE_OUT_OF_MEMORY;
×
247
    goto _OVER;
×
248
  }
249
  SConfigRsp configRsp = {0};
×
250
  configRsp.forceReadConfig = configReq.forceReadConfig;
×
251

252
  configRsp.cver = vObj->i32;
×
253
  if (configRsp.forceReadConfig) {
×
254
    // compare config array from configReq with current config array
255
    code = compareSConfigItemArrays(pMnode, configReq.array, array);
×
256
    if (code != TSDB_CODE_SUCCESS) {
×
257
      mError("failed to compare config array, since %s", tstrerror(code));
×
258
      goto _OVER;
×
259
    }
260
    if (taosArrayGetSize(array) > 0) {
×
261
      configRsp.array = array;
×
262
    } else {
263
      configRsp.isConifgVerified = 1;
×
264
    }
265
  } else {
266
    if (configReq.cver == vObj->i32) {
×
267
      configRsp.isVersionVerified = 1;
×
268
    } else {
269
      code = initConfigArrayFromSdb(pMnode, array);
×
270
      if (code != 0) {
×
271
        mError("failed to init config array from sdb, since %s", terrstr());
×
272
        goto _OVER;
×
273
      }
274
      configRsp.array = array;
×
275
    }
276
  }
277

278
  int32_t contLen = tSerializeSConfigRsp(NULL, 0, &configRsp);
×
279
  if (contLen < 0) {
×
280
    code = contLen;
×
281
    goto _OVER;
×
282
  }
283
  void *pHead = rpcMallocCont(contLen);
×
284
  if (pHead == NULL) {
×
285
    code = TSDB_CODE_OUT_OF_MEMORY;
×
286
    goto _OVER;
×
287
  }
288
  contLen = tSerializeSConfigRsp(pHead, contLen, &configRsp);
×
289
  if (contLen < 0) {
×
290
    rpcFreeCont(pHead);
×
291
    code = contLen;
×
292
    goto _OVER;
×
293
  }
294
  pReq->info.rspLen = contLen;
×
295
  pReq->info.rsp = pHead;
×
296

297
_OVER:
×
298
  if (code != 0) {
×
299
    mError("failed to process config req, since %s", tstrerror(code));
×
300
  }
301
  sdbRelease(pMnode->pSdb, vObj);
×
302
  cfgArrayCleanUp(array);
×
303

304
  tFreeSConfigReq(&configReq);
×
305
  return code;
×
306
}
307

308
int32_t mndInitWriteCfg(SMnode *pMnode) {
×
309
  int    code = 0;
×
310
  size_t sz = 0;
×
311

312
  mInfo("init write cfg to sdb");
×
313
  STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, NULL, "init-write-config");
×
314
  if (pTrans == NULL) {
×
315
    mError("failed to init write cfg in create trans, since %s", terrstr());
×
316
    goto _OVER;
×
317
  }
318

319
  // encode mnd config version
320
  SConfigObj versionObj = mndInitConfigVersion();
×
321
  if ((code = mndSetCreateConfigCommitLogs(pTrans, &versionObj)) != 0) {
×
322
    mError("failed to init mnd config version, since %s", tstrerror(code));
×
323
    tFreeSConfigObj(&versionObj);
×
324
    goto _OVER;
×
325
  }
326
  tFreeSConfigObj(&versionObj);
×
327
  sz = taosArrayGetSize(taosGetGlobalCfg(tsCfg));
×
328

329
  for (int i = 0; i < sz; ++i) {
×
330
    SConfigItem *item = taosArrayGet(taosGetGlobalCfg(tsCfg), i);
×
331
    SConfigObj   obj;
332
    if ((code = mndInitConfigObj(item, &obj)) != 0) {
×
333
      goto _OVER;
×
334
    }
335
    if ((code = mndSetCreateConfigCommitLogs(pTrans, &obj)) != 0) {
×
336
      mError("failed to init mnd config:%s, since %s", item->name, tstrerror(code));
×
337
      tFreeSConfigObj(&obj);
×
338
      goto _OVER;
×
339
    }
340
    tFreeSConfigObj(&obj);
×
341
  }
342
  if ((code = mndTransPrepare(pMnode, pTrans)) != 0) goto _OVER;
×
343

344
_OVER:
×
345
  if (code != 0) {
×
346
    mError("failed to init write cfg, since %s", tstrerror(code));
×
347
  }
348
  mndTransDrop(pTrans);
×
349
  return code;
×
350
}
351

352
int32_t mndSendRebuildReq(SMnode *pMnode) {
×
353
  int32_t code = 0;
×
354

355
  SRpcMsg rpcMsg = {.pCont = NULL,
×
356
                    .contLen = 0,
357
                    .msgType = TDMT_MND_CONFIG_SDB,
358
                    .info.ahandle = 0,
359
                    .info.notFreeAhandle = 1,
360
                    .info.refId = 0,
361
                    .info.noResp = 0,
362
                    .info.handle = 0};
363
  SEpSet  epSet = {0};
×
364

365
  mndGetMnodeEpSet(pMnode, &epSet);
×
366

367
  code = tmsgSendReq(&epSet, &rpcMsg);
×
368
  if (code != 0) {
×
369
    mError("failed to send rebuild config req, since %s", tstrerror(code));
×
370
  }
371
  return code;
×
372
}
373

374
static int32_t mndTryRebuildConfigSdb(SRpcMsg *pReq) {
×
375
  SMnode *pMnode = pReq->info.node;
×
376
  if (!mndIsLeader(pMnode)) {
×
377
    return TSDB_CODE_SUCCESS;
×
378
  }
379
  int32_t     code = 0;
×
380
  int32_t     sz = -1;
×
381
  STrans     *pTrans = NULL;
×
382
  SConfigObj *vObj = NULL;
×
383
  SArray     *addArray = NULL;
×
384

385
  vObj = sdbAcquire(pMnode->pSdb, SDB_CFG, "tsmmConfigVersion");
×
386
  if (vObj == NULL) {
×
387
    if ((code = mndInitWriteCfg(pMnode)) < 0) goto _exit;
×
388
    mInfo("failed to acquire mnd config version, try to rebuild config in sdb.");
×
389
  } else {
390
    sz = taosArrayGetSize(taosGetGlobalCfg(tsCfg));
×
391
    addArray = taosArrayInit(4, sizeof(SConfigObj));
×
392
    for (int i = 0; i < sz; ++i) {
×
393
      SConfigItem *item = taosArrayGet(taosGetGlobalCfg(tsCfg), i);
×
394
      SConfigObj  *obj = sdbAcquire(pMnode->pSdb, SDB_CFG, item->name);
×
395
      if (obj == NULL) {
×
396
        mInfo("config:%s, not exist in sdb, try to add it", item->name);
×
397
        SConfigObj newObj;
398
        if ((code = mndInitConfigObj(item, &newObj)) != 0) goto _exit;
×
399
        if (NULL == taosArrayPush(addArray, &newObj)) {
×
400
          code = terrno;
×
401
          goto _exit;
×
402
        }
403
      } else {
404
        sdbRelease(pMnode->pSdb, obj);
×
405
      }
406
    }
407
    int32_t addSize = taosArrayGetSize(addArray);
×
408
    if (addSize > 0) {
×
409
      pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, NULL, "add-config");
×
410
      if (pTrans == NULL) {
×
411
        code = terrno;
×
412
        goto _exit;
×
413
      }
414
      for (int i = 0; i < addSize; ++i) {
×
415
        SConfigObj *AddObj = taosArrayGet(addArray, i);
×
416
        if ((code = mndSetCreateConfigCommitLogs(pTrans, AddObj)) != 0) goto _exit;
×
417
      }
418
      if ((code = mndTransPrepare(pMnode, pTrans)) != 0) goto _exit;
×
419
      mInfo("add new config to sdb, nums:%d", addSize);
×
420
    }
421
  }
422
_exit:
×
423
  if (code != 0) {
×
424
    mError("failed to try rebuild config in sdb, since %s", tstrerror(code));
×
425
  }
426
  sdbRelease(pMnode->pSdb, vObj);
×
427
  cfgObjArrayCleanUp(addArray);
×
428
  mndTransDrop(pTrans);
×
429
  TAOS_RETURN(code);
×
430
}
431

432
int32_t mndSetCreateConfigCommitLogs(STrans *pTrans, SConfigObj *item) {
×
433
  int32_t  code = 0;
×
434
  SSdbRaw *pCommitRaw = mnCfgActionEncode(item);
×
435
  if (pCommitRaw == NULL) {
×
436
    code = terrno;
×
437
    TAOS_RETURN(code);
×
438
  }
439
  if ((code = mndTransAppendCommitlog(pTrans, pCommitRaw) != 0)) TAOS_RETURN(code);
×
440
  if ((code = sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY)) != 0) TAOS_RETURN(code);
×
441
  return TSDB_CODE_SUCCESS;
×
442
}
443

444
static int32_t mndMCfg2DCfg(SMCfgDnodeReq *pMCfgReq, SDCfgDnodeReq *pDCfgReq) {
×
445
  int32_t code = 0;
×
446
  char   *p = pMCfgReq->config;
×
447
  while (*p) {
×
448
    if (*p == ' ') {
×
449
      break;
×
450
    }
451
    p++;
×
452
  }
453

454
  size_t optLen = p - pMCfgReq->config;
×
455
  tstrncpy(pDCfgReq->config, pMCfgReq->config, sizeof(pDCfgReq->config));
×
456
  pDCfgReq->config[optLen] = 0;
×
457

458
  if (' ' == pMCfgReq->config[optLen]) {
×
459
    // 'key value'
460
    if (strlen(pMCfgReq->value) != 0) goto _err;
×
461
    tstrncpy(pDCfgReq->value, p + 1, sizeof(pDCfgReq->value));
×
462
  } else {
463
    // 'key' 'value'
464
    if (strlen(pMCfgReq->value) == 0) goto _err;
×
465
    tstrncpy(pDCfgReq->value, pMCfgReq->value, sizeof(pDCfgReq->value));
×
466
  }
467

468
  TAOS_RETURN(code);
×
469

470
_err:
×
471
  mError("dnode:%d, failed to config since invalid conf:%s", pMCfgReq->dnodeId, pMCfgReq->config);
×
472
  code = TSDB_CODE_INVALID_CFG;
×
473
  TAOS_RETURN(code);
×
474
}
475

476
static int32_t mndSendCfgDnodeReq(SMnode *pMnode, int32_t dnodeId, SDCfgDnodeReq *pDcfgReq) {
×
477
  int32_t code = -1;
×
478
  SSdb   *pSdb = pMnode->pSdb;
×
479
  void   *pIter = NULL;
×
480

481
  int64_t curMs = taosGetTimestampMs();
×
482

483
  while (1) {
×
484
    SDnodeObj *pDnode = NULL;
×
485
    pIter = sdbFetch(pSdb, SDB_DNODE, pIter, (void **)&pDnode);
×
486
    if (pIter == NULL) break;
×
487

488
    if (pDnode->id == dnodeId || dnodeId == -1 || dnodeId == 0) {
×
489
      bool online = mndIsDnodeOnline(pDnode, curMs);
×
490
      if (!online) {
×
491
        mWarn("dnode:%d, is offline, skip to send config req", pDnode->id);
×
492
        continue;
×
493
      }
494
      SEpSet  epSet = mndGetDnodeEpset(pDnode);
×
495
      int32_t bufLen = tSerializeSDCfgDnodeReq(NULL, 0, pDcfgReq);
×
496
      void   *pBuf = rpcMallocCont(bufLen);
×
497

498
      if (pBuf == NULL) {
×
499
        sdbCancelFetch(pMnode->pSdb, pIter);
×
500
        sdbRelease(pMnode->pSdb, pDnode);
×
501
        code = TSDB_CODE_OUT_OF_MEMORY;
×
502
        return code;
×
503
      }
504

505
      if ((bufLen = tSerializeSDCfgDnodeReq(pBuf, bufLen, pDcfgReq)) <= 0) {
×
506
        sdbCancelFetch(pMnode->pSdb, pIter);
×
507
        sdbRelease(pMnode->pSdb, pDnode);
×
508
        code = bufLen;
×
509
        rpcFreeCont(pBuf);
×
510
        return code;
×
511
      }
512

513
      mInfo("dnode:%d, send config req to dnode, config:%s value:%s", pDnode->id, pDcfgReq->config, pDcfgReq->value);
×
514
      SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE, .pCont = pBuf, .contLen = bufLen};
×
515
      SRpcMsg rpcRsp = {0};
×
516

517
      code = rpcSendRecvWithTimeout(pMnode->msgCb.statusRpc, &epSet, &rpcMsg, &rpcRsp, NULL, CFG_ALTER_TIMEOUT);
×
518
      if (code != 0) {
×
519
        mError("failed to send config req to dnode:%d, since %s", pDnode->id, tstrerror(code));
×
520
        sdbCancelFetch(pMnode->pSdb, pIter);
×
521
        sdbRelease(pMnode->pSdb, pDnode);
×
522
        return code;
×
523
      }
524

525
      code = rpcRsp.code;
×
526
      if (code != 0) {
×
527
        mError("failed to alter config %s,on dnode:%d, since %s", pDcfgReq->config, pDnode->id, tstrerror(code));
×
528
        sdbCancelFetch(pMnode->pSdb, pIter);
×
529
        sdbRelease(pMnode->pSdb, pDnode);
×
530
        return code;
×
531
      }
532
      rpcFreeCont(rpcRsp.pCont);
×
533
    }
534
    sdbRelease(pSdb, pDnode);
×
535
  }
536

537
  if (code == -1) {
×
538
    code = TSDB_CODE_MND_DNODE_NOT_EXIST;
×
539
  }
540
  TAOS_RETURN(code);
×
541
}
542

543
static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
×
544
  int32_t       code = 0;
×
545
  int32_t       lino = -1;
×
546
  SMnode       *pMnode = pReq->info.node;
×
547
  SMCfgDnodeReq cfgReq = {0};
×
548
  SConfigObj   *vObj = sdbAcquire(pMnode->pSdb, SDB_CFG, "tsmmConfigVersion");
×
549
  if (vObj == NULL) {
×
550
    code = TSDB_CODE_SDB_OBJ_NOT_THERE;
×
551
    mInfo("failed to acquire mnd config version, since %s", tstrerror(code));
×
552
    goto _err_out;
×
553
  }
554

555
  TAOS_CHECK_RETURN(tDeserializeSMCfgDnodeReq(pReq->pCont, pReq->contLen, &cfgReq));
×
556
  int8_t updateIpWhiteList = 0;
×
557
  mInfo("dnode:%d, start to config, option:%s, value:%s", cfgReq.dnodeId, cfgReq.config, cfgReq.value);
×
558
  if ((code = mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CONFIG_DNODE)) != 0) {
×
559
    goto _err_out;
×
560
  }
561

562
  SDCfgDnodeReq dcfgReq = {0};
×
563
  if (strcasecmp(cfgReq.config, "resetlog") == 0) {
×
564
    tstrncpy(dcfgReq.config, "resetlog", 9);
×
565
    goto _send_req;
×
566
#ifdef TD_ENTERPRISE
567
  } else if (strncasecmp(cfgReq.config, "s3blocksize", 12) == 0) {
×
568
    int32_t optLen = strlen("s3blocksize");
×
569
    int32_t flag = -1;
×
570
    int32_t code = mndMCfgGetValInt32(&cfgReq, optLen, &flag);
×
571
    if (code < 0) {
×
572
      goto _err_out;
×
573
    }
574

575
    if (flag > 1024 * 1024 || (flag > -1 && flag < 1024) || flag < -1) {
×
576
      mError("dnode:%d, failed to config s3blocksize since value:%d. Valid range: -1 or [1024, 1024 * 1024]",
×
577
             cfgReq.dnodeId, flag);
578
      code = TSDB_CODE_INVALID_CFG;
×
579
      goto _err_out;
×
580
    }
581

582
    tstrncpy(dcfgReq.config, "s3blocksize", 12);
×
583
    snprintf(dcfgReq.value, TSDB_DNODE_VALUE_LEN, "%d", flag);
×
584
#endif
585
  } else {
586
    TAOS_CHECK_GOTO(mndMCfg2DCfg(&cfgReq, &dcfgReq), &lino, _err_out);
×
587
    if (strlen(dcfgReq.config) > TSDB_DNODE_CONFIG_LEN) {
×
588
      mError("dnode:%d, failed to config since config is too long", cfgReq.dnodeId);
×
589
      code = TSDB_CODE_INVALID_CFG;
×
590
      goto _err_out;
×
591
    }
592
    if (strncasecmp(dcfgReq.config, "enableWhiteList", strlen("enableWhiteList")) == 0) {
×
593
      updateIpWhiteList = 1;
×
594
    }
595

596
    CfgAlterType alterType = (cfgReq.dnodeId == 0 || cfgReq.dnodeId == -1) ? CFG_ALTER_ALL_DNODES : CFG_ALTER_DNODE;
×
597
    TAOS_CHECK_GOTO(cfgCheckRangeForDynUpdate(taosGetCfg(), dcfgReq.config, dcfgReq.value, true, alterType), &lino,
×
598
                    _err_out);
599
  }
600
  SConfigItem *pItem = cfgGetItem(taosGetCfg(), dcfgReq.config);
×
601
  // Update config in sdb.
602
  if (pItem == NULL) {
×
603
    mError("failed to find config:%s while process config dnode req", cfgReq.config);
×
604
    code = TSDB_CODE_CFG_NOT_FOUND;
×
605
    goto _err_out;
×
606
  }
607
  if (pItem->category == CFG_CATEGORY_GLOBAL) {
×
608
    TAOS_CHECK_GOTO(mndConfigUpdateTrans(pMnode, dcfgReq.config, dcfgReq.value, pItem->dtype, ++vObj->i32), &lino,
×
609
                    _err_out);
610
  }
611
_send_req :
×
612

613
{  // audit
614
  char obj[50] = {0};
×
615
  (void)tsnprintf(obj, sizeof(obj), "%d", cfgReq.dnodeId);
×
616

617
  auditRecord(pReq, pMnode->clusterId, "alterDnode", obj, "", cfgReq.sql, cfgReq.sqlLen);
×
618
}
619
  dcfgReq.version = vObj->i32;
×
620
  code = mndSendCfgDnodeReq(pMnode, cfgReq.dnodeId, &dcfgReq);
×
621
  if (code != 0) {
×
622
    mError("failed to send config req to dnode:%d, since %s", cfgReq.dnodeId, tstrerror(code));
×
623
    goto _err_out;
×
624
  }
625
  // dont care suss or succ;
626
  if (updateIpWhiteList) mndRefreshUserIpWhiteList(pMnode);
×
627
  tFreeSMCfgDnodeReq(&cfgReq);
×
628
  sdbRelease(pMnode->pSdb, vObj);
×
629
  TAOS_RETURN(code);
×
630

631
_err_out:
×
632
  mError("failed to process config dnode req, since %s", tstrerror(code));
×
633
  tFreeSMCfgDnodeReq(&cfgReq);
×
634
  sdbRelease(pMnode->pSdb, vObj);
×
635
  TAOS_RETURN(code);
×
636
}
637

638
static int32_t mndProcessConfigDnodeRsp(SRpcMsg *pRsp) {
×
639
  mInfo("config rsp from dnode");
×
640
  return 0;
×
641
}
642

643
static int32_t mndTryRebuildConfigSdbRsp(SRpcMsg *pRsp) {
×
644
  mInfo("rebuild config sdb rsp");
×
645
  return 0;
×
646
}
647

648
// get int32_t value from 'SMCfgDnodeReq'
649
static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pMCfgReq, int32_t optLen, int32_t *pOutValue) {
×
650
  int32_t code = 0;
×
651
  if (' ' != pMCfgReq->config[optLen] && 0 != pMCfgReq->config[optLen]) {
×
652
    goto _err;
×
653
  }
654

655
  if (' ' == pMCfgReq->config[optLen]) {
×
656
    // 'key value'
657
    if (strlen(pMCfgReq->value) != 0) goto _err;
×
658
    *pOutValue = taosStr2Int32(pMCfgReq->config + optLen + 1, NULL, 10);
×
659
  } else {
660
    // 'key' 'value'
661
    if (strlen(pMCfgReq->value) == 0) goto _err;
×
662
    *pOutValue = taosStr2Int32(pMCfgReq->value, NULL, 10);
×
663
  }
664

665
  TAOS_RETURN(code);
×
666

667
_err:
×
668
  mError(" failed to set config since:%s", tstrerror(code));
×
669
  TAOS_RETURN(code);
×
670
}
671

672
static int32_t mndConfigUpdateTrans(SMnode *pMnode, const char *name, char *pValue, ECfgDataType dtype,
×
673
                                    int32_t tsmmConfigVersion) {
674
  int32_t     code = -1;
×
675
  int32_t     lino = -1;
×
676
  SConfigObj *pVersion = taosMemoryMalloc(sizeof(SConfigObj)), *pObj = taosMemoryMalloc(sizeof(SConfigObj));
×
677
  if (pVersion == NULL || pObj == NULL) {
×
678
    code = terrno;
×
679
    goto _OVER;
×
680
  }
681
  tstrncpy(pVersion->name, "tsmmConfigVersion", CFG_NAME_MAX_LEN);
×
682
  pVersion->dtype = CFG_DTYPE_INT32;
×
683
  pVersion->i32 = tsmmConfigVersion;
×
684

685
  pObj->dtype = dtype;
×
686
  tstrncpy(pObj->name, name, CFG_NAME_MAX_LEN);
×
687

688
  TAOS_CHECK_GOTO(mndUpdateObj(pObj, name, pValue), &lino, _OVER);
×
689
  STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, NULL, "update-config");
×
690
  if (pTrans == NULL) {
×
691
    code = terrno;
×
692
    goto _OVER;
×
693
  }
694
  mInfo("trans:%d, used to update config:%s to value:%s", pTrans->id, name, pValue);
×
695
  TAOS_CHECK_GOTO(mndSetCreateConfigCommitLogs(pTrans, pVersion), &lino, _OVER);
×
696
  TAOS_CHECK_GOTO(mndSetCreateConfigCommitLogs(pTrans, pObj), &lino, _OVER);
×
697
  if ((code = mndTransPrepare(pMnode, pTrans)) != 0) goto _OVER;
×
698
  code = 0;
×
699
_OVER:
×
700
  if (code != 0) {
×
701
    mError("failed to update config:%s to value:%s, since %s", name, pValue, tstrerror(code));
×
702
  }
703
  mndTransDrop(pTrans);
×
704
  tFreeSConfigObj(pVersion);
×
705
  taosMemoryFree(pVersion);
×
706
  tFreeSConfigObj(pObj);
×
707
  taosMemoryFree(pObj);
×
708
  return code;
×
709
}
710

711
static int32_t initConfigArrayFromSdb(SMnode *pMnode, SArray *array) {
×
712
  int32_t     code = 0;
×
713
  SSdb       *pSdb = pMnode->pSdb;
×
714
  void       *pIter = NULL;
×
715
  SConfigObj *obj = NULL;
×
716

717
  while (1) {
×
718
    pIter = sdbFetch(pSdb, SDB_CFG, pIter, (void **)&obj);
×
719
    if (pIter == NULL) break;
×
720
    if (obj == NULL) {
×
721
      code = TSDB_CODE_OUT_OF_MEMORY;
×
722
      goto _exit;
×
723
    }
724
    if (strcasecmp(obj->name, "tsmmConfigVersion") == 0) {
×
725
      sdbRelease(pSdb, obj);
×
726
      continue;
×
727
    }
728
    SConfigItem item = {0};
×
729
    item.dtype = obj->dtype;
×
730
    item.name = taosStrdup(obj->name);
×
731
    if (item.name == NULL) {
×
732
      code = terrno;
×
733
      sdbCancelFetch(pSdb, pIter);
×
734
      sdbRelease(pSdb, obj);
×
735
      goto _exit;
×
736
    }
737
    switch (obj->dtype) {
×
738
      case CFG_DTYPE_NONE:
×
739
        break;
×
740
      case CFG_DTYPE_BOOL:
×
741
        item.bval = obj->bval;
×
742
        break;
×
743
      case CFG_DTYPE_INT32:
×
744
        item.i32 = obj->i32;
×
745
        break;
×
746
      case CFG_DTYPE_INT64:
×
747
        item.i64 = obj->i64;
×
748
        break;
×
749
      case CFG_DTYPE_FLOAT:
×
750
      case CFG_DTYPE_DOUBLE:
751
        item.fval = obj->fval;
×
752
        break;
×
753
      case CFG_DTYPE_STRING:
×
754
      case CFG_DTYPE_DIR:
755
      case CFG_DTYPE_LOCALE:
756
      case CFG_DTYPE_CHARSET:
757
      case CFG_DTYPE_TIMEZONE:
758
        item.str = taosStrdup(obj->str);
×
759
        if (item.str == NULL) {
×
760
          sdbCancelFetch(pSdb, pIter);
×
761
          sdbRelease(pSdb, obj);
×
762
          code = terrno;
×
763
          goto _exit;
×
764
        }
765
        break;
×
766
    }
767
    if (taosArrayPush(array, &item) == NULL) {
×
768
      sdbCancelFetch(pSdb, pIter);
×
769
      sdbRelease(pSdb, obj);
×
770
      code = TSDB_CODE_OUT_OF_MEMORY;
×
771
      goto _exit;
×
772
      break;
773
    }
774
    sdbRelease(pSdb, obj);
×
775
  }
776
_exit:
×
777
  if (code != 0) {
×
778
    mError("failed to init config array from sdb, since %s", tstrerror(code));
×
779
  }
780
  return code;
×
781
}
782

783
static void cfgArrayCleanUp(SArray *array) {
×
784
  if (array == NULL) {
×
785
    return;
×
786
  }
787

788
  int32_t sz = taosArrayGetSize(array);
×
789
  for (int32_t i = 0; i < sz; ++i) {
×
790
    SConfigItem *item = taosArrayGet(array, i);
×
791
    if (item->dtype == CFG_DTYPE_STRING || item->dtype == CFG_DTYPE_DIR || item->dtype == CFG_DTYPE_LOCALE ||
×
792
        item->dtype == CFG_DTYPE_CHARSET || item->dtype == CFG_DTYPE_TIMEZONE) {
×
793
      taosMemoryFreeClear(item->str);
×
794
    }
795
    taosMemoryFreeClear(item->name);
×
796
  }
797

798
  taosArrayDestroy(array);
×
799
}
800

801
static void cfgObjArrayCleanUp(SArray *array) {
×
802
  if (array == NULL) {
×
803
    return;
×
804
  }
805
  int32_t sz = taosArrayGetSize(array);
×
806
  for (int32_t i = 0; i < sz; ++i) {
×
807
    SConfigObj *obj = taosArrayGet(array, i);
×
808
    tFreeSConfigObj(obj);
×
809
  }
810
  taosArrayDestroy(array);
×
811
}
812

813
static SArray *initVariablesFromItems(SArray *pItems, const char* likePattern) {
×
814
  if (pItems == NULL) {
×
815
    return NULL;
×
816
  }
817

818
  int32_t sz = taosArrayGetSize(pItems);
×
819

820
  SArray *pInfos = taosArrayInit(sz, sizeof(SVariablesInfo));
×
821
  if (pInfos == NULL) {
×
822
    mError("failed to init array while init variables from items, since %s", tstrerror(terrno));
×
823
    return NULL;
×
824
  }
825
  for (int32_t i = 0; i < sz; ++i) {
×
826
    SConfigItem   *pItem = taosArrayGet(pItems, i);
×
827
    SVariablesInfo info = {0};
×
828
    tstrncpy(info.name, pItem->name, sizeof(info.name));
×
829
    if (likePattern != NULL && rawStrPatternMatch(pItem->name, likePattern) != TSDB_PATTERN_MATCH) {
×
830
      continue;
×
831
    }
832

833
    // init info value
834
    switch (pItem->dtype) {
×
835
      case CFG_DTYPE_NONE:
×
836
        break;
×
837
      case CFG_DTYPE_BOOL:
×
838
        tsnprintf(info.value, sizeof(info.value), "%d", pItem->bval);
×
839
        break;
×
840
      case CFG_DTYPE_INT32:
×
841
        tsnprintf(info.value, sizeof(info.value), "%d", pItem->i32);
×
842
        break;
×
843
      case CFG_DTYPE_INT64:
×
844
        tsnprintf(info.value, sizeof(info.value), "%" PRId64, pItem->i64);
×
845
        break;
×
846
      case CFG_DTYPE_FLOAT:
×
847
      case CFG_DTYPE_DOUBLE:
848
        tsnprintf(info.value, sizeof(info.value), "%f", pItem->fval);
×
849
        break;
×
850
      case CFG_DTYPE_STRING:
×
851
      case CFG_DTYPE_DIR:
852
      case CFG_DTYPE_LOCALE:
853
      case CFG_DTYPE_CHARSET:
854
      case CFG_DTYPE_TIMEZONE:
855
        tsnprintf(info.value, sizeof(info.value), "%s", pItem->str);
×
856
        break;
×
857
    }
858

859
    // init info scope
860
    switch (pItem->scope) {
×
861
      case CFG_SCOPE_SERVER:
×
862
        tstrncpy(info.scope, "server", sizeof(info.scope));
×
863
        break;
×
864
      case CFG_SCOPE_CLIENT:
×
865
        tstrncpy(info.scope, "client", sizeof(info.scope));
×
866
        break;
×
867
      case CFG_SCOPE_BOTH:
×
868
        tstrncpy(info.scope, "both", sizeof(info.scope));
×
869
        break;
×
870
      default:
×
871
        tstrncpy(info.scope, "unknown", sizeof(info.scope));
×
872
        break;
×
873
    }
874
    // init info category
875
    switch (pItem->category) {
×
876
      case CFG_CATEGORY_GLOBAL:
×
877
        tstrncpy(info.category, "global", sizeof(info.category));
×
878
        break;
×
879
      case CFG_CATEGORY_LOCAL:
×
880
        tstrncpy(info.category, "local", sizeof(info.category));
×
881
        break;
×
882
      default:
×
883
        tstrncpy(info.category, "unknown", sizeof(info.category));
×
884
        break;
×
885
    }
886
    if (NULL == taosArrayPush(pInfos, &info)) {
×
887
      mError("failed to push info to array while init variables from items,since %s", tstrerror(terrno));
×
888
      taosArrayDestroy(pInfos);
×
889
      return NULL;
×
890
    }
891
  }
892

893
  return pInfos;
×
894
}
895

896
static int32_t mndProcessShowVariablesReq(SRpcMsg *pReq) {
×
897
  SShowVariablesRsp rsp = {0};
×
898
  int32_t           code = TSDB_CODE_SUCCESS;
×
899
  SShowVariablesReq req = {0};
×
900
  SArray           *array = NULL;
×
901

902
  code = tDeserializeSShowVariablesReq(pReq->pCont, pReq->contLen, &req);
×
903
  if (code != 0) {
×
904
    mError("failed to deserialize config req, since %s", terrstr());
×
905
    goto _OVER;
×
906
  }
907

908
  if ((code = mndCheckOperPrivilege(pReq->info.node, pReq->info.conn.user, MND_OPER_SHOW_VARIABLES)) != 0) {
×
909
    goto _OVER;
×
910
  }
911

912
  SVariablesInfo info = {0};
×
913
  char          *likePattern = req.opType == OP_TYPE_LIKE ? req.val : NULL;
×
914
  rsp.variables = initVariablesFromItems(taosGetGlobalCfg(tsCfg), likePattern);
×
915
  if (rsp.variables == NULL) {
×
916
    code = terrno;
×
917
    goto _OVER;
×
918
  }
919
  int32_t rspLen = tSerializeSShowVariablesRsp(NULL, 0, &rsp);
×
920
  void   *pRsp = rpcMallocCont(rspLen);
×
921
  if (pRsp == NULL) {
×
922
    code = terrno;
×
923
    goto _OVER;
×
924
  }
925

926
  if ((rspLen = tSerializeSShowVariablesRsp(pRsp, rspLen, &rsp)) <= 0) {
×
927
    rpcFreeCont(pRsp);
×
928
    code = rspLen;
×
929
    goto _OVER;
×
930
  }
931

932
  pReq->info.rspLen = rspLen;
×
933
  pReq->info.rsp = pRsp;
×
934
  code = 0;
×
935

936
_OVER:
×
937

938
  if (code != 0) {
×
939
    mError("failed to get show variables info since %s", tstrerror(code));
×
940
  }
941
  tFreeSShowVariablesReq(&req);
×
942
  tFreeSShowVariablesRsp(&rsp);
×
943
  TAOS_RETURN(code);
×
944
}
945

946
int32_t compareSConfigItem(const SConfigObj *item1, SConfigItem *item2, bool *compare) {
×
947
  switch (item1->dtype) {
×
948
    case CFG_DTYPE_BOOL:
×
949
      if (item1->bval != item2->bval) {
×
950
        item2->bval = item1->bval;
×
951
        *compare = false;
×
952
      }
953
      break;
×
954
    case CFG_DTYPE_FLOAT:
×
955
      if (item1->fval != item2->fval) {
×
956
        item2->fval = item1->fval;
×
957
        *compare = false;
×
958
      }
959
      break;
×
960
    case CFG_DTYPE_INT32:
×
961
      if (item1->i32 != item2->i32) {
×
962
        item2->i32 = item1->i32;
×
963
        *compare = false;
×
964
      }
965
      break;
×
966
    case CFG_DTYPE_INT64:
×
967
      if (item1->i64 != item2->i64) {
×
968
        item2->i64 = item1->i64;
×
969
        *compare = false;
×
970
      }
971
      break;
×
972
    case CFG_DTYPE_STRING:
×
973
    case CFG_DTYPE_DIR:
974
    case CFG_DTYPE_LOCALE:
975
    case CFG_DTYPE_CHARSET:
976
    case CFG_DTYPE_TIMEZONE:
977
      if (strcmp(item1->str, item2->str) != 0) {
×
978
        taosMemoryFree(item2->str);
×
979
        item2->str = taosStrdup(item1->str);
×
980
        if (item2->str == NULL) {
×
981
          return TSDB_CODE_OUT_OF_MEMORY;
×
982
        }
983
        *compare = false;
×
984
      }
985
      break;
×
986
    default:
×
987
      *compare = false;
×
988
      return TSDB_CODE_INVALID_CFG;
×
989
  }
990
  *compare = true;
×
991
  return TSDB_CODE_SUCCESS;
×
992
}
993

994
int32_t compareSConfigItemArrays(SMnode *pMnode, const SArray *dArray, SArray *diffArray) {
×
995
  int32_t code = 0;
×
996
  int32_t dsz = taosArrayGetSize(dArray);
×
997
  bool    compare = false;
×
998

999
  for (int i = 0; i < dsz; i++) {
×
1000
    SConfigItem *dItem = (SConfigItem *)taosArrayGet(dArray, i);
×
1001
    SConfigObj  *mObj = sdbAcquire(pMnode->pSdb, SDB_CFG, dItem->name);
×
1002
    if (mObj == NULL) {
×
1003
      code = terrno;
×
1004
      mError("failed to acquire config:%s from sdb, since %s", dItem->name, tstrerror(code));
×
1005
      return code;
×
1006
    }
1007

1008
    code = compareSConfigItem(mObj, dItem, &compare);
×
1009
    if (code != TSDB_CODE_SUCCESS) {
×
1010
      sdbRelease(pMnode->pSdb, mObj);
×
1011
      return code;
×
1012
    }
1013

1014
    if (!compare) {
×
1015
      if (taosArrayPush(diffArray, dItem) == NULL) {
×
1016
        sdbRelease(pMnode->pSdb, mObj);
×
1017
        return terrno;
×
1018
      }
1019
    }
1020

1021
    sdbRelease(pMnode->pSdb, mObj);
×
1022
  }
1023

1024
  return code;
×
1025
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc