Skip to content

Commit

Permalink
Merge pull request #7 from gnuoy/quorum-queues
Browse files Browse the repository at this point in the history
Manage quorum queues
  • Loading branch information
javacruft authored Sep 7, 2023
2 parents 20c6da3 + 15c0c00 commit 0aa1a62
Show file tree
Hide file tree
Showing 10 changed files with 571 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
channel: 3.9/edge
channel: 3.12/edge
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
venv/
build/
*.charm
*.swp
.tox
venv
.coverage
Expand Down
91 changes: 91 additions & 0 deletions actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,94 @@ get-service-account:
- username
- vhost
additionalProperties: False

ensure-queue-ha:
description: |
Check for queues that have insufficent memebers for high
availability and, if possible, add members to them.
params:
dry-run:
type: boolean
default: false
description: |
Report on what memberships would change if the command was
run and warn about any queues that cannot be fixed.
rebalance-quorum:
description: |
Rebalance queue leaders to that they are evenly balanced
across the cluster.
add-member:
description: Add member to queue
params:
queue-name:
type: string
description: |
Name of queue to add the member to.
unit-name:
type: string
description: |
Juju unit name of the node to be added to the queue
vhost:
type: string
description: |
vhost that the queue resides in.
required: [queue-name, unit-name]

delete-member:
description: Remove member from queue
params:
queue-name:
type: string
description: |
Name of queue to remove the member from.
unit-name:
type: string
description: |
Juju unit name of the node to be removed from the queue
vhost:
type: string
description: |
vhost that the queue resides in.
required: [queue-name, unit-name]

grow:
description: |
Adds a new replica on the given node for all or a half
of matching quorum queues.
params:
selector:
type: string
description: |
Valid values are "all" or even"
unit-name:
type: string
description: |
Juju unit name of the node to have queues added
vhost-pattern:
type: string
description: |
Match vhosts to be added to the node
queue-pattern:
type: string
description: |
Match queues to be added to the node
required: [unit-name, selector]

shrink:
description: |
Shrinks quorum queue clusters by removing any members (replicas)
on the given node.
params:
unit-name:
type: string
description: |
Juju unit name of the node to have queues added
error-only:
type: boolean
default: false
description: |
Only list queues which reported an error
required: [unit-name]

5 changes: 4 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# See LICENSE file for licensing details.

options:
{}
minimum-replicas:
default: 3
description: Minimum number of queues replicas, set to 0 to disable charm automatically managing queue replicas
type: int
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
rabbitmq-image:
type: oci-image
description: OCI image for rabbitmq
upstream-source: ghcr.io/openstack-snaps/rabbitmq:3.9.13
upstream-source: ghcr.io/openstack-snaps/rabbitmq:3.12.1

storage:
rabbitmq-data:
Expand Down
Loading

0 comments on commit 0aa1a62

Please sign in to comment.