summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-09-03 11:55:53 +0100
committerMatthew Sackman <matthew@lshift.net>2009-09-03 11:55:53 +0100
commit538b8e5dd6c87583e8e983fb50f47b0508a15b2d (patch)
tree48eff652cf897a86ff2554f8b7b4b6e0943c978f
parent2aa8b3cb17bff0efef36e8a7c236593d94e4fef4 (diff)
downloadrabbitmq-server-538b8e5dd6c87583e8e983fb50f47b0508a15b2d.tar.gz
ensure that we fsync after copying messages across during compaction
-rw-r--r--src/rabbit_disk_queue.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rabbit_disk_queue.erl b/src/rabbit_disk_queue.erl
index 3914e933..134762d7 100644
--- a/src/rabbit_disk_queue.erl
+++ b/src/rabbit_disk_queue.erl
@@ -1445,7 +1445,6 @@ combine_files({Source, SourceValid, _SourceContiguousTop,
ok = copy_messages(SourceWorkList, DestinationValid, ExpectedSize,
SourceHdl, DestinationHdl, Destination, State1),
%% tidy up
- ok = file:sync(DestinationHdl),
ok = file:close(SourceHdl),
ok = file:close(DestinationHdl),
ok = file:delete(form_filename(Source)),
@@ -1487,6 +1486,7 @@ copy_messages(WorkList, InitOffset, FinalOffset, SourceHdl, DestinationHdl,
BSize1 = BlockEnd1 - BlockStart1,
{ok, BlockStart1} = file:position(SourceHdl, BlockStart1),
{ok, BSize1} = file:copy(SourceHdl, DestinationHdl, BSize1),
+ ok = file:sync(DestinationHdl),
ok.
close_file(File, State = #dqstate { read_file_handle_cache = HC }) ->