Skip to content

Conversation

m1kola
Copy link
Contributor

@m1kola m1kola commented Oct 9, 2025

Summary

The new mongodb.com/v1.disable-reconciliation annotation allows disabling reconciliation for MongoDBMultiCluster objects.

This will be used later when migrating multi-cluster replica sets from MongoDBMultiCluster to MongoDB.

Proof of Work

  1. Add mongodb.com/v1.disableReconciliation to any MongoDBMultiCluster
  2. Run kubectl wait mongodbmulticluster NAME -n NAMESPACE --for=jsonpath='{.status.phase}'=Disabled.
  3. Check that the kubectl wait command prints mongodbmulticluster.mongodb.com/NAME condition met.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@m1kola m1kola changed the title MongoDBMultiCluster: Add annotation to disable reconciliation CLOUDP-350375: MongoDBMultiCluster: Add annotation to disable reconciliation Oct 9, 2025
@m1kola m1kola force-pushed the add-disable-reconciliation-annotation branch from 96ca920 to a1095fa Compare October 9, 2025 14:36
@m1kola m1kola added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Oct 9, 2025
return reconcileResult, err
}

if val, ok := mrs.Annotations[util.DisableReconciliation]; ok && val == util.DisableReconciliationValue {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will be something our users will be using during migration, but as part of this PR I"m not going to document the annotation/add a release note. It will be included in the migration guide once we release a version which is ready for migration. Until then - let's leave it undocumented.

LastAchievedRsMemberIds = "mongodb.com/v1.lastAchievedRsMemberIds"

DisableReconciliation = "mongodb.com/v1.disableReconciliation"
DisableReconciliationValue = "true"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to define a constant because linter was not happy.

@m1kola m1kola requested a review from Julien-Ben October 9, 2025 14:41
@m1kola m1kola marked this pull request as ready for review October 9, 2025 14:41
@m1kola m1kola requested a review from a team as a code owner October 9, 2025 14:41
@m1kola m1kola requested a review from viveksinghggits October 9, 2025 14:41
@m1kola m1kola force-pushed the add-disable-reconciliation-annotation branch from a1095fa to 24ec913 Compare October 10, 2025 08:01
The new `mongodb.com/v1.disable-reconciliation` annotation allows
disabling reconciliation for `MongoDBMultiCluster` objects.

This will be used later when migrating multi-cluster replica sets
from `MongoDBMultiCluster` to `MongoDB`.
@m1kola m1kola force-pushed the add-disable-reconciliation-annotation branch from 24ec913 to 72152af Compare October 10, 2025 11:36
Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

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

PR looks good to me. Just left a small comment/question.


if val, ok := mrs.Annotations[util.DisableReconciliation]; ok && val == util.DisableReconciliationValue {
log.Info("Reconciliation disabled")
return r.updateStatus(ctx, &mrs, workflow.Disabled(), log)
Copy link
Contributor

Choose a reason for hiding this comment

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

q: It looks like disabled workflow was introduced to notify if a subresource is enabled or disabled. would it be a good idea to use the same to notify that a resource is deprecated?

I was also wondering if we should call it disabled or deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@viveksinghggits I found this:

// PhaseDisabled means that the resource is not enabled
PhaseDisabled Phase = "Disabled"

I believe these statuses are generic. It just happened so that we only use it currently to report that a backup is disabled. But I think there is no reason not to use it for anything else. I'm happy to update this comment to reflect this:

// disabledStatus indicates that the subresource is not enabled
type disabledStatus struct {
*okStatus
}

I was also wondering if we should call it disabled or deprecated?

We might be adding a deprecation message somewhere on the resource. But it will likely going to be a permanent message.

For the purpose of migration we need a status which can be used to programmatically check that the resource is not being reconciled.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think just updating the comment should be ok. Just wanted to bring the attention to that comment, not a big issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants