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 | 8deff82cb919b813e4ce954ce84f62cfc1683c01 (patch) | |
| tree | deb721506c168d479a2cd95076ae1122e7b609e8 | |
| parent | b6bcb05215c036c67b6724bc7d9c4ababf5ed034 (diff) | |
| download | rabbitmq-server-git-8deff82cb919b813e4ce954ce84f62cfc1683c01.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 1658b2ad3f..b12f85b89a 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; |
