Skip to content

Commit

Permalink
TEST 2
Browse files Browse the repository at this point in the history
Signed-off-by: Utkarsh Bhatt <[email protected]>
  • Loading branch information
UtkarshBhatthere committed Oct 10, 2024
1 parent 2e0e2b2 commit cfab8ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions microceph/ceph/replication_rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,17 +470,21 @@ func handlePoolDePro(rh *RbdReplicationHandler, poolName string) error {
logger.Infof("REPRBD: op(%s), pool(%s)", rh.Request.RequestType, poolName)

for _, peer := range poolInfo.Peers {
logger.Infof("REPRBD: op(%s), pool(%s), peer(%s)", rh.Request.RequestType, poolName, peer.RemoteName)
// Perform operation only if the remote cluster is a known peer.
if peer.RemoteName == rh.Request.RemoteName {
if rh.Request.RequestType == constants.EventPromoteReplication {
logger.Infof("REPRBD: YES")
if rh.Request.RequestType == types.PromoteReplicationRequest {
logger.Infof("REPRBD: PROMOTE")
// Promote the pool to primary.
err := handlePoolPromotion(rh, poolName)
if err != nil {
// Stop if failed.
logger.Errorf("REPRBD: failed to promote local site to primary: %v", err)
return err
}
} else if rh.Request.RequestType == constants.EventDemoteReplication {
} else if rh.Request.RequestType == types.DemoteReplicationRequest {
logger.Infof("REPRBD: DEMOTE")
// Demote the pool to secondary.
err := handlePoolDemotion(rh, poolName)
if err != nil {
Expand Down

0 comments on commit cfab8ec

Please sign in to comment.