diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-11-29 12:54:28 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-11-29 12:54:28 +0000 |
commit | 3e605d8d940c708f4586b5dd1064bff44d97b88c (patch) | |
tree | deb721506c168d479a2cd95076ae1122e7b609e8 | |
parent | 64b0a9b0ae9a9e5137bbc10436547c4b6457b4e0 (diff) | |
download | rabbitmq-server-3e605d8d940c708f4586b5dd1064bff44d97b88c.tar.gz |
Set depth_delta to undefined if something goes wrong. Or indeed if something goes right, but in that case we are about to overwrite it.
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 1658b2ad..b12f85b8 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -227,11 +227,10 @@ handle_cast({sync_start, Ref, Syncer}, backing_queue = BQ, backing_queue_state = BQS }) -> State1 = #state{rate_timer_ref = TRef} = ensure_rate_timer(State), - S = fun({TRefN, BQSN}) -> State1#state{rate_timer_ref = TRefN, + S = fun({TRefN, BQSN}) -> State1#state{depth_delta = undefined, + rate_timer_ref = TRefN, backing_queue_state = BQSN} end, %% [0] We can only sync when there are no pending acks - %% [1] The master died so we do not need to set_delta even though - %% we purged since we will get a depth instruction soon. case rabbit_mirror_queue_sync:slave( DD, Ref, TRef, Syncer, BQ, BQS, fun (BQN, BQSN) -> @@ -241,7 +240,7 @@ handle_cast({sync_start, Ref, Syncer}, {TRefN, BQSN1} end) of {ok, Res} -> noreply(set_delta(0, S(Res))); %% [0] - {failed, Res} -> noreply(S(Res)); %% [1] + {failed, Res} -> noreply(S(Res)); {stop, Reason, Res} -> {stop, Reason, S(Res)} end; |