Bird
Raised Fist0
RabbitMQdevops~20 mins

Network partitions and split-brain in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
RabbitMQ Split-Brain Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens during a network partition in RabbitMQ?

Imagine a RabbitMQ cluster split into two groups by a network failure. What is the most likely outcome?

AThe cluster automatically merges messages without any risk of duplication.
BBoth groups continue accepting messages independently, risking data inconsistency (split-brain).
CAll nodes stop processing messages until the network is restored.
DOnly the master node processes messages; others become read-only.
Attempts:
2 left
💡 Hint

Think about what happens when two parts of a cluster can't communicate but still try to work.

💻 Command Output
intermediate
2:00remaining
Identify the output of RabbitMQ cluster status during a partition

Given a RabbitMQ cluster with nodes 'node1', 'node2', and 'node3', if 'node3' is isolated by a network partition, what will the rabbitmqctl cluster_status command show on 'node1'?

RabbitMQ
rabbitmqctl cluster_status
AShows 'node3' as running but with status 'stale'.
BShows all three nodes as running and connected.
CShows only 'node1' and 'node2' as running; 'node3' is missing or disconnected.
DShows an error and no cluster information.
Attempts:
2 left
💡 Hint

Consider what happens when a node is unreachable in a cluster status check.

❓ Troubleshoot
advanced
2:00remaining
Resolving split-brain in RabbitMQ cluster

You notice two partitions in your RabbitMQ cluster, each accepting messages independently. Which step should you take to safely resolve the split-brain?

AForcefully stop one partition and restart it to rejoin the cluster.
BRestart all nodes simultaneously to reset the cluster state.
CDelete all queues on both partitions to avoid conflicts.
DIgnore the partitions; RabbitMQ will automatically merge data later.
Attempts:
2 left
💡 Hint

Think about how to safely restore cluster consistency without losing messages.

✅ Best Practice
advanced
2:00remaining
Preventing split-brain in RabbitMQ clusters

Which configuration is best to prevent split-brain scenarios in RabbitMQ clusters?

AEnable the 'pause_minority' partition handling strategy.
BDisable all partition handling to keep nodes always running.
CUse manual node restarts after partitions occur.
DConfigure nodes to accept messages regardless of cluster state.
Attempts:
2 left
💡 Hint

Consider how RabbitMQ can automatically handle minority partitions.

🔀 Workflow
expert
3:00remaining
Order the steps to recover a RabbitMQ cluster after a network partition

Arrange the following steps in the correct order to safely recover a RabbitMQ cluster after a network partition causing split-brain.

A1,3,2,4
B2,3,1,4
C2,1,3,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about identifying data first, then stopping minority, then restarting.

Practice

(1/5)
1. What is a network partition in a RabbitMQ cluster?
easy
A. A message queue overflow
B. A single node failure in the cluster
C. A configuration error in RabbitMQ settings
D. A split in the cluster where nodes cannot communicate with each other

Solution

  1. Step 1: Understand network partition meaning

    A network partition occurs when parts of a RabbitMQ cluster lose communication with each other.
  2. Step 2: Identify the effect on cluster nodes

    Nodes separated by the partition cannot exchange messages or cluster state, causing split behavior.
  3. Final Answer:

    A split in the cluster where nodes cannot communicate with each other -> Option D
  4. Quick Check:

    Network partition = nodes disconnected [OK]
Hint: Network partition means cluster nodes lose communication [OK]
Common Mistakes:
  • Confusing partition with single node failure
  • Thinking partition is a config error
  • Assuming partition means message overflow
2. Which RabbitMQ command is used to set how the cluster handles network partitions?
easy
A. rabbitmqctl set_cluster_partition_handling
B. rabbitmqctl set_partition_mode
C. rabbitmqctl configure_network_partition
D. rabbitmqctl cluster_partition_policy

Solution

  1. Step 1: Recall RabbitMQ partition handling command

    The correct command to control partition handling is set_cluster_partition_handling.
  2. Step 2: Verify command syntax

    Other options are invalid or do not exist in RabbitMQ CLI.
  3. Final Answer:

    rabbitmqctl set_cluster_partition_handling -> Option A
  4. Quick Check:

    Partition handling command = set_cluster_partition_handling [OK]
Hint: Remember exact command: set_cluster_partition_handling [OK]
Common Mistakes:
  • Using incorrect command names
  • Confusing with cluster or network config commands
  • Misspelling the command
3. Given a RabbitMQ cluster split into two partitions, what happens if the partition handling is set to ignore?
medium
A. Both partitions continue operating independently, risking split-brain
B. The cluster automatically heals and merges partitions
C. The cluster shuts down all nodes until partition resolves
D. Messages are dropped until the partition is fixed

Solution

  1. Step 1: Understand 'ignore' partition handling

    When set to 'ignore', RabbitMQ nodes do not take action on partitions and continue working independently.
  2. Step 2: Identify consequence of ignoring partitions

    This causes split-brain where multiple cluster parts act as main cluster, risking data conflicts.
  3. Final Answer:

    Both partitions continue operating independently, risking split-brain -> Option A
  4. Quick Check:

    Ignore mode = independent operation, split-brain risk [OK]
Hint: 'ignore' means no action, partitions run separately [OK]
Common Mistakes:
  • Thinking cluster auto-heals with 'ignore'
  • Assuming cluster shuts down nodes
  • Believing messages are dropped automatically
4. You set RabbitMQ partition handling to pause_minority but the cluster does not pause any nodes during a partition. What is the likely cause?
medium
A. RabbitMQ does not support pause_minority mode
B. The command syntax was incorrect
C. The minority partition is not correctly identified
D. The cluster has only one node

Solution

  1. Step 1: Understand pause_minority behavior

    In pause_minority mode, RabbitMQ pauses nodes in the smaller partition to avoid split-brain.
  2. Step 2: Identify why no nodes paused

    If no nodes pause, likely the cluster did not detect which partition is minority, so no action taken.
  3. Final Answer:

    The minority partition is not correctly identified -> Option C
  4. Quick Check:

    Pause minority requires correct minority detection [OK]
Hint: Pause minority needs correct minority partition detection [OK]
Common Mistakes:
  • Assuming syntax error without checking logs
  • Believing pause_minority is unsupported
  • Ignoring cluster size and partition count
5. In a 5-node RabbitMQ cluster, a network partition splits the cluster into two parts: one with 3 nodes and one with 2 nodes. If the partition handling is set to autoheal, what will happen after the partition resolves?
hard
A. Both partitions will continue independently causing split-brain
B. The smaller partition nodes will be stopped and the cluster will heal automatically
C. The cluster will require manual intervention to merge
D. All nodes will restart automatically regardless of partition size

Solution

  1. Step 1: Understand autoheal partition handling

    Autoheal mode stops nodes in minority partitions and merges cluster state automatically after partition resolves.
  2. Step 2: Apply to given cluster split

    With 3 nodes vs 2 nodes, the 2-node partition is minority and will be stopped to avoid split-brain.
  3. Final Answer:

    The smaller partition nodes will be stopped and the cluster will heal automatically -> Option B
  4. Quick Check:

    Autoheal stops minority, merges cluster [OK]
Hint: Autoheal stops minority partition nodes after split [OK]
Common Mistakes:
  • Thinking autoheal allows split-brain
  • Assuming manual merge is always needed
  • Believing all nodes restart regardless
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard