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
commit93780fd09e67d8375853e0bf60eb88a371e05f63 (patch)
tree48eff652cf897a86ff2554f8b7b4b6e0943c978f
parentc3d1000a4db4a6148715ccb795306d98bc8923e9 (diff)
downloadrabbitmq-server-git-93780fd09e67d8375853e0bf60eb88a371e05f63.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 3914e93365..134762d7fb 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 }) ->