summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Videla <videlalvaro@gmail.com>2015-08-27 19:47:06 +0200
committerAlvaro Videla <videlalvaro@gmail.com>2015-08-27 19:47:06 +0200
commit20e8f91e8b5b0c3163a2430d8dd6055707b6a90d (patch)
treef2d27ef4964194bf7f2f125f47e47da8178489a5 /src
parent713ccff1e4d686f5d6bd4c8a34f7eefa7817b2fa (diff)
downloadrabbitmq-server-git-20e8f91e8b5b0c3163a2430d8dd6055707b6a90d.tar.gz
maybe_write_index_to_disk_paging > maybe_batch_write_index_to_disk
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 708f00e0b3..54f04fd6f4 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -1372,18 +1372,21 @@ maybe_write_msg_to_disk(_Force, MsgStatus, State) ->
%% rabbit_queue_index:pre_publish/6 we need to have two separate
%% functions for index persistence. This one is only used when paging
%% during memory pressure.
-maybe_write_index_to_disk_paging(_Force, MsgStatus = #msg_status {
- index_on_disk = true }, State) ->
+maybe_batch_write_index_to_disk(_Force,
+ MsgStatus = #msg_status {
+ index_on_disk = true }, State) ->
{MsgStatus, State};
-maybe_write_index_to_disk_paging(Force, MsgStatus = #msg_status {
- msg = Msg,
- msg_id = MsgId,
- seq_id = SeqId,
- is_persistent = IsPersistent,
- is_delivered = IsDelivered,
- msg_props = MsgProps},
- State = #vqstate { disk_write_count = DiskWriteCount,
- index_state = IndexState })
+maybe_batch_write_index_to_disk(Force,
+ MsgStatus = #msg_status {
+ msg = Msg,
+ msg_id = MsgId,
+ seq_id = SeqId,
+ is_persistent = IsPersistent,
+ is_delivered = IsDelivered,
+ msg_props = MsgProps},
+ State = #vqstate {
+ disk_write_count = DiskWriteCount,
+ index_state = IndexState })
when Force orelse IsPersistent ->
{MsgOrId, DiskWriteCount1} =
case persist_to(MsgStatus) of
@@ -1396,7 +1399,7 @@ maybe_write_index_to_disk_paging(Force, MsgStatus = #msg_status {
{MsgStatus#msg_status{index_on_disk = true},
State#vqstate{index_state = IndexState1,
disk_write_count = DiskWriteCount1}};
-maybe_write_index_to_disk_paging(_Force, MsgStatus, State) ->
+maybe_batch_write_index_to_disk(_Force, MsgStatus, State) ->
{MsgStatus, State}.
maybe_write_index_to_disk(_Force, MsgStatus = #msg_status {
@@ -1435,7 +1438,7 @@ maybe_write_to_disk(ForceMsg, ForceIndex, MsgStatus, State) ->
maybe_prepare_write_to_disk(ForceMsg, ForceIndex, MsgStatus, State) ->
{MsgStatus1, State1} = maybe_write_msg_to_disk(ForceMsg, MsgStatus, State),
- maybe_write_index_to_disk_paging(ForceIndex, MsgStatus1, State1).
+ maybe_batch_write_index_to_disk(ForceIndex, MsgStatus1, State1).
determine_persist_to(#basic_message{
content = #content{properties = Props,
@@ -2104,7 +2107,7 @@ push_betas_to_deltas1(Generator, Limit, Q,
ram_bytes = CurrRamBytes}}};
{{value, MsgStatus = #msg_status { seq_id = SeqId }}, Qa} ->
{#msg_status { index_on_disk = true }, State1} =
- maybe_write_index_to_disk_paging(true, MsgStatus, State),
+ maybe_batch_write_index_to_disk(true, MsgStatus, State),
{Size, DeltaRam} = size_and_delta_ram(MsgStatus),
Delta1 = expand_delta(SeqId, Delta),
push_betas_to_deltas1(Generator, Limit, Qa,