diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-07-08 14:28:01 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-07-08 14:28:01 +0100 |
| commit | bcd079cd3960b7aa3259148f825898410f5477e2 (patch) | |
| tree | f7a004427d7eb6edb794ea8c7b1c44420da38eb7 /include | |
| parent | cc9b1438b2441ebc7bc3c345fbc2b2b1f528821a (diff) | |
| download | rabbitmq-server-git-bcd079cd3960b7aa3259148f825898410f5477e2.tar.gz | |
added requeue_next_n to disk_queue and made use of it in mixed_queue:to_disk_only_mode. This function puts the next N messages at the front of the queue to the back and is MUCH more efficient than calling phantom_deliver and then requeue_with_seqs. This means that a queue which has been sent to disk, then converted back to mixed mode, some minor been done, and then sent back to disk takes almost no time in transitions beyond the first transition. The test of this:
1) declare durable queue
2) send 100,000 persistent messages to it
3) send 100,000 non-persistent messages to it
4) send 100,000 persistent messages to it
5) now pin it to disk - it'll make two calls to requeue_next_n and should be rather quick as it's only the middle 100,000 messages that actually have to be written, the other 200,000 don't even get sent between the disk_queue and mixed_queue in either direction. A total of 100,003 calls are necessary for this transition: 2 requeue_next_n, 100,000 tx_publish, 1 tx_commit
6) now unpin it from disk and list the queues to wake it up. The transition to mixed_mode is one call, zero reads, and instantaneous
7) now repin it to disk. The mixed queue knows everything is still on disk, so it makes one call to requeue_next_n with N = 300,000. The disk_queue sees this is the whole queue and so doesn't need to do any work at all and so is instant.
All tests pass.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
