PMM-14576 Backup improvements.#5490
Open
JiriCtvrtka wants to merge 20 commits into
Open
Conversation
Contributor
Author
|
@copilot review |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5490 +/- ##
==========================================
+ Coverage 43.50% 44.25% +0.74%
==========================================
Files 413 414 +1
Lines 42953 41908 -1045
==========================================
- Hits 18687 18546 -141
+ Misses 22392 21596 -796
+ Partials 1874 1766 -108
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@copilot review |
Contributor
Author
|
@copilot review |
Contributor
Author
|
@copilot review |
Resolve conflict in pbm_helpers.go by keeping the refactored describePoller-based polling from this branch. Co-authored-by: Cursor <cursoragent@cursor.com>
maxkondr
reviewed
Jun 22, 2026
Contributor
There was a problem hiding this comment.
can it be implemented easier?
here is the native poller implementation (I would place it into utils/) and just call it with appropriate values:
import (
"context"
"errors"
"fmt"
"time"
)
// ConditionFunc returns true when the condition is successfully met.
type ConditionFunc func(ctx context.Context) (done bool, err error)
// PollUntilContextTimeout native standard library equivalent
func PollUntilContextTimeout(ctx context.Context, interval time.Duration, condition ConditionFunc) error {
// 1. Run an immediate initial check before starting the ticker.
// If the condition is already true, we skip waiting.
if done, err := condition(ctx); err != nil {
return err
} else if done {
return nil
}
// 2. Initialize a ticker for subsequent intervals.
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
// The context timeout expired or was canceled by the caller
return ctx.Err()
case <-ticker.C:
// Trigger the condition check on every tick
done, err := condition(ctx)
if err != nil {
return err
}
if done {
return nil
}
}
}
}
Contributor
Author
|
@copilot review |
Contributor
Author
|
@copilot review |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PMM-14576
Fixes false failed to get backup status / failed to get restore status errors during MongoDB PBM backup and restore jobs when describe-backup / describe-restore temporarily fail while the operation is still running or metadata is not ready yet.
Refactors backup/restore completion polling into a shared describePoller that: