summaryrefslogtreecommitdiff
path: root/generate_app
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-09-01 15:47:19 +0100
committerMatthew Sackman <matthew@lshift.net>2009-09-01 15:47:19 +0100
commitd4848d68012418c78c39fdbfc4a5bf38588c7501 (patch)
treeaf40a6c0d15727beefabb6ee90e6188c65426375 /generate_app
parent590800c2b2711c79cc87981afc67b7f6d903532d (diff)
downloadrabbitmq-server-git-d4848d68012418c78c39fdbfc4a5bf38588c7501.tar.gz
Before the magic_marker_msg was introduced, if the queue was entirely on disk already and was then told to go to disk_only mode, it would form a single requeue_next_n call, where the N would be the length of the queue. This would be detected by the disk_queue and become a no-op. Because of the introduction of the magic_marker_msg, that is no longer possible - we want the marker to go from the back of the queue to the front. As such, the N will at most be 1 less than the queue length, causing unnecessary work to be done.
This patch removes unnecessary work by observing that we do not need to rotate the entire queue should we find that the queue consists of zero or more disk-stored msgs followed by zero or more ram-only stored messages. If this is the case, we only need to publish the latter ram-only messages, and have no need for the magic marker msgs at all. Furthermore, if there are no ram-only messages we have no work to do at all. The only situation in which we must rotate the entire queue is when we have ram-only messages followed by disk messages. In this case, we have to get the ram-only messages onto the disk queue before the disk messages, which requires the full rotation.
Diffstat (limited to 'generate_app')
0 files changed, 0 insertions, 0 deletions