Write configs to mnd sdb.

This commit is contained in:
xiao-77 2024-11-18 12:05:08 +08:00
parent 4a03483683
commit 9b9b3e8e96
3 changed files with 7 additions and 3 deletions

View File

@ -121,7 +121,9 @@ SSdbRow *mndCfgActionDecode(SSdbRaw *pRaw) {
if (item == NULL) goto _OVER;
int32_t dataPos = 0;
SDB_GET_INT32(pRaw, dataPos, &len, _OVER)
SDB_GET_BINARY(pRaw, dataPos, item->name, len, _OVER)
char *buf = taosMemoryMalloc(len + 1);
SDB_GET_BINARY(pRaw, dataPos, buf, len, _OVER)
item->name = buf;
SDB_GET_INT32(pRaw, dataPos, (int32_t *)&item->dtype, _OVER)
switch (item->dtype) {
case CFG_DTYPE_NONE:
@ -150,6 +152,7 @@ SSdbRow *mndCfgActionDecode(SSdbRaw *pRaw) {
SDB_GET_BINARY(pRaw, dataPos, item->str, len, _OVER)
break;
}
terrno = TSDB_CODE_SUCCESS;
_OVER:
if (terrno != 0) {
@ -179,7 +182,7 @@ static int32_t mndCfgActionUpdate(SSdb *pSdb, SConfigItem *pOld, SConfigItem *pN
static int32_t mndCfgActionDeploy(SMnode *pMnode) { return mndInitWriteCfg(pMnode); }
static int32_t mndCfgActionPrepare(SMnode *pMnode) { return mndInitConfig(pMnode); }
static int32_t mndCfgActionPrepare(SMnode *pMnode) { return mndInitReadCfg(pMnode); }
static int32_t mndProcessConfigReq(SRpcMsg *pReq) {
SMnode *pMnode = pReq->info.node;

View File

@ -638,7 +638,7 @@ static int32_t mndInitSteps(SMnode *pMnode) {
TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-query", mndInitQuery, mndCleanupQuery));
TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-sync", mndInitSync, mndCleanupSync));
TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-telem", mndInitTelem, mndCleanupTelem));
TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-config", mndInitConfig, mndCleanupArbGroup));
TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-config", mndInitConfig, NULL));
return 0;
}

View File

@ -127,6 +127,7 @@ int32_t sdbSetTable(SSdb *pSdb, SSdbTable table) {
pSdb->deployFps[sdbType] = table.deployFp;
pSdb->encodeFps[sdbType] = table.encodeFp;
pSdb->decodeFps[sdbType] = table.decodeFp;
pSdb->prepareFps[sdbType] = table.prepareFp;
pSdb->validateFps[sdbType] = table.validateFp;
int32_t hashType = 0;