diff options
| -rw-r--r-- | src/rabbit_queue_index.erl | 4 | ||||
| -rw-r--r-- | src/rabbit_variable_queue.erl | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl index 1e55add215..89dfe055fc 100644 --- a/src/rabbit_queue_index.erl +++ b/src/rabbit_queue_index.erl @@ -283,8 +283,8 @@ deliver(SeqIds, State) -> ack(SeqIds, State) -> deliver_or_ack(ack, SeqIds, State). -%% This is only called when there are outstanding confirms and the -%% queue is idle. +%% This is called when there are outstanding confirms or when the +%% queue is idle and the journal needs syncing (see needs_sync/1). sync(State = #qistate { journal_handle = undefined }) -> State; sync(State = #qistate { journal_handle = JournalHdl }) -> diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 28b7830e7d..99c14f0554 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -732,7 +732,7 @@ ram_duration(State = #vqstate { ram_ack_count_prev = RamAckCount }}. needs_timeout(State = #vqstate { index_state = IndexState }) -> - case needs_index_sync(State) of + case must_sync_index(State) of true -> timed; false -> case rabbit_queue_index:needs_sync(IndexState) of @@ -751,7 +751,7 @@ needs_timeout(State = #vqstate { index_state = IndexState }) -> timeout(State = #vqstate { index_state = IndexState }) -> IndexState1 = rabbit_queue_index:sync(IndexState), State1 = State #vqstate { index_state = IndexState1 }, - reduce_memory_use(State1). + a(reduce_memory_use(State1)). handle_pre_hibernate(State = #vqstate { index_state = IndexState }) -> State #vqstate { index_state = rabbit_queue_index:flush(IndexState) }. @@ -1277,8 +1277,8 @@ record_confirms(MsgIdSet, State = #vqstate { msgs_on_disk = MOD, unconfirmed = gb_sets:difference(UC, MsgIdSet), confirmed = gb_sets:union (C, MsgIdSet) }. -needs_index_sync(#vqstate { msg_indices_on_disk = MIOD, - unconfirmed = UC }) -> +must_sync_index(#vqstate { msg_indices_on_disk = MIOD, + unconfirmed = UC }) -> %% If UC is empty then by definition, MIOD and MOD are also empty %% and there's nothing that can be pending a sync. |
