Skip to content

Commit

Permalink
Use rs.slaveOk to fix mongo 4.1.7 backup (#1890)
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob Kumar Saha <[email protected]>
  • Loading branch information
ArnobKumarSaha authored Aug 14, 2023
1 parent 36769ad commit 3b14cf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ func lockConfigServer(configSVRDSN, secondaryHost string) error {
"config",
"--host", secondaryHost,
"--quiet",
"--eval", "rs.secondaryOk(); db.BackupControl.find({ '_id' : 'BackupControlDocument' }).readConcern('majority');",
"--eval", "rs.slaveOk(); db.BackupControl.find({ '_id' : 'BackupControlDocument' }).readConcern('majority');",
}, mongoCreds...)

if err := sh.Command(MongoCMD, args...).UnmarshalJSON(&v); err != nil {
Expand Down

0 comments on commit 3b14cf3

Please sign in to comment.