Skip to content

Commit

Permalink
Merge pull request #1635 from taosdata/feature/mpeer
Browse files Browse the repository at this point in the history
set master when there is only one node
  • Loading branch information
guanshengliang committed Apr 17, 2020
2 parents a767bd7 + ecc95e7 commit c36735c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mnode/src/mgmtMnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ static int32_t mgmtMnodeActionDecode(SSdbOperDesc *pOper) {
}

static int32_t mgmtMnodeActionRestored() {
if (mgmtGetMnodesNum() == 1) {
SMnodeObj *pMnode = NULL;
mgmtGetNextMnode(NULL, &pMnode);
if (pMnode != NULL) {
pMnode->role = TAOS_SYNC_ROLE_MASTER;
mgmtReleaseMnode(pMnode);
}
}
return TSDB_CODE_SUCCESS;
}

Expand Down

0 comments on commit c36735c

Please sign in to comment.