Skip to content

Commit b69f3ac

Browse files
YanniHu1996armrulitaocdl
authored
fix: Skip replication slot reconciliation if fenced (cloudnative-pg#2816)
skip the replication slot reconciliation if the instance is fenced closes cloudnative-pg#2784 Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Tao Li <tao.li@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Tao Li <tao.li@enterprisedb.com>
1 parent 6921b87 commit b69f3ac

File tree

1 file changed

+7
-0
lines changed
  • internal/management/controller/slots/runner

1 file changed

+7
-0
lines changed

internal/management/controller/slots/runner/runner.go

+7
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ func (sr *Replicator) reconcile(ctx context.Context, config *apiv1.ReplicationSl
9898
}
9999
}()
100100

101+
contextLog := log.FromContext(ctx)
102+
103+
if sr.instance.IsFenced() {
104+
contextLog.Trace("Replication slots reconciliation skipped: instance is fenced.")
105+
return nil
106+
}
107+
101108
primaryPool := sr.instance.PrimaryConnectionPool()
102109
localPool := sr.instance.ConnectionPool()
103110
err = synchronizeReplicationSlots(

0 commit comments

Comments
 (0)