Skip to content
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

PBM-1482: Selective Restore hangs on oplog replay and doesn't finish #1108

Merged
merged 3 commits into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pbm/restore/selective.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func (r *Restore) configsvrRestoreDatabases(
if err != nil {
return err
}
defer rdr.Close()

rdr, err = compress.Decompress(rdr, bcp.Compression)
if err != nil {
return err
Expand Down Expand Up @@ -210,6 +212,8 @@ func (r *Restore) configsvrRestoreCollections(
if err != nil {
return nil, err
}
defer rdr.Close()

rdr, err = compress.Decompress(rdr, bcp.Compression)
if err != nil {
return nil, err
Expand Down Expand Up @@ -274,6 +278,8 @@ func (r *Restore) configsvrRestoreChunks(
if err != nil {
return err
}
defer rdr.Close()

rdr, err = compress.Decompress(rdr, bcp.Compression)
if err != nil {
return err
Expand Down Expand Up @@ -332,7 +338,11 @@ func (r *Restore) configsvrRestoreChunks(
models = append(models, mongo.NewInsertOneModel().SetDocument(doc))
}

if len(models) == 0 {
if len(models) == 0 && !done {
// if it's not done, we just reached maxBulkWriteCount, we need to process more
continue
} else if len(models) == 0 && done {
// it's done and there's nothing to update
return nil
}

Expand Down
Loading