Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 68 additions & 4 deletions .gen/go/shared/shared.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ require (
github.com/startreedata/pinot-client-go v0.2.0 // latest release supports pinot v0.12.0 which is also internal version
github.com/stretchr/testify v1.10.0
github.com/uber-go/tally v3.3.15+incompatible
github.com/uber/cadence-idl v0.0.0-20251027162905-7b9d8a31de8c
github.com/uber/cadence-idl v0.0.0-20251117201507-110f4fe58fc3
github.com/uber/ringpop-go v0.8.5 // indirect
github.com/uber/tchannel-go v1.22.2 // indirect
github.com/valyala/fastjson v1.4.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ github.com/uber-go/tally v3.3.12+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyu
github.com/uber-go/tally v3.3.15+incompatible h1:9hLSgNBP28CjIaDmAuRTq9qV+UZY+9PcvAkXO4nNMwg=
github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
github.com/uber/cadence-idl v0.0.0-20211111101836-d6b70b60eb8c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20251027162905-7b9d8a31de8c h1:fd00g0M50UuZYetChIAPYUchvi1M+gL3rhbWwOQ6GhE=
github.com/uber/cadence-idl v0.0.0-20251027162905-7b9d8a31de8c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20251117201507-110f4fe58fc3 h1:HNCrtk5iE66Zq8CfMcTCrG+uklPSbE3eqvE2maPUFYU=
github.com/uber/cadence-idl v0.0.0-20251117201507-110f4fe58fc3/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
Expand Down
6 changes: 6 additions & 0 deletions common/domain/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ type (
FromCluster string `json:"fromCluster,omitempty"`
ToCluster string `json:"toCluster,omitempty"`
FailoverType string `json:"failoverType,omitempty"`
Reason string `json:"reason,omitempty"`
}

// FailoverHistory is the history of failovers for a domain limited by the FailoverHistoryMaxSize config
Expand Down Expand Up @@ -614,6 +615,7 @@ func (d *handlerImpl) handleFailoverRequest(ctx context.Context,
failoverType,
&currentActiveCluster,
updateRequest.ActiveClusterName,
updateRequest.FailoverReason,
))
if err != nil {
d.logger.Warn("failed to update failover history", tag.Error(err))
Expand Down Expand Up @@ -1906,6 +1908,7 @@ func NewFailoverEvent(
failoverType constants.FailoverType,
fromCluster *string,
toCluster *string,
reason *string,
) FailoverEvent {
res := FailoverEvent{
EventTime: eventTime,
Expand All @@ -1917,6 +1920,9 @@ func NewFailoverEvent(
if toCluster != nil {
res.ToCluster = *toCluster
}
if reason != nil {
res.Reason = *reason
}
return res
}

Expand Down
3 changes: 3 additions & 0 deletions common/types/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,7 @@ type FailoverDomainRequest struct {
DomainName string `json:"domainName,omitempty"`
DomainActiveClusterName *string `json:"domainActiveClusterName,omitempty"`
ActiveClusters *ActiveClusters `json:"activeClusters,omitempty"`
Reason *string `json:"reason,omitempty"`
}

func (v *FailoverDomainRequest) ToUpdateDomainRequest() *UpdateDomainRequest {
Expand All @@ -1792,6 +1793,7 @@ func (v *FailoverDomainRequest) ToUpdateDomainRequest() *UpdateDomainRequest {
Name: v.DomainName,
ActiveClusterName: v.DomainActiveClusterName,
ActiveClusters: v.ActiveClusters,
FailoverReason: v.Reason,
}
}

Expand Down Expand Up @@ -8027,6 +8029,7 @@ type UpdateDomainRequest struct {
SecurityToken string `json:"securityToken,omitempty"`
DeleteBadBinary *string `json:"deleteBadBinary,omitempty"`
FailoverTimeoutInSeconds *int32 `json:"failoverTimeoutInSeconds,omitempty"`
FailoverReason *string `json:"failoverReason,omitempty"`
}

// IsAFailoverRequest identifies if any part of the request is a failover request
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
github.com/startreedata/pinot-client-go v0.2.0 // latest release supports pinot v0.12.0 which is also internal version
github.com/stretchr/testify v1.10.0
github.com/uber-go/tally v3.3.15+incompatible
github.com/uber/cadence-idl v0.0.0-20251027162905-7b9d8a31de8c
github.com/uber/cadence-idl v0.0.0-20251117201507-110f4fe58fc3
github.com/uber/ringpop-go v0.8.5
github.com/uber/tchannel-go v1.22.2
github.com/urfave/cli/v2 v2.27.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ github.com/uber-go/tally v3.3.12+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyu
github.com/uber-go/tally v3.3.15+incompatible h1:9hLSgNBP28CjIaDmAuRTq9qV+UZY+9PcvAkXO4nNMwg=
github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
github.com/uber/cadence-idl v0.0.0-20211111101836-d6b70b60eb8c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20251027162905-7b9d8a31de8c h1:fd00g0M50UuZYetChIAPYUchvi1M+gL3rhbWwOQ6GhE=
github.com/uber/cadence-idl v0.0.0-20251027162905-7b9d8a31de8c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20251117201507-110f4fe58fc3 h1:HNCrtk5iE66Zq8CfMcTCrG+uklPSbE3eqvE2maPUFYU=
github.com/uber/cadence-idl v0.0.0-20251117201507-110f4fe58fc3/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
Expand Down
6 changes: 6 additions & 0 deletions tools/cli/domain_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,12 @@ func (d *domainCLIImpl) FailoverDomain(c *cli.Context) error {
}
failoverRequest.ActiveClusters = &ac
}
// Set the reason for failover (will use default value if not specified)
reason := c.String(FlagFailoverReason)
if reason != "" {
failoverRequest.Reason = common.StringPtr(reason)
}

_, err = d.failoverDomain(ctx, failoverRequest)
if err != nil {
if _, ok := err.(*types.EntityNotExistsError); ok {
Expand Down
5 changes: 5 additions & 0 deletions tools/cli/domain_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ var (
Aliases: []string{"acs-json"},
Usage: `Active clusters by cluster attribute in JSON format. Eg {"attributeScopes":{"region-us-east1":{"clusterAttributes":{"new-york":{"activeClusterName":"cluster1"}}}}}`,
},
&cli.StringFlag{
Name: FlagFailoverReason,
Aliases: []string{"r"},
Usage: "Reason for failover (for tracking and transparency)",
},
}

listFailoverHistoryFlags = []cli.Flag{
Expand Down
1 change: 1 addition & 0 deletions tools/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const (
FlagActiveClusters = "active_clusters"
FlagActiveClustersJSON = "active_clusters_json"
FlagClusters = "clusters"
FlagFailoverReason = "reason"
FlagIsGlobalDomain = "global_domain" // active-passive domain
FlagDomainData = "domain_data"
FlagEventID = "event_id"
Expand Down
Loading