From 619bdc372291974ce0bee9a5cad47a24fea57ed2 Mon Sep 17 00:00:00 2001 From: travisn Date: Mon, 2 Oct 2023 08:26:49 -0600 Subject: [PATCH] file: disable active standby when set to false The activeStandby property of the filesystem CR was not taking effect when changed from true to false. The standby was only being enabled when true, but never applied when changed to false. Signed-off-by: travisn (cherry picked from commit f7094d1d13d8e5852f5ce9f0515f5ac9207b9b35) --- pkg/daemon/ceph/client/filesystem.go | 2 +- pkg/operator/ceph/file/filesystem.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/daemon/ceph/client/filesystem.go b/pkg/daemon/ceph/client/filesystem.go index 03132c2d4..f7785ff98 100644 --- a/pkg/daemon/ceph/client/filesystem.go +++ b/pkg/daemon/ceph/client/filesystem.go @@ -119,7 +119,7 @@ func getFilesystem(context *clusterd.Context, clusterInfo *ClusterInfo, fsName s // AllowStandbyReplay gets detailed status information about a Ceph filesystem. func AllowStandbyReplay(context *clusterd.Context, clusterInfo *ClusterInfo, fsName string, allowStandbyReplay bool) error { - logger.Infof("setting allow_standby_replay for filesystem %q", fsName) + logger.Infof("setting allow_standby_replay to %t for filesystem %q", allowStandbyReplay, fsName) args := []string{"fs", "set", fsName, "allow_standby_replay", strconv.FormatBool(allowStandbyReplay)} _, err := NewCephCommand(context, clusterInfo, args).Run() if err != nil { diff --git a/pkg/operator/ceph/file/filesystem.go b/pkg/operator/ceph/file/filesystem.go index 5d3f88087..3ea9b1fde 100644 --- a/pkg/operator/ceph/file/filesystem.go +++ b/pkg/operator/ceph/file/filesystem.go @@ -61,10 +61,8 @@ func createFilesystem( return errors.Wrapf(err, "failed to create filesystem %q", fs.Name) } } - if fs.Spec.MetadataServer.ActiveStandby { - if err := cephclient.AllowStandbyReplay(context, clusterInfo, fs.Name, fs.Spec.MetadataServer.ActiveStandby); err != nil { - return errors.Wrapf(err, "failed to set allow_standby_replay to filesystem %q", fs.Name) - } + if err := cephclient.AllowStandbyReplay(context, clusterInfo, fs.Name, fs.Spec.MetadataServer.ActiveStandby); err != nil { + return errors.Wrapf(err, "failed to set allow_standby_replay to filesystem %q", fs.Name) } // set the number of active mds instances