summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove syslog from DEPSkjnilsson2018-10-301-1/+1
| | | | It was mistakenly put back in a merge.
* Update rabbitmq-components.mkkjnilsson2018-10-291-2/+1
|
* Quorum queues (#1706)Karl Nilsson2018-10-2935-395/+6623
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Test queue.declare method with quorum type [#154472130] * Cosmetics [#154472130] * Start quorum queue Includes ra as a rabbit dependency [#154472152] * Update info and list operations to use quorum queues Basic implementation. Might need an update when more functionality is added to the quorum queues. [#154472152] * Stop quorum queue [#154472158] * Restart quorum queue [#154472164] * Introduce UId in ra config to support newer version of ra Improved ra stop [#154472158] * Put data inside VHost specific subdirs [#154472164] * Include ra in rabbit deps to support stop_app/start_app command [#154472164] * Stop quorum queues in `rabbit_amqqueue:stop/1` [#154472158] * Revert creation of fifo ets table inside rabbit Now supported by ra [#154472158] * Filter quorum queues [#154472158] * Test restart node with quorum queues [#154472164] * Publish to quorum queues [#154472174] * Use `ra:restart_node/1` [#154472164] * Wait for stats to be published when querying quorum queues [#154472174] * Test publish and queue length after restart [#154472174] * Consume messages from quorum queues with basic.get [#154472211] * Autoack messages from quorum queues on basic.get [#154472211] * Fix no_ack meaning no_ack = true is equivalent to autoack [#154472211] * Use data_dir as provided in the config If we modify the data_dir, ra is not able to delete the data when a queue is deleted [#154472158] * Remove unused code/variables [#154472158] * Subscribe to a quorum queue Supports auto-ack [#154472215] * Ack messages consumed from quorum queues [#154472221] * Nack messages consumed from quorum queues [#154804608] * Use delivery tag as consumer tag for basic.get in quorum queues [#154472221] * Support for publisher confirms in quorum queues [#154472198] * Integrate with ra_fifo_client * Clear queue state on queue.delete [#154472158] * Fix quorum nack [#154804608] * Test redelivery after nack [#154804608] * Nack without requeueing [#154472225] * Test multiple acks [#154804208] * Test multiple nacks [#154804314] * Configure dead letter exchange with queue declare [#155076661] * Use a per-vhost process to handle dead-lettering Needs to hold state for quorum queues [#155401802] * Implement dead-lettering on nack'ed messages [#154804620] * Use queue name as a resource on message delivery Fixes a previously introduced bug [#154804608] * Handle ra events on dead letter process [#155401802] * Pass empty queue states to queue delete Queue deletion on vhost deletion calls directly to rabbit_amqqueue. Queue states are not available, but we can provide an empty map as in deletion the states are only needed for cleanup. * Generate quorum queue stats and events Consumer delete events are still pending, as depend on basic.cancel (not implemented yet), ra terminating or ra detecting channel down [#154472241] * Ensure quorum mapping entries are available before metric emission [#154472241] * Configure data_dir, uses new RABBITMQ_QUORUM_BASE env var [#154472152] * Use untracked enqueues when sending wihtout channel Updated several other calls missed during the quorum implementation * Revert "Configure data_dir, uses new RABBITMQ_QUORUM_BASE env var" This reverts commit f2261212410affecb238fcbd1fb451381aee4036. * Configure data_dir, uses new RABBITMQ_QUORUM_DIR based on mnesia dir [#154472152] * Fix get_quorum_state * Fix calculation of quorum pids * Move all quorum queues code to its own module [#154472241] * Return an error when declaring a quorum queue with an incompatible argument [#154521696] * Cleanup of quorum queue state after queue delete Also fixes some existing problems where the state wasn't properly stored [#155458625] * Revert Revert "Declare a quorum queue using the queue.declare method" * Remove duplicated state info [#154472241] * Start/stop multi-node quorum queue [#154472231] [#154472236] * Restart nodes in a multi-node quorum cluster [#154472238] * Test restart and leadership takeover on multiple nodes [#154472238] * Wait for leader down after deleting a quorum cluster It ensures an smooth delete-declare sequence without race conditions. The test included here detected the situation before the fix. [#154472236] * Populate quorum_mapping from mnesia when not available Ensures that leader nodes that don't have direct requests can get the mapping ra name -> queue name * Cosmetics * Do not emit core metrics if queue has just been deleted * Use rabbit_mnesia:is_process_alive Fixes bug introduced by cac9583e1bb2705be7f06c2ab7f416a75d11c875 [#154472231] * Only try to report stats if quorum process is alive * Implement cancel consumer callback Deletes metrics and sends consumer deleted event * Remove unnecessary trigger election call ra:restart_node has already been called during the recovery * Apply cancellation callback on node hosting the channel * Cosmetics * Read new fifo metrics which store directly total, ready and unack * Implement basic.cancel for quorum queues * Store leader in amqqueue record, report all in stats [#154472407] * Declare quorum queue in mnesia before starting the ra cluster Record needs to be stored first to update the leader on ra effects * Revert * Purge quorum queues [#154472182] * Improve use of untracked_enqueue Choose the persisted leader id instead of just using the id of the leader at point of creation. * Store quorum leader in the pid field of amqqueue record Same as mirrored queues, no real need for an additional field * Improve recovery When a ra node has never been started on a rabbit node ensure it doesn't fail but instead rebuilds the config and starts the node as a new node. Also fix issue when a quorum queue is declared when one of it's rabbit nodes are unavailable. [#157054606] * Cleanup core metrics after leader change [#157054473] * Return an error on sync_queue on quorum queues [#154472334] * Return an error on cancel_sync_queue on quorum queues [#154472337] * Fix basic_cancel and basic_consume return values Ensure the quorum queue state is always returned by these functions. * Restore arity of amqqeueu delete and purge functions. This avoids some breaking changes in the cli. * Fix bug returning consumers. * remove rogue debug log * Integrate ingress flow control with quorum queues [#157000583] * Configure commands soft limit [#157000583] * Support quorum pids on rabbit_mnesia:is_process_alive * Publish consumers metric for quorum queues * Whitelist quorum directory in is_virgin_node Allow the quorum directoy to exist without affecting the status of the Rabbit node. * Delete queue_metrics on leader change. Also run the become_leader handler in a separate process to avoid blocking. [#157424225] * Report cluster status in quorum queue infos. New per node status command. Related to [#157146500] * Remove quorum_mapping table As we can store the full queue name resource as the cluster id of the ra_fifo_client state we can avoid needed the quorum_mapping table. * Fix xref issue * Provide quorum members information in stats [#157146500] * fix unused variable * quorum queue multiple declare handling Extend rabbit_amqqueue:internal_declare/2 to indicate if the queue record was created or exisiting. From this we can then provide a code path that should handle concurrent queue declares of the same quorum queue. * Return an error when declaring exclusive/auto-delete quorum queue [#157472160] * Restore lost changes from 79c9bd201e1eac006a42bd162e7c86df96496629 * recover another part of commit * fixup cherry pick * Ra io/file metrics handler and stats publishing [#157193081] * Revert "Ra io/file metrics handler and stats publishing" This reverts commit 05d15c786540322583fc655709825db215b70952. * Do not issue confirms on node down for quorum queues. Only a ra_event should be used to issue positive confirms for a quorum queue. * Ra stats publishing [#157193081] * Pick consumer utilisation from ra data [#155402726] * Handle error when deleting a quorum queue and all nodes are already down This is in fact a successful deletion as all raft nodes are already 'stopped' [#158656366] * Return an error when declaring non-durable quorum queues [#158656454] * Rename dirty_query to committed_query * Delete stats on leader node [#158661152] * Give full list of nodes to fifo client * Handle timeout in quorum basic_get * Fix unused variable error * Handle timeout in basic get [#158656366] * Force GC after purge [#158789389] * Increase `ra:delete_cluster` timeout to 120s * Revert "Force GC after purge" This reverts commit 5c98bf22994eb39004760799d3a2c5041d16e9d4. * Add quorum member command [#157481599] * Delete quorum member command [#157481599] * Implement basic.recover for quorum queues [#157597411] * Change concumer utilisation to use the new ra_fifo table and api. * Set max quorum queue size limit Defaults to 7, can be configured per queue on queue.declare Nodes are selected randomly from the list of nodes, but the one that is executing the queue.declare command [#159338081] * remove potentially unrelated changes to rabbit_networking * Move ra_fifo to rabbit Copied ra_fifo to rabbit and renamed it rabbit_fifo. [#159338031] * rabbit_fifo tidy up * rabbit_fifo tidy up * rabbit_fifo: customer -> consumer rename * Move ra_fifo tests [#159338031] * Tweak quorum_queue defaults * quorum_queue test reliability * Optimise quorum_queue test suite. By only starting a rabbit cluster per group rather than test. [#160612638] * Renamings in line with ra API changes * rabbit_fifo fixes * Update with ra API changes Ra has consolidated and simplified it's api. These changes update to confirm to that. * Update rabbit_fifo with latest ra changes * Clean up out of date comment * Return map of states * Add test case for basic.get on an empty queue Before the previous patch, any subsequent basic.get would crash as the map of states had been replaced by a single state. * Clarify use of deliver tags on record_sent * Clean up queues after testcase * Remove erlang monitor of quorum queues in rabbit_channel The eol event can be used instead * Use macros to make clearer distinctions between quorum/classic queues Cosmetic only * Erase queue stats on 'eol' event * Update to follow Ra's cluster_id -> cluster_name rename. * Rename qourum-cluster-size To quorum-initial-group-size * Issue confirms on quorum queue eol Also avoid creating quorum queue session state on queue operation methods. * Only classic queues should be notified on channel down * Quorum queues do not support global qos Exit with protocol error of a basic.consume for a quorum queue is issued on a channel with global qos enabled. * unused variable name * Refactoring Strictly enfornce that channels do not monitor quorum queues. * Refactor foreach_per_queue in the channel. To make it call classic and quorum queues the same way. [#161314899] * rename function * Query classic and quorum queues separately during recovery as they should not be marked as stopped during failed vhost recovery. * Remove force_event_refresh function As the only user of this function, the management API no longer requires it. * fix errors * Remove created_at from amqqueue record [#161343680] * rabbit_fifo: support AMQP 1.0 consumer credit This change implements an alternative consumer credit mechanism similar to AMQP 1.0 link credit where the credit (prefetch) isn't automatically topped up as deliveries are settled and instead needs to be manually increased using a credit command. This is to be integrated with the AMQP 1.0 plugin. [#161256187] * Add basic.credit support for quorum queues. Added support for AMQP 1.0 transfer flow control. [#161256187] * Make quorum queue recover idempotent So that if a vhost crashes and runs the recover steps it doesn't fail because ra servers are still running. [#161343651] * Add tests for vhost deletion To ensure quorum queues are cleaned up on vhost removal. Also fix xref issue. [#161343673] * remove unused clause * always return latest value of queue * Add rabbitmq-queues scripts. Remove ra config from .bat scripts. * Return error if trying to get quorum status of a classic queue.
* Use --no-table-headers with list_* CLI commandsMichael Klishin2018-10-244-11/+12
| | | | | | | | The suites do not expect (or care for) the header row. Per discussion with @dumbbell @hairyhum. References rabbitmq/rabbitmq-cli#264.
* Merge pull request #1745 from rabbitmq/rabbitmq-server-1712Luke Bakken2018-10-233-5/+91
|\ | | | | Expose cipher configuration to new style config format
| * Expose cipher configuration to new style config formatMichael Klishin2018-10-233-5/+91
|/ | | | | | | | As ssl_options.ciphers.$cipher. Closes #1712. [#160792113]
* Merge pull request #1738 from ar7z1/masterMichael Klishin2018-10-191-0/+4
|\ | | | | Improve error reporting in rabbitmq-server.bat
| * Improve error reporting in rabbitmq-server.batArtem Zinenko2018-10-181-0/+4
|/
* Merge pull request #1736 from ar7z1/masterMichael Klishin2018-10-183-0/+12
|\ | | | | Improve error reporting in rabbitmqctl.bat
| * Cleanup EXIT case-styleArtem Zinenko2018-10-171-1/+1
| |
| * Improve error reporting in rabbitmq-diagnostics.batArtem Zinenko2018-10-171-0/+4
| |
| * Improve error reporting in rabbitmq-plugins.batArtem Zinenko2018-10-171-0/+4
| |
| * Fixes #1735: Improve error reporting in rabbitmqctl.batArtem Zinenko2018-10-171-0/+4
|/
* Merge pull request #1733 from rabbitmq/lrb-fix-logger-badmatchMichael Klishin2018-10-161-0/+3
|\ | | | | Catch one more error when disabling default logger
| * Catch one more error when disabling default loggerLuke Bakken2018-10-151-0/+3
|/ | | | Related to #1718 and #1728
* Merge pull request #1728 from rabbitmq/rabbitmq-server-1718-syslog-localhostMichael Klishin2018-10-124-41/+94
|\ | | | | Only start syslog application if it is required
| * Only start syslog application if it is requiredLuke Bakken2018-10-124-41/+94
|/ | | | | | Fix up syslog protocol options to set ip to localhost if unset Ensure default handler for OTP 21.1+ logger is removed
* Merge pull request #1731 from rabbitmq/rabbitmq-server-1709Luke Bakken2018-10-111-2/+7
|\ | | | | Ensure EPMD env vars are exported if set
| * Ensure EPMD env vars are exported if setLuke Bakken2018-10-111-2/+7
|/ | | | Fixes #1709
* Merge pull request #1730 from rabbitmq/rabbitmq-server-1711Luke Bakken2018-10-101-17/+46
|\ | | | | Refactor listener startup error handling
| * Refactor listener startup error handlingMichael Klishin2018-10-111-17/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions that start listeners (Ranch supervisors) no longer throw on errors. They simply return the first error encountered and let the boot step handle it. Since there is no way for boot steps to indicate errors, this is the best we can do in this area without a much deeper refactoring of the boot sequence. In addition they also log the error. Note that modern Ranch versions log more reasonable messages when Ranch supervisors exit due to a listen/bind socket operation error, e.g. when the address/port pair is already in use. Closes #1711 (for now), covers #1729 for the server as a drive-by change. [#160791138] [#161136615]
* | Merge pull request #1726 from rabbitmq/rabbitmq-server-1723Michael Klishin2018-10-111-0/+2
|\ \ | |/ |/| Report connection/channel/queue churn
| * Report connection/channel/queue churnDiana Corbacho2018-10-081-0/+2
|/ | | | | Rate metrics for monitoring of high connection churn scenarios [#160943831]
* A testcase to verify confirms-rejects race condition fixed in ↵Daniil Fedotov2018-10-041-0/+156
| | | | | | 8b37501451d2ef66dbf16b62b84684b74157dcbc. The testcase takes about 15-20 seconds, therefore a separate suite.
* Merge pull request #1720 from rabbitmq/rabbitmq-cli-261Michael Klishin2018-10-043-7/+17
|\ | | | | Support changes for `rabbitmq-plugins directories`
| * plugins_dist_dir/0 => plugins_dir/0Michael Klishin2018-10-031-6/+6
| | | | | | | | To match the name commonly used elsewhere.
| * Merge branch 'master' into rabbitmq-cli-261Michael Klishin2018-10-032-19/+37
| |\
| * | Don't force -q in rabbitmq-pluginsMichael Klishin2018-10-021-1/+1
| | |
| * | Merge branch 'master' into rabbitmq-cli-261Michael Klishin2018-09-281-12/+12
| |\ \
| * | | Don't force --formatter=plugins on rabbitmq-plugins commandsMichael Klishin2018-09-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | They already use the correct one. Per discussion with @hairyhum. [#160792758]
| * | | rabbitmq_plugins: export plugins_dist_dir/0, plugins_expand_dir/0, introduce ↵Michael Klishin2018-09-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enabled_plugins_file/0 Part of rabbitmq/rabbitmq-cli#261. [#160792758]
* | | | Merge pull request #1719 from rabbitmq/rejects-confirms-interdependencyMichael Klishin2018-10-031-38/+48
|\ \ \ \ | |_|_|/ |/| | | Take reject into account when sending confirms and vice-versa.
| * | | removed TODODaniil Fedotov2018-10-031-1/+0
| | | |
| * | | Fix min function to lists:min instead of erlang:min.Daniil Fedotov2018-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The cutoff value should be a number, corresponding to the minimal uncommitted or rejected message (or confirmed if sending rejects). erlang:min compares term values and will not traverse a list of NegativeMsgSeqNos.
| * | | Naming; use erlang:min/2 instead of lists:min/1Michael Klishin2018-10-021-3/+3
| | | |
| * | | Take reject into account when sending confirms and vice-versa.Daniil Fedotov2018-10-011-37/+48
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before bf531fd017cbec756ee979299723adce76828c96 rejects were not collected like confirms and extracted from unconfirmed. When adding the feature the important detail was missed: if unconfirmed dtree is empty, confirms will be sent as multiple confirming all messages up to latest. If there are rejects recorded, the channel can send multiple confirm and then reject right after with a lower message ID, which makes clients fail. Reported in php-amqplib/php-amqplib#597
* | | Merge pull request #1715 from rabbitmq/bindings-optimisationMichael Klishin2018-10-032-19/+37
|\ \ \ | |/ / |/| | Bindings optimisation
| * | Replace match_object with dirty_match_object for binding cleanup.Daniil Fedotov2018-09-282-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | match_object locks entire table, we'd like to avoid that. It's possible to not call delete_for_source if exchange is autodeleted. Checking an autodelete exchange will lock table on scanning for outgoing bindings anyway. But other cases will not lock the table.
| * | Use delete instead of delete_object and read instead of match_object in ↵Daniil Fedotov2018-09-281-8/+20
|/ / | | | | | | | | | | | | | | | | bindings where possible. Route table key contains all the route information, which makes delete equivalent to delete_object. But it's faster. For the same reason match_object with a full object is equivalent to read.
* | Update test expectionskjnilsson2018-09-281-12/+12
|/ | | | | To match the metrics format that includes the new basic_get empty metric.
* Merge pull request #1714 from rabbitmq/rabbitmq-cli-260Michael Klishin2018-09-272-4/+23
|\ | | | | Make rabbit_vhost:add/2 idempotent
| * Delete vhost at the end of this testMichael Klishin2018-09-281-3/+7
| |
| * Make rabbit_vhost:add/2 idempotentMichael Klishin2018-09-272-4/+19
| | | | | | | | | | | | Part of rabbitmq/rabbitmq-cli#260 [#160792770]
* | Fix bug in metrics gckjnilsson2018-09-271-1/+1
|/ | | | | The metrics cleanup for the channel_queue_metrics didn't handle the updated metrics tuple arity.
* Merge pull request #1701 from rabbitmq/get-empty-statsMichael Klishin2018-09-251-0/+1
|\ | | | | Add basic.get_empty stats as a new counter
| * Add get empty stats as a new counterDiana Corbacho2018-09-171-0/+1
| | | | | | | | | | Basic.get requests that return ok_empty used to be unaccounted for [#160280626]
* | Update rabbitmq-components.mkJean-Sébastien Pédron2018-09-191-2/+2
| |
* | tcp_listener_sup: Switch to ranch:child_spec/5Jean-Sébastien Pédron2018-09-191-5/+11
|/ | | | ranch:child_spec/6 is deprecated.
* Merge pull request #1700 from rabbitmq/rabbitmq-server-1699Michael Klishin2018-09-172-31/+102
|\ | | | | Make pg_local:member_died/2 more resilient
| * ClarifyMichael Klishin2018-09-171-1/+1
| |