Skip to content
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

[DPE-5947] Scale up: add new units as etcd cluster members #15

Merged
merged 30 commits into from
Jan 16, 2025

Conversation

reneradoi
Copy link
Collaborator

@reneradoi reneradoi commented Jan 6, 2025

The etcd operator needs to integrate new juju units as members to the etcd cluster. Currently it waits on startup until all juju units have joined the peer relation and form an initial cluster. With this PR, this behaviour is changed to:

  • starting the etcd cluster with just one member on the juju leader unit
  • add subsequent juju units that joined the peer relation as cluster members (“learning-only”)
  • promote “learner”-members to full membership once replication from the raft leader has completed

Please also see: https://github.com/canonical/charmed-etcd-operator/wiki/Scaling-up:-Workflow

This PR also adds integration testing for scaling up, including a continuous-writes-functionality (based on the one used in mongodb operator) to make sure the cluster is available for writing data during scaling operations.

@reneradoi reneradoi marked this pull request as ready for review January 7, 2025 15:14
skourta
skourta previously approved these changes Jan 9, 2025
Copy link
Contributor

@skourta skourta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, René.
I left some questions.

src/core/models.py Show resolved Hide resolved
tests/integration/ha/continuous_writes.py Show resolved Hide resolved
tests/integration/ha/helpers.py Show resolved Hide resolved
tests/integration/ha/test_scaling.py Outdated Show resolved Hide resolved
@reneradoi reneradoi dismissed skourta’s stale review January 9, 2025 10:36

The merge-base changed after approval.

Copy link

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks René, great work! I left some comments.

charmcraft.yaml Outdated Show resolved Hide resolved
src/common/client.py Show resolved Hide resolved
src/common/client.py Outdated Show resolved Hide resolved
src/common/client.py Show resolved Hide resolved
src/common/client.py Show resolved Hide resolved
src/managers/cluster.py Outdated Show resolved Hide resolved
src/managers/cluster.py Show resolved Hide resolved
src/managers/cluster.py Outdated Show resolved Hide resolved
tests/integration/ha/continuous_writes.py Show resolved Hide resolved
tests/integration/ha/test_scaling.py Show resolved Hide resolved
@reneradoi reneradoi merged commit 51bdec0 into main Jan 16, 2025
9 of 10 checks passed
@reneradoi reneradoi deleted the add-new-units-as-cluster-members branch January 16, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants