Skip to content

Commit

Permalink
Do not add version 0 to failover history (#3483)
Browse files Browse the repository at this point in the history
  • Loading branch information
meiliang86 authored and dnr committed Oct 17, 2022
1 parent 78366f1 commit b57b930
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/namespace/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func (d *HandlerImpl) UpdateNamespace(
configVersion++
}

if configurationChanged || activeClusterChanged {
if (configurationChanged || activeClusterChanged) && isGlobalNamespace {
// N.B., it should be sufficient to check only for activeClusterChanged. In order to be defensive, we also
// check for configurationChanged. If nothing needs to be updated this will be a no-op.
failoverHistory = d.maybeUpdateFailoverHistory(
Expand Down
4 changes: 4 additions & 0 deletions common/namespace/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,10 @@ func (s *namespaceHandlerCommonSuite) TestUpdateLocalNamespace_AllAttrSet() {
VisibilityArchivalUri: "",
BadBinaries: &namespacepb.BadBinaries{Binaries: map[string]*namespacepb.BadBinaryInfo{}},
},
ReplicationConfig: &replicationpb.NamespaceReplicationConfig{
ActiveClusterName: activeClusterName,
Clusters: []*replicationpb.ClusterReplicationConfig{{activeClusterName}},
},
})
s.NoError(err)
}
Expand Down

0 comments on commit b57b930

Please sign in to comment.