Open
PBM-1718 Allow physical/incremental backup for MongoDB Enterprise edition#1285
Conversation
|
|
Explicitly set local read concern for $backupCursor and $backupCursorExtend aggregate operations. These stages only support local read concern, but the client may be configured with majority, causing backup failures. Co-authored-by: igroene <9805809+igroene@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with physical backup and unsupported read concern
Fix physical backup failure when client read concern is not Mar 12, 2026
local
Add enterprise edition detection to MongoVersion and update FullPhysicalBackup() and IncrementalPhysicalBackup() to also allow physical backups when MongoDB Enterprise is in use, since it supports $backupCursor just like PSMDB. Co-authored-by: igroene <9805809+igroene@users.noreply.github.com>
Copilot
AI
changed the title
Fix physical backup failure when client read concern is not
Allow physical/incremental/external backup for MongoDB Enterprise edition
Mar 12, 2026
localAgentStat was missing the Enterprise edition flag, causing MongoVersion() to reconstruct without Modules, making IsEnterprise() return false during candidate filtering. Add IsEnterprise bool field to AgentStat, populate it in HbStatus(), and use it in MongoVersion() to set Modules. Co-authored-by: igroene <9805809+igroene@users.noreply.github.com>
Copilot
AI
changed the title
Allow physical/incremental/external backup for MongoDB Enterprise edition
Allow physical/incremental backup for MongoDB Enterprise edition
Mar 12, 2026
igroene
marked this pull request as ready for review
March 13, 2026 11:17
Comment on lines
+105
to
+107
| name string | ||
| ver MongoVersion | ||
| want bool |
Contributor
There was a problem hiding this comment.
[gofmt] reported by reviewdog 🐶
Suggested change
| name string | |
| ver MongoVersion | |
| want bool | |
| name string | |
| ver MongoVersion | |
| want bool |
| } | ||
|
|
||
| cur, err := bc.conn.Database("admin").Aggregate(ctx, mongo.Pipeline{ | ||
| cur, err := bc.conn.Database("admin", options.Database().SetReadConcern(readconcern.Local())).Aggregate(ctx, mongo.Pipeline{ |
Contributor
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
The line is 126 characters long, which exceeds the maximum of 120 characters. (lll)
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.
Physical and incremental backups were restricted to Percona Server for MongoDB (PSMDB) only, despite MongoDB Enterprise supporting the same
$backupCursor/$backupCursorExtendaggregation stages. Additionally, even after relaxing that gate, the backup nomination list remained empty for Enterprise nodes because the enterprise flag was never propagated through the agent heartbeat mechanism.Changes
pbm/version/version.go— Detect and permit Enterprise editionModules []string \bson:"modules,omitempty"`toMongoVersion(populated frombuildInfo`)IsEnterprise() boolmethod — checks for"enterprise"inModulesFullPhysicalBackup()andIncrementalPhysicalBackup()to pass when eitherPSMDBVersion != ""orIsEnterprise():BackupType()error messages to mention MongoDB Enterprise alongside PSMDBpbm/topo/agent.go— Persist enterprise flag in agent heartbeatIsEnterprise bool \bson:"ent,omitempty"`toAgentStat`MongoVersion()to restoreModules: []string{"enterprise"}from this flag — without this,getValidCandidates()andcollectTopoCheckErrors()would reconstruct aMongoVersionwith noModules, causingIsEnterprise()to always returnfalseand filtering out all Enterprise nodes as invalid backup candidatescmd/pbm-agent/agent.go— Populate the enterprise flag on heartbeatIsEnterprise: nodeVersion.IsEnterprise()when building theAgentStatheartbeat inHbStatus()✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.