-
Notifications
You must be signed in to change notification settings - Fork 4k
Quorum queues #1706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Quorum queues #1706
Changes from all commits
Commits
Show all changes
180 commits
Select commit
Hold shift + click to select a range
9ff9afd
Test queue.declare method with quorum type
dcorbacho 5e9e1d5
Cosmetics
dcorbacho 740397d
Merge pull request #1480 from rabbitmq/rabbitmq-server-story-154472130
dcorbacho c088ee1
Start quorum queue
dcorbacho 37d70cf
Update info and list operations to use quorum queues
dcorbacho 64c5670
Stop quorum queue
dcorbacho d142ce1
Restart quorum queue
dcorbacho db69aca
Introduce UId in ra config to support newer version of ra
dcorbacho a02443e
Put data inside VHost specific subdirs
dcorbacho 5df8283
Include ra in rabbit deps to support stop_app/start_app command
dcorbacho ab02485
Stop quorum queues in `rabbit_amqqueue:stop/1`
dcorbacho f4aab4c
Revert creation of fifo ets table inside rabbit
dcorbacho e6f4bab
Filter quorum queues
dcorbacho 97fb029
Test restart node with quorum queues
dcorbacho a27f601
Publish to quorum queues
dcorbacho a36366d
Use `ra:restart_node/1`
dcorbacho 9b53bfe
Wait for stats to be published when querying quorum queues
dcorbacho 88139c4
Test publish and queue length after restart
dcorbacho faec336
Consume messages from quorum queues with basic.get
dcorbacho 74346ac
Autoack messages from quorum queues on basic.get
dcorbacho a59f6bc
Fix no_ack meaning
dcorbacho 063d3bb
Use data_dir as provided in the config
dcorbacho 078d457
Remove unused code/variables
dcorbacho c272d87
Subscribe to a quorum queue
dcorbacho 8c59478
Ack messages consumed from quorum queues
dcorbacho 672676c
Nack messages consumed from quorum queues
dcorbacho 45a7bac
Use delivery tag as consumer tag for basic.get in quorum queues
dcorbacho c62eed0
Support for publisher confirms in quorum queues
dcorbacho 494c148
Integrate with ra_fifo_client
dcorbacho 4fd4528
Clear queue state on queue.delete
dcorbacho dafad5f
Fix quorum nack
dcorbacho f340cee
Test redelivery after nack
dcorbacho 9ae419c
Nack without requeueing
dcorbacho 95e6e61
Test multiple acks
dcorbacho 8838854
Test multiple nacks
dcorbacho 64db6c0
Configure dead letter exchange with queue declare
dcorbacho 56d3b92
Use a per-vhost process to handle dead-lettering
dcorbacho 514c2b6
Implement dead-lettering on nack'ed messages
dcorbacho 4ac8f54
Use queue name as a resource on message delivery
dcorbacho 323169d
Handle ra events on dead letter process
dcorbacho e664418
Pass empty queue states to queue delete
dcorbacho dccda71
Generate quorum queue stats and events
dcorbacho 448c934
Ensure quorum mapping entries are available before metric emission
dcorbacho f226121
Configure data_dir, uses new RABBITMQ_QUORUM_BASE env var
dcorbacho 46006a3
Use untracked enqueues when sending wihtout channel
dcorbacho 1718286
Revert "Configure data_dir, uses new RABBITMQ_QUORUM_BASE env var"
dcorbacho 2cd935c
Configure data_dir, uses new RABBITMQ_QUORUM_DIR based on mnesia dir
dcorbacho 2064eb3
Fix get_quorum_state
dcorbacho 43f6010
Fix calculation of quorum pids
dcorbacho d8a01b7
Move all quorum queues code to its own module
dcorbacho 79f1407
Return an error when declaring a quorum queue with an incompatible ar…
dcorbacho 3a9918a
Cleanup of quorum queue state after queue delete
dcorbacho 61035ce
Merge branch 'master' into quorum-queue
hairyhum f79fe98
Revert Revert "Declare a quorum queue using the queue.declare method"
hairyhum 88bbab9
Remove duplicated state info
dcorbacho cac9583
Start/stop multi-node quorum queue
dcorbacho 619455f
Restart nodes in a multi-node quorum cluster
dcorbacho b7e17e6
Test restart and leadership takeover on multiple nodes
dcorbacho 7aa683b
Wait for leader down after deleting a quorum cluster
dcorbacho 46bc3cc
Populate quorum_mapping from mnesia when not available
dcorbacho 4af36bd
Cosmetics
dcorbacho 91367f1
Do not emit core metrics if queue has just been deleted
dcorbacho 46da265
Use rabbit_mnesia:is_process_alive
dcorbacho e55928a
Only try to report stats if quorum process is alive
dcorbacho e5efe58
Implement cancel consumer callback
dcorbacho 15a4d81
Remove unnecessary trigger election call
dcorbacho 12e49f9
Apply cancellation callback on node hosting the channel
dcorbacho 0f801e9
Cosmetics
dcorbacho 55be48e
Read new fifo metrics which store directly total, ready and unack
dcorbacho b597328
Implement basic.cancel for quorum queues
dcorbacho 80ecdd7
Store leader in amqqueue record, report all in stats
dcorbacho 6195c33
Declare quorum queue in mnesia before starting the ra cluster
dcorbacho 13f7f3e
Revert
dcorbacho 003a2f0
Purge quorum queues
dcorbacho 8327cbf
Improve use of untracked_enqueue
kjnilsson 2e816ff
Store quorum leader in the pid field of amqqueue record
dcorbacho 2f8e6b1
Improve recovery
kjnilsson 87b24cd
Cleanup core metrics after leader change
dcorbacho 406529b
Merge remote-tracking branch 'origin/quorum-queue' into quorum-queue
dcorbacho 78c7280
Return an error on sync_queue on quorum queues
dcorbacho 8c20887
Return an error on cancel_sync_queue on quorum queues
dcorbacho d82bb9a
merge
kjnilsson 21051eb
Fix basic_cancel and basic_consume return values
kjnilsson 3d37c78
Restore arity of amqqeueu delete and purge functions.
kjnilsson 05db4b3
Fix bug returning consumers.
kjnilsson d8288cb
remove rogue debug log
kjnilsson 4a777a7
Integrate ingress flow control with quorum queues
dcorbacho 0e1b5f2
Configure commands soft limit
dcorbacho 61efed3
Support quorum pids on rabbit_mnesia:is_process_alive
dcorbacho 9b4fb2b
Publish consumers metric for quorum queues
dcorbacho 017d3a7
Whitelist quorum directory in is_virgin_node
kjnilsson ecb7505
Delete queue_metrics on leader change.
kjnilsson bbdece8
Report cluster status in quorum queue infos. New per node status comm…
dcorbacho 4337005
Merge remote-tracking branch 'origin/quorum-queue' into quorum-queue
dcorbacho 2af3b6f
Remove quorum_mapping table
kjnilsson db707f0
Fix xref issue
kjnilsson 5c13645
Provide quorum members information in stats
dcorbacho cca778f
fix unused variable
kjnilsson 79c9bd2
quorum queue multiple declare handling
kjnilsson a4b9e67
Return an error when declaring exclusive/auto-delete quorum queue
dcorbacho 9578070
Merge remote-tracking branch 'origin/quorum-queue' into quorum-queue
dcorbacho d78ec96
Restore lost changes
kjnilsson e604e33
recover another part of commit
kjnilsson 7296bf3
fixup cherry pick
kjnilsson e08ee11
merge
kjnilsson 05d15c7
Ra io/file metrics handler and stats publishing
dcorbacho 5923010
Revert "Ra io/file metrics handler and stats publishing"
dcorbacho 06279c4
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson eaebab9
Do not issue confirms on node down for quorum queues.
kjnilsson df6182c
Ra stats publishing
dcorbacho bde9214
Merge branch 'file-io-metrics' into quorum-queue
dcorbacho 86e8a2d
Pick consumer utilisation from ra data
dcorbacho 5a122e5
Handle error when deleting a quorum queue and all nodes are already down
dcorbacho 9c8f46d
Return an error when declaring non-durable quorum queues
dcorbacho 05e2ec8
Rename dirty_query to committed_query
dcorbacho 726095f
Delete stats on leader node
dcorbacho ad921ff
Give full list of nodes to fifo client
dcorbacho b512311
Handle timeout in quorum basic_get
dcorbacho 98b5dfe
Fix unused variable error
kjnilsson 7865807
Handle timeout in basic get
dcorbacho 5c98bf2
Force GC after purge
dcorbacho 3e00fa8
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson 19323cf
Increase `ra:delete_cluster` timeout to 120s
dcorbacho 0fe9675
Revert "Force GC after purge"
dcorbacho d12f725
Add quorum member command
dcorbacho db4a9a7
Delete quorum member command
dcorbacho 128edb6
Implement basic.recover for quorum queues
dcorbacho 4ae8936
Change concumer utilisation
kjnilsson d34f6b3
Set max quorum queue size limit
dcorbacho 73cd60d
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson f020aed
Merge branch 'quorum-queue' of github.com:rabbitmq/rabbitmq-server in…
kjnilsson fb14d40
remove potentially unrelated changes to rabbit_networking
kjnilsson a654c9d
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson d804657
Move ra_fifo to rabbit
kjnilsson 08600e2
rabbit_fifo tidy up
kjnilsson f7e4ac1
rabbit_fifo tidy up
kjnilsson 0fd11ce
rabbit_fifo: customer -> consumer rename
kjnilsson 4bd9b84
Move ra_fifo tests
kjnilsson d33e49d
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson cf97adc
Tweak quorum_queue defaults
kjnilsson e5921e1
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson e285766
quorum_queue test reliability
kjnilsson 41a6fb1
Optimise quorum_queue test suite.
kjnilsson 9f3c5a3
Renamings in line with ra API changes
kjnilsson e2a903d
Merge remote-tracking branch 'origin/master' into quorum-queue
kjnilsson 8392d88
rabbit_fifo fixes
kjnilsson c873135
Update with ra API changes
kjnilsson da424dd
Merge branch 'master' into quorum-queue
lukebakken b70c966
Update rabbit_fifo with latest ra changes
kjnilsson 094cd58
Clean up out of date comment
dcorbacho 96b7d44
Return map of states
dcorbacho 81ae369
Add test case for basic.get on an empty queue
dcorbacho f10ec8d
Clarify use of deliver tags on record_sent
dcorbacho b14a11a
Clean up queues after testcase
dcorbacho 4de27b6
Remove erlang monitor of quorum queues in rabbit_channel
dcorbacho 80c8583
Use macros to make clearer distinctions between quorum/classic queues
dcorbacho c75bdfb
Erase queue stats on 'eol' event
dcorbacho 65a63dc
Update to follow Ra's cluster_id -> cluster_name rename.
kjnilsson 1edf874
Rename qourum-cluster-size
kjnilsson 3ce235a
Issue confirms on quorum queue eol
kjnilsson da9b6f7
Only classic queues should be notified on channel down
kjnilsson 0978ea0
Quorum queues do not support global qos
kjnilsson 77634a6
merge
kjnilsson cac162e
unused variable name
kjnilsson c8faea1
Refactoring
kjnilsson f3c9b4c
Refactor foreach_per_queue in the channel.
kjnilsson 5dbffbd
rename function
kjnilsson 5688b23
Query classic and quorum queues separately
kjnilsson 73a22ea
Remove force_event_refresh function
kjnilsson 9e927ab
fix errors
kjnilsson 35a4066
Remove created_at from amqqueue record
kjnilsson 0ed703e
rabbit_fifo: support AMQP 1.0 consumer credit
kjnilsson dfcc81e
Add basic.credit support for quorum queues.
kjnilsson 2494b7e
Make quorum queue recover idempotent
kjnilsson 06bb572
Add tests for vhost deletion
kjnilsson d741a8e
remove unused clause
kjnilsson 2b34bdc
merge
kjnilsson 5a826df
always return latest value of queue
kjnilsson 283d774
Add rabbitmq-queues scripts. Remove ra config from .bat scripts.
hairyhum 75bd026
Return error if trying to get quorum status of a classic queue.
hairyhum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
## The contents of this file are subject to the Mozilla Public License | ||
## Version 1.1 (the "License"); you may not use this file except in | ||
## compliance with the License. You may obtain a copy of the License | ||
## at http://www.mozilla.org/MPL/ | ||
## | ||
## Software distributed under the License is distributed on an "AS IS" | ||
## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | ||
## the License for the specific language governing rights and | ||
## limitations under the License. | ||
## | ||
## The Original Code is RabbitMQ. | ||
## | ||
## The Initial Developer of the Original Code is GoPivotal, Inc. | ||
## Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved. | ||
## | ||
|
||
# Exit immediately if a pipeline, which may consist of a single simple command, | ||
# a list, or a compound command returns a non-zero status | ||
set -e | ||
|
||
# Each variable or function that is created or modified is given the export | ||
# attribute and marked for export to the environment of subsequent commands. | ||
set -a | ||
|
||
# shellcheck source=/dev/null | ||
# | ||
# TODO: when shellcheck adds support for relative paths, change to | ||
# shellcheck source=./rabbitmq-env | ||
. "${0%/*}"/rabbitmq-env | ||
|
||
run_escript rabbitmqctl_escript "${ESCRIPT_DIR:?must be defined}"/rabbitmq-queues "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@echo off | ||
REM The contents of this file are subject to the Mozilla Public License | ||
REM Version 1.1 (the "License"); you may not use this file except in | ||
REM compliance with the License. You may obtain a copy of the License | ||
REM at http://www.mozilla.org/MPL/ | ||
REM | ||
REM Software distributed under the License is distributed on an "AS IS" | ||
REM basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | ||
REM the License for the specific language governing rights and | ||
REM limitations under the License. | ||
REM | ||
REM The Original Code is RabbitMQ. | ||
REM | ||
REM The Initial Developer of the Original Code is GoPivotal, Inc. | ||
REM Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved. | ||
REM | ||
|
||
REM Scopes the variables to the current batch file | ||
setlocal | ||
|
||
rem Preserve values that might contain exclamation marks before | ||
rem enabling delayed expansion | ||
set TDP0=%~dp0 | ||
set STAR=%* | ||
setlocal enabledelayedexpansion | ||
|
||
REM Get default settings with user overrides for (RABBITMQ_)<var_name> | ||
REM Non-empty defaults should be set in rabbitmq-env | ||
call "%TDP0%\rabbitmq-env.bat" %~n0 | ||
|
||
if not exist "!ERLANG_HOME!\bin\erl.exe" ( | ||
echo. | ||
echo ****************************** | ||
echo ERLANG_HOME not set correctly. | ||
echo ****************************** | ||
echo. | ||
echo Please either set ERLANG_HOME to point to your Erlang installation or place the | ||
echo RabbitMQ server distribution in the Erlang lib folder. | ||
echo. | ||
exit /B 1 | ||
) | ||
|
||
REM Disable erl_crash.dump by default for control scripts. | ||
if not defined ERL_CRASH_DUMP_SECONDS ( | ||
set ERL_CRASH_DUMP_SECONDS=0 | ||
) | ||
|
||
"!ERLANG_HOME!\bin\erl.exe" +B ^ | ||
-boot !CLEAN_BOOT_FILE! ^ | ||
-noinput -noshell -hidden -smp enable ^ | ||
!RABBITMQ_CTL_ERL_ARGS! ^ | ||
-kernel inet_dist_listen_min !RABBITMQ_CTL_DIST_PORT_MIN! ^ | ||
-kernel inet_dist_listen_max !RABBITMQ_CTL_DIST_PORT_MAX! ^ | ||
-sasl errlog_type error ^ | ||
-mnesia dir \""!RABBITMQ_MNESIA_DIR:\=/!"\" ^ | ||
-nodename !RABBITMQ_NODENAME! ^ | ||
-run escript start ^ | ||
-escript main rabbitmqctl_escript ^ | ||
-extra "%RABBITMQ_HOME%\escript\rabbitmq-queues" !STAR! | ||
|
||
if ERRORLEVEL 1 ( | ||
exit /B 1 | ||
) | ||
|
||
endlocal | ||
endlocal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this setting to erlang code? We don't start applications on node boot, but from
rabbit:boot/start
functions. It would be nice to avoid additional bash scripting.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was done here for a reason, I'm trying to remember why.