Commit Graph

27 Commits

Author SHA1 Message Date
Loïc Hoguin 38f335e83b
Rework CQ stats code to be obvious and efficient 2022-09-27 12:00:08 +02:00
Loïc Hoguin 341e908bbf
CQ: Merge lazy/default behavior into a unified mode
No longer reduce memory usage as well (except an explicit GC
that I am pondering about removing).
2022-09-27 12:00:03 +02:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Loïc Hoguin 7198d4720b
Make backing_queue_SUITE fast on macOS
This very small patch requires extended explanations. The patch
swaps two lines in a rabbit_variable_queue setup: one which sets
the memory hint to 0 which results in reduce_memory_usage to
always flush to disk and fsync; and another which publishes a
lot of messages to the queue that will after that point be
manipulated further to get the queue in the exact right state
for the relevant tests.

The problem with calling reduce_memory_usage after every single
message has been published is not writing to disk (v2 tests do
not suffer from performance issues in that regard) but rather
that rabbit_queue_index will always flush its journal (containing
the one message), which results in opening the segment file,
appending to it, and closing it. The file handling is done
by file_handle_cache which, in this case, will always fsync
the data before closing the file. And that's this one fsync
per message that makes the relevant tests very slow.

By swapping the lines, meaning we publish all messages first
and then set the memory hint to 0, we end up with a single
reduce_memory_usage call that results in an fsync, at the
end. (There may be other fsyncs as part of normal operations.)
And still get the same result because all messages will have
been flushed to disk, only this time in far fewer operations.

This doesn't seem to have been causing problems on CI which
already runs the tests very fast but should help macOS and
possibly other development environments.
2022-03-18 13:26:57 +01:00
Luke Bakken c352525e0c
Rename `variable_queue_default_version` to `classic_queue_default_version` 2022-01-25 11:23:23 +01:00
Loïc Hoguin 44fd112e6d
Implement resuming v2->v1 conversion during dirty recovery 2022-01-25 11:23:16 +01:00
Loïc Hoguin 92d95bf5c7
Fix unused vars warning in classic_queue_SUITE 2022-01-25 11:23:14 +01:00
Loïc Hoguin 469788a820
Ensure index files with holes get removed
On dirty recovery the count in the segment file was already
accurate. It was not accurate otherwise as it assumed that
all messages would be written to the index, which is not
the case in the current implementation.
2022-01-25 11:23:14 +01:00
Loïc Hoguin 467309418c
Reenable some checks in backing_queue_SUITE 2022-01-25 11:23:13 +01:00
Loïc Hoguin 9f15f86252
CQ version switch via policies + proper test for this 2022-01-25 11:23:10 +01:00
Loïc Hoguin 3fc1eb14de
Fix remaining tests for CQ v1 2022-01-25 11:23:09 +01:00
Loïc Hoguin c4672b6f2c
Test both indexes 2022-01-25 11:23:09 +01:00
Loïc Hoguin 6dfe6a7be8
Test both CQ v1 and v2 2022-01-25 11:23:09 +01:00
Loïc Hoguin ad67f787ab
Reenable embed 0/1024 groups and fix embed 0 recovery 2022-01-25 11:23:06 +01:00
Loïc Hoguin 2473ff7328
Reenable some tests that were commented out 2022-01-25 11:23:05 +01:00
Loïc Hoguin b0b9b46313
Fix remaining tests 2022-01-25 11:23:04 +01:00
Loïc Hoguin c02de4d252
Some cleanup and fix most tests
Still need to improve recovery and do some sort of check in the
store so we know the file isn't corrupted.
2022-01-25 11:23:04 +01:00
Loïc Hoguin fc9846d01d
Fix obvious mistakes in previous commit 2022-01-25 11:23:04 +01:00
Loïc Hoguin 33fada8847
Track delivers per-queue rather than per-message
Because queues deliver messages sequentially we do not need to
keep track of delivers per message, we just need to keep track
of the highest message that was delivered, via its seq_id().

This allows us to avoid updating the index and storing data
unnecessarily and can help simplify the code (not seen in this
WIP commit because the code was left there or commented out
for the time being).

Includes a few small bug fixes.
2022-01-25 11:23:03 +01:00
Loïc Hoguin cf080b9937
Add file_handle_cache FD reservations 2022-01-25 11:23:02 +01:00
Loïc Hoguin 0102191e2b
Rename to rabbit_classic_queue_index_v2 2022-01-25 11:23:00 +01:00
Loïc Hoguin 0f431876f2
No longer tests with different embed settings
Since messages are no longer embedded those settings are ignored.
2022-01-25 11:22:58 +01:00
Loïc Hoguin 98f64f2fa8
Replace classic queue index with a modern implementation 2022-01-25 11:22:56 +01:00
Loïc Hoguin 24c25ab3cc
Add tests for the regression introduced in #3041 2021-08-11 12:50:04 +02:00
Loïc Hoguin d9344b2b58
Set segment_entry_count per vhost and use a better default
The new default of 2048 was chosen based on various scenarios.
It provides much better memory usage when many queues are used
(allowing one host to go from 500 queues to 800+ queues) and
there seems to be none or negligible performance cost (< 1%)
for single queues.
2021-05-11 10:45:28 +02:00
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
Philip Kuryloski a1fe3ab061 Change repo "root" to deps/rabbit
rabbit must not be the monorepo root application, as other applications depend on it
2020-11-13 14:34:42 +01:00