Fix(cfg):only write sdb on leader.
This commit is contained in:
parent
0100741409
commit
6eb183a032
|
@ -18,6 +18,7 @@
|
||||||
#include "mndConfig.h"
|
#include "mndConfig.h"
|
||||||
#include "mndDnode.h"
|
#include "mndDnode.h"
|
||||||
#include "mndPrivilege.h"
|
#include "mndPrivilege.h"
|
||||||
|
#include "mndSync.h"
|
||||||
#include "mndTrans.h"
|
#include "mndTrans.h"
|
||||||
#include "mndUser.h"
|
#include "mndUser.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
@ -340,11 +341,15 @@ _OVER:
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndTryRebuildCfg(SMnode *pMnode) {
|
int32_t mndTryRebuildCfg(SMnode *pMnode) {
|
||||||
|
if (!mndIsLeader(pMnode)) {
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t sz = -1;
|
int32_t sz = -1;
|
||||||
STrans *pTrans = NULL;
|
STrans *pTrans = NULL;
|
||||||
SAcctObj *vObj = NULL, *obj = NULL;
|
SAcctObj *vObj = NULL, *obj = NULL;
|
||||||
SArray *addArray = NULL;
|
SArray *addArray = NULL;
|
||||||
|
|
||||||
vObj = sdbAcquire(pMnode->pSdb, SDB_CFG, "tsmmConfigVersion");
|
vObj = sdbAcquire(pMnode->pSdb, SDB_CFG, "tsmmConfigVersion");
|
||||||
if (vObj == NULL) {
|
if (vObj == NULL) {
|
||||||
if ((code = mndInitWriteCfg(pMnode)) < 0) goto _exit;
|
if ((code = mndInitWriteCfg(pMnode)) < 0) goto _exit;
|
||||||
|
|
Loading…
Reference in New Issue