Skip to content

Commit 8e6e78d

Browse files
Use rs.slaveOk to fix mongo 4.0.3 backup (#1887)
Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
1 parent df9fbc3 commit 8e6e78d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ func lockConfigServer(configSVRDSN, secondaryHost string) error {
701701
"config",
702702
"--host", secondaryHost,
703703
"--quiet",
704-
"--eval", "rs.secondaryOk(); db.BackupControl.find({ '_id' : 'BackupControlDocument' }).readConcern('majority');",
704+
"--eval", "rs.slaveOk(); db.BackupControl.find({ '_id' : 'BackupControlDocument' }).readConcern('majority');",
705705
}, mongoCreds...)
706706

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

0 commit comments

Comments
 (0)