enh: grant check for dual-replica-ha
This commit is contained in:
parent
9cf2529cac
commit
c575d7a850
|
@ -911,6 +911,13 @@ static int32_t mndProcessCreateDbReq(SRpcMsg *pReq) {
|
|||
goto _OVER;
|
||||
}
|
||||
|
||||
if (createReq.replications == 2) {
|
||||
if ((terrno = grantCheck(TSDB_GRANT_DUAL_REPLICA_HA)) != 0) {
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
}
|
||||
|
||||
if ((code = mndCheckDbEncryptKey(pMnode, &createReq)) != 0) {
|
||||
terrno = code;
|
||||
goto _OVER;
|
||||
|
@ -1171,6 +1178,12 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
|
|||
goto _OVER;
|
||||
}
|
||||
|
||||
if (alterReq.replications == 2) {
|
||||
if ((code = grantCheck(TSDB_GRANT_DUAL_REPLICA_HA)) != 0) {
|
||||
goto _OVER;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t numOfTopics = 0;
|
||||
if (mndGetNumOfTopics(pMnode, pDb->name, &numOfTopics) != 0) {
|
||||
goto _OVER;
|
||||
|
|
Loading…
Reference in New Issue