Skip to content

Allow parallel processing of ops with the same name in diff namespaces#1617

Merged
kodiak-appscode[bot] merged 4 commits intomasterfrom
fix-ops-progressing-check
Apr 1, 2026
Merged

Allow parallel processing of ops with the same name in diff namespaces#1617
kodiak-appscode[bot] merged 4 commits intomasterfrom
fix-ops-progressing-check

Conversation

@Neaj-Morshad-101
Copy link
Copy Markdown
Member

…spaces

…spaces

Signed-off-by: Neaj Morshad <neaj@appscode.com>
Copilot AI review requested due to automatic review settings March 3, 2026 10:10
@Neaj-Morshad-101 Neaj-Morshad-101 changed the title Allow parallel processing of ops with the same name in different name… Allow parallel processing of ops with the same name in diff namespaces Mar 3, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates OpsRequest progressing-phase gating so OpsRequests targeting databases with the same name in different namespaces can proceed in parallel, avoiding cross-namespace blocking.

Changes:

  • Add namespace scoping to the “another ops is already progressing” detection logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 235 to 236
if ops.GetName() == req.GetName() || ops.GetDBRefName() != req.GetDBRefName() || ops.GetNamespace() != req.GetNamespace() {
continue
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This loop lists all OpsRequests cluster-wide and then filters by namespace/DBRef in-code. Now that namespace scoping is required for correctness, consider calling kbClient.List with client.InNamespace(req.GetNamespace()) (and, if feasible, an index/field selector for DBRefName) to avoid O(total OpsRequests) API responses and reduce apiserver/controller load; then the ops.GetNamespace() != req.GetNamespace() filter can be removed/simplified.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a good suggestion.
@Neaj-Morshad-101 Use namespace in the client.ListOptions, then this change is not needed. Less iteration needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment on lines 235 to 236
if ops.GetName() == req.GetName() || ops.GetDBRefName() != req.GetDBRefName() || ops.GetNamespace() != req.GetNamespace() {
continue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a good suggestion.
@Neaj-Morshad-101 Use namespace in the client.ListOptions, then this change is not needed. Less iteration needed.

Neaj-Morshad-101 and others added 2 commits April 1, 2026 12:22
Signed-off-by: Neaj Morshad <neajmorshad.ashik101@gmail.com>
@souravbiswassanto souravbiswassanto added the automerge Kodiak will auto merge PRs that have this label label Apr 1, 2026
@kodiak-appscode kodiak-appscode bot merged commit f129d2f into master Apr 1, 2026
8 checks passed
@kodiak-appscode kodiak-appscode bot deleted the fix-ops-progressing-check branch April 1, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Kodiak will auto merge PRs that have this label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants