| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
improve comment, cosmetic.
|
| |
|
| |
|
|
|
|
| |
step for QI. But I wanted to commit something...
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
all_queue_directory_names returns just names, not paths
Also, gain some efficiency by performing just one invocation of
rabbit_file:recursive_delete/1, with all dirs.
And some cosmetics.
|
| | |
|
| |
| |
| |
| | |
...and fix a counting error
|
|\ \
| |/
|/|
| | |
containing the recently merged bug25827
|
| |
| |
| |
| |
| | |
Avoid loading the journal when the file doesn?t exist.
Also try to avoid flushing the journal unless necessary.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rename rabbit_queue_index:{recover => start}/1.
Rename rabbit_shutdown_terms{recover => start}/0.
Stop handling supervisor child-start errors explicitly.
Add {rabbit_recovery_terms, rabbit_queue_index}:stop/0 variants.
Introduce a `stop? code path from BQ:stop/0 to qi:stop/0.
|
| |
| |
| |
| |
| | |
Use rabbit_sup:start_child/1, since a transient restart is fine.
Match on rabbit_recovery_terms:recover/0, since we want to crash if that fails.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- store/2 took a full dir path whereas read/1 only took the basename;
now they both take the basename.
- clearly separate the public API and the internal API in exports
- don't have specs for internal API
- remove unused UPGRADE_TABLE define
- ditch rabbit.hrl include - it was only needed for ?MAX_WAIT
- sensible order of function definitions, plus some separators for
clarity
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Strip extraneous comment lines and remove an unused function.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of passing amqqueue records to BQ:start/1, revert to passing
queue names and return a list of queue recovery terms ordered
identically to the given queue names. As a result, we can go back to
keying recovery data off the unique queue directory (base)name and no
longer need to track the queue name in the qi. We now also only need
the queue directory name to lookup recovery terms.
Also update the BQ interface documentation and callbacks/specs.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We remove knowledge of queue directories from rabbit_amqqueue, opting
to key index recovery terms off the amqqueue record name (which is a
resource record) instead. Although this simplifies the code somewhat
and avoid a potentially costly lookup during queue initialisation, it
does require a change to the backing queue API, since we now wish for
r_amqqueue:recover/0 to iterate over all the queues (paired with their
recovery terms, if any) and this means passing #amqqueue{} records
around instead of using a #resource{} and/or directory name as keys.
Also see rabbit_recovery_terms:read/1, which has gained an extra
parameter, since during upgrades we have no access to #amqqueue{}
records and /must/ therefore key any upgraded recovery data on the
queue directory (basename) instead. This double keyed lookup is
particularly gross since we could look the dirname up ourselves in
rabbit_recovery_terms:read/1, but doing so avoids the need to export
queue_name_to_dir_name from the qi _and_ calculating the MD5 on the
queue?s name twice, since the qi (which is calling into read/2) has
already done that anyway.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Ensure the ?queues? directory exists before attempting to sync the
recovery terms dets table. Drive qi recovery off the durable queues
we?re passed, rather than relying on the existence of queue dirs,
which are created lazily.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
We process all the recovery terms up-front, during qi recovery, and
clear + sync the dets table immediately afterwards. The recovery terms
and keys, based on the queue directory?s ?basename?, are then passed
throughout the initialisation process and checked in the various
places they?re used.
|
| |
| |
| |
| |
| | |
Inline check_clean_shutdown for improved clarity, move index table
recovery up into rabbit:recover/0, fix/update recovery index specs.
|
| |
| |
| |
| |
| | |
read_recovery_terms hides unused keys, better name for clean shutdown
checking and comment explaining why recovery_indexes is a gen_server.
|
| | |
|
|/
|
|
|
|
|
| |
We now hold a single dets table with all the queue recovery data.
This is synchronised after we've started up (at which point all
recovery data should be deleted) and just before shutting down,
after the queue indexes have writen their recovery data to it.
|
|\ |
|
| | |
|
|\ \
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Makes the on-disk journal format tolerant of runs of zeroes at the end of the file.
This could occur if file operations are interrupted by a crashing server.
Also changes the definition of segment prefixes so that runs of zero bytes will
never appear in a valid segment.
|
|/ |
|
| |
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
after spending hours trawling through the qi code and its history,
Matthew and I are convinced that qi:add_to_journal/3 is unnecessarily
general, handling a case that can never arise, namely adding an 'ack'
when we do have an entry for the given sequence number but that entry
does no contain a 'del'.
add_to_journal/3 gets called, indirectly, from four places:
1) load_journal/1. This is always called with no segements in the
State. So all the segment journal entries originate from the very
add_journal/3 code. And the only way we'd end up with an entry of the
form {Pub, no_del, no_ack} and get an 'ack' is if the journal
contained a pub and (later) an ack, with no del inbetween. That can
only happen through a misuse of the qi API. Which doesn't happen. And
there are plenty of other cases (e.g. duplicate dels or acks) where qi
insists on callers doing the right thing.
2) publish/5
This ends up adding a {?PUB, no_del, no_ack} entry, so is of no
direct concern to our investigation.
3) deliver_or_ack/3
This would hit the aforementioned {Pub, no_del, no_ack} & 'ack' case
only if we lost a 'del'.
4) recover_message/5
this only adds an 'ack' to the segment journal if either a) the
combination of the segment entries and the segment journal produces an
entry {?PUB, del, no_ack}, or b) it's just added a 'del' (thus making
a {Pub, no_del, no_ack} entry impossible). Re (a)... for there to be a
combined entry of {?PUB, del, no_ack} when the segment journal
contains {Pub, no_del, no_ack} (which would trigger the case we are
concerned about), the segment would have to contain a 'del' w/o a
'pub', which is impossible.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a pub, del and ack for a message are all recorded in the journal
then we don't bother writing any of that to the segment files when the
journal is flushed, since the message is well and truly in the past
and forgotten. So... there is no point keeping the entry in the
in-memory journal either, where it just eats up space until a flush
for no good reason.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
...so we don't bloat memory with stuff nobody cares about, and reduce
the qi->queue callbacks (to zero when no confirms/tx are used)
This does expose qi to a bit more messaging semantics, but imo to an
acceptable degree.
related changes:
- rename the state var to better capture its (revised) meaning
- only invoke the OnSyncFun when we have something to say
|