Skip to content

Reconcile remote datacenters independently #2535

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 3 commits into from
May 6, 2025

Conversation

zimnx
Copy link
Collaborator

@zimnx zimnx commented Mar 5, 2025

Refactors ScyllaDBCluster controller to reconcile each datacenter independenly.
Errors or connection issues of down datacenter no longer affects reconcilation of other datacenter.

Requires:

Fixes #2494

Copy link
Contributor

@zimnx: GitHub didn't allow me to request PR reviews from the following users: zimnx.

Note that only scylladb members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

TODO

/cc

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@scylla-operator-bot scylla-operator-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 5, 2025
@zimnx zimnx force-pushed the independent-datacenters branch from b3235c0 to 433e060 Compare March 5, 2025 16:46
@scylla-operator-bot scylla-operator-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2025
@zimnx zimnx force-pushed the independent-datacenters branch 2 times, most recently from 057822f to 61cac51 Compare March 10, 2025 16:21
@scylla-operator-bot scylla-operator-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2025
@zimnx zimnx force-pushed the independent-datacenters branch from 61cac51 to 110646f Compare March 18, 2025 10:53
@scylla-operator-bot scylla-operator-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 18, 2025
@zimnx zimnx force-pushed the independent-datacenters branch from 110646f to f8a89a1 Compare March 28, 2025 12:47
@zimnx zimnx force-pushed the independent-datacenters branch 2 times, most recently from d4b239d to 978ed02 Compare April 9, 2025 13:43
@zimnx zimnx changed the title [WIP] Independently reconciled datacenters Reconcile remote datacenters independently Apr 9, 2025
@scylla-operator-bot scylla-operator-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2025
@zimnx zimnx added kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Apr 9, 2025
@scylla-operator-bot scylla-operator-bot bot removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 9, 2025
@zimnx zimnx changed the title Reconcile remote datacenters independently [WIP] Reconcile remote datacenters independently Apr 9, 2025
@scylla-operator-bot scylla-operator-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2025
@zimnx zimnx force-pushed the independent-datacenters branch 5 times, most recently from 9519be5 to edf2b32 Compare April 15, 2025 09:22
@zimnx zimnx force-pushed the independent-datacenters branch from 15fbeb0 to 606e28a Compare April 22, 2025 12:53
@zimnx
Copy link
Collaborator Author

zimnx commented Apr 22, 2025

clean rebase to pick up dependent PRs, ready to review

Copy link
Collaborator

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

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

My overall perspective - not reflected in the attached comments - is that the MakeRemoteXXX functions encapsulate significant logic in a way that (1) is not clear from the function name/signature, (2) vastly differs between types.

Attaching some comments, but in subsequent rounds I would like to get the function signatures (including mostly nonexistent docstrings) more in check with what actually the logic is.

@scylla-operator-bot scylla-operator-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2025
@zimnx zimnx force-pushed the independent-datacenters branch from 606e28a to 645b2c5 Compare April 24, 2025 19:51
@scylla-operator-bot scylla-operator-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2025
@zimnx zimnx requested a review from mflendrich April 24, 2025 20:02
@zimnx zimnx force-pushed the independent-datacenters branch from 645b2c5 to 2a9c192 Compare April 25, 2025 08:32
Copy link
Member

@rzetelskik rzetelskik left a comment

Choose a reason for hiding this comment

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

one minor comment and a nit
lgtm, but I second most of Michal's comments
/assign mflendrich

@@ -6,6 +6,9 @@ import (
"sort"
"strings"

apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/errors"

Copy link
Member

Choose a reason for hiding this comment

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

blank line sneaked in

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

}

metaCluster := f.Cluster(0)
sc, err = f.ScyllaClient().ScyllaV1alpha1().ScyllaDBClusters(f.Namespace()).Create(ctx, sc, metav1.CreateOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

nit: for clarity, shouldn't this use metaCluster instead of f directly as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

indeed, done

@zimnx zimnx force-pushed the independent-datacenters branch from 2a9c192 to b49b98c Compare May 2, 2025 08:48
Refactors ScyllaDBCluster controller to reconcile each datacenter independenly.
Errors or connection issues of down datacenter no longer affects reconcilation of other datacenter.
@zimnx zimnx force-pushed the independent-datacenters branch 2 times, most recently from 2e55354 to 5cdaf62 Compare May 5, 2025 10:20
@zimnx zimnx requested a review from mflendrich May 5, 2025 14:08
Copy link
Collaborator

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

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

The post-merge cleanup refactor promise, as decided in #2535 (comment), addresses my code health concern.

Two comments left, otherwise lgtm.

@zimnx zimnx force-pushed the independent-datacenters branch from 5cdaf62 to 93e4f72 Compare May 6, 2025 11:08
@zimnx zimnx requested a review from mflendrich May 6, 2025 11:12
zimnx added 2 commits May 6, 2025 13:28
…center

Existing Controller Conditions were changed to represent status of
reconcilation of particular Datacenter.
On top of these, aggregated per Datacenter Conditions were added.
Test verifies if Operator is able to reconcile healthy datacenters when any is down, and whether it fully reconciles the cluster when down DC is restored.
@zimnx zimnx force-pushed the independent-datacenters branch from 93e4f72 to fd2b043 Compare May 6, 2025 11:28
Copy link
Collaborator

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks!

@scylla-operator-bot scylla-operator-bot bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2025
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mflendrich, zimnx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@scylla-operator-bot scylla-operator-bot bot merged commit d37be76 into scylladb:master May 6, 2025
13 checks passed
@zimnx zimnx deleted the independent-datacenters branch May 6, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Multi-DC] Reconcile remote datacenters independently
3 participants