summaryrefslogtreecommitdiff
path: root/src/rabbit_recovery_terms.erl
Commit message (Collapse)AuthorAgeFilesLines
* stable to defaultSimon MacMullen2014-08-131-2/+20
|\
| * Upgrades to the queue index and recovery terms format.Simon MacMullen2014-08-051-2/+20
| |
* | BE more assertive.bug26341Simon MacMullen2014-08-131-3/+2
|/
* Update copyright for 2014bug25940Simon MacMullen2014-03-171-1/+1
|
* turns out we needed recursive=true after allMatthias Radestock2014-01-241-6/+8
| | | | ...but actually do this whole thing differently
* Ignore clean.dot read/delete errors during upgradesTim Watson2014-01-241-14/+4
|
* Improve recovery terms upgrade handlingTim Watson2014-01-231-6/+17
| | | | | | Use a more specific regex to locate the old clean.dot files. If reading an old clean.dot file fails, simply log the error. Ensure that we close the dets table after our upgrade step has run.
* Refactor rabbit_recovery_terms startupTim Watson2014-01-231-8/+6
| | | | | | | | 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.
* Refactor (recovery-terms restart strategy)Tim Watson2014-01-231-5/+2
| | | | | 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.
* API consistency, clarity and cosmetics:Matthias Radestock2014-01-231-25/+28
| | | | | | | | | | | - 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
* Refactor / maintain a clean interface to the backing queueTim Watson2014-01-141-39/+28
| | | | | | | | | | | 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.
* Refactor to avoid O(N*2) lookups during queue recoveryTim Watson2014-01-131-28/+35
| | | | | | | | | | | | | | | | | | | | | 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.
* cosmeticMatthias Radestock2014-01-131-35/+15
|
* Stop using the full path to the queue directory as the recovery keyTim Watson2014-01-101-4/+1
|
* Oops - relocating the recovery file broke our lookup functionTim Watson2014-01-091-2/+2
|
* We don?t need to ensure the mnesia_dir is present hereTim Watson2014-01-091-1/+0
|
* Store the recovery terms directly beneath RABBITMQ_MNESIA_DIRTim Watson2014-01-091-1/+1
|
* Cosmetic (ish)Tim Watson2014-01-091-22/+16
| | | | | | | - upgrade_recovery_{indexes => terms} - improved and consistent parameter names - uniform and properly aligned spec attributes - better naming convention for queue-dir / key handling
* Make sure we're storing the queue dir name not the old clean file nameTim Watson2014-01-091-1/+1
|
* Better handling of file system directories during shutdown/recoveryTim Watson2014-01-091-0/+1
| | | | | | | 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.
* Scrub un-used code and introduce a lookup-by-recovery-key APITim Watson2013-12-311-18/+21
|
* Trap exits and ensure we close the table on shutdownTim Watson2013-12-201-1/+3
|
* Rework/Refactor to handle recovery terms up-frontTim Watson2013-12-191-18/+25
| | | | | | | | 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.
* Rename the module tooTim Watson2013-12-181-1/+1
|
* Refactor: rabbit_recovery_indexes => rabbit_recovery_termsTim Watson2013-12-181-0/+141