diff --git a/common/namespace/handler.go b/common/namespace/handler.go index a86591e5df2..594236f9202 100644 --- a/common/namespace/handler.go +++ b/common/namespace/handler.go @@ -846,16 +846,7 @@ func (d *HandlerImpl) maybeUpdateFailoverHistory( d.logger.Debug("updateReplicationConfig was nil") return failoverHistory } - desiredReplicationState := updateReplicationConfig.State - if desiredReplicationState == enumspb.REPLICATION_STATE_UNSPECIFIED { - desiredReplicationState = namespaceDetail.ReplicationConfig.State - } - // N.B., UNSPECIFIED is the same as NORMAL - if desiredReplicationState != enumspb.REPLICATION_STATE_NORMAL && - desiredReplicationState != enumspb.REPLICATION_STATE_UNSPECIFIED { - d.logger.Debug("Replication state not NORMAL", tag.NewAnyTag("state", updateReplicationConfig.State)) - return failoverHistory - } + lastFailoverVersion := int64(-1) if l := len(namespaceDetail.ReplicationConfig.FailoverHistory); l > 0 { lastFailoverVersion = namespaceDetail.ReplicationConfig.FailoverHistory[l-1].FailoverVersion diff --git a/common/namespace/handler_test.go b/common/namespace/handler_test.go index 6172c0075ca..056aa1ae57a 100644 --- a/common/namespace/handler_test.go +++ b/common/namespace/handler_test.go @@ -608,6 +608,12 @@ func (s *namespaceHandlerCommonSuite) TestUpdateNamespace_UpdateActiveClusterWit ActiveClusterName: clusterName2, Clusters: []string{clusterName1, clusterName2}, State: enumspb.REPLICATION_STATE_HANDOVER, + FailoverHistory: []*persistencespb.FailoverStatus{ + { + FailoverTime: timestamp.TimePtr(update1Time), + FailoverVersion: 2, + }, + }, }, ConfigVersion: int64(0), FailoverNotificationVersion: version,