summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-09-25 19:08:27 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-09-25 19:08:27 +0100
commitcbb21d811a3b503a32dbaa35fea69cbf7d33d57c (patch)
treeb3588f8f8da2ea53969abd81020ecde444e4c783
parentf9fb42cee26f7f349d89342acc69795c5f9538df (diff)
downloadrabbitmq-server-cbb21d811a3b503a32dbaa35fea69cbf7d33d57c.tar.gz
put the assertion back. This time more explictly.
-rw-r--r--src/rabbit_mirror_queue_slave.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index e52c570e..dcc7e5f6 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -894,10 +894,9 @@ update_delta_from_master(NewDelta, State = #state { depth_delta = Delta }) ->
update_delta(_DeltaChange, State = #state { depth_delta = undefined }) ->
State;
update_delta(DeltaChange, State = #state { depth_delta = Delta }) ->
- %% We intentionally leave out the head where a slave becomes
- %% unsynchronised: we assert that can never happen.
case {Delta, Delta + DeltaChange} of
- {0, 0} -> State;
+ {0, N} -> 0 = N, %% assertion: we cannot become unsync'ed
+ State;
{_, 0} -> ok = record_synchronised(State#state.q),
State #state { depth_delta = 0 };
{_, N} when N > 0 -> State #state { depth_delta = N }