From 3b14cf33cbfac8f7fe2656cac06134797e093fdd Mon Sep 17 00:00:00 2001 From: Arnob Kumar Saha Date: Mon, 14 Aug 2023 08:13:58 +0600 Subject: [PATCH] Use rs.slaveOk to fix mongo 4.1.7 backup (#1890) Signed-off-by: Arnob Kumar Saha --- pkg/backup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/backup.go b/pkg/backup.go index dc1d2b1ca..e8ba473ee 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -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 {