-
Notifications
You must be signed in to change notification settings - Fork 2
fix: prevent MCP service deletion during cluster update #306
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
Closed
Closed
Changes from all commits
Commits
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
261 changes: 261 additions & 0 deletions
261
...ions/golden_test/TestUpdateDatabase/add_third_node_to_two-node_database_with_service.json
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,261 @@ | ||
| [ | ||
| [ | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "orchestrator.resource::n3-instance-1-dep-1-id", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.instance::n3-instance-1-id", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.node::n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "create", | ||
| "resource_id": "monitor.instance::n3-instance-1-id", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.replication_slot::n1n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.replication_slot::n2n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.replication_slot_create::spk_test_n2_sub_n2_n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.subscription::n2n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.sync_event::n2n1", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.wait_for_sync_event::n2n1", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.subscription::n1n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.sync_event::n1n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.wait_for_sync_event::n1n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.lag_tracker_commit_ts::n2n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.replication_slot_advance_from_cts::n2n3", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.replication_slot::n3n1", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.replication_slot::n3n2", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "update", | ||
| "resource_id": "database.subscription::n1n3", | ||
| "reason": "has_diff", | ||
| "diff": [ | ||
| { | ||
| "value": null, | ||
| "op": "replace", | ||
| "path": "/dependent_subscriptions" | ||
| }, | ||
| { | ||
| "value": false, | ||
| "op": "replace", | ||
| "path": "/sync_data" | ||
| }, | ||
| { | ||
| "value": false, | ||
| "op": "replace", | ||
| "path": "/sync_structure" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "update", | ||
| "resource_id": "database.subscription::n2n3", | ||
| "reason": "has_diff", | ||
| "diff": [ | ||
| { | ||
| "value": false, | ||
| "op": "replace", | ||
| "path": "/disabled" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.subscription::n3n1", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "create", | ||
| "resource_id": "database.subscription::n3n2", | ||
| "reason": "does_not_exist", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "update", | ||
| "resource_id": "database.sync_event::n1n3", | ||
| "reason": "dependency_updated", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "update", | ||
| "resource_id": "database.wait_for_sync_event::n1n3", | ||
| "reason": "dependency_updated", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "update", | ||
| "resource_id": "database.lag_tracker_commit_ts::n2n3", | ||
| "reason": "dependency_updated", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "update", | ||
| "resource_id": "database.replication_slot_advance_from_cts::n2n3", | ||
| "reason": "dependency_updated", | ||
| "diff": null | ||
| } | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.replication_slot_advance_from_cts::n2n3", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.wait_for_sync_event::n2n1", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.lag_tracker_commit_ts::n2n3", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.sync_event::n2n1", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.replication_slot_create::spk_test_n2_sub_n2_n3", | ||
| "diff": null | ||
| }, | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.wait_for_sync_event::n1n3", | ||
| "diff": null | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "type": "delete", | ||
| "resource_id": "database.sync_event::n1n3", | ||
| "diff": null | ||
| } | ||
| ] | ||
| ] | ||
| ] |
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
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.
This sounds like it could be fixed by just listing the node resource in the dependencies for the service user role. Does that not work for some reason?
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.
This PR is about preventing a service deletion that shouldn't happen. I think the deletions were being caused because the plan was transitioning from a state that had a service resource to an intermediate state that didn't and so it was scheduled for deletion, which I think is a consequence of requiring all db nodes to be up and healthy before any service resources are created. The old code was creating a nodes-only state with no services and then adding services in later and it triggered a deletion in the plan. It looks like there's no dependency logic involved in state.planDeletes - so it feels like simply adding a dep on the service user role wouldn't fix the issue. What I'm trying to do here is modify the intermediate state by cloning the services in so they aren't scheduled for deletion.