From 9c1ee02ab8988d22b27cc46e592b2fe8e3d9c3c0 Mon Sep 17 00:00:00 2001 From: temp Date: Mon, 15 May 2023 17:22:57 -0400 Subject: [PATCH 1/3] no-op commit due to failed cherry-picking From 598f082206464ee8bb804b9dd8cc0d4d5b078a84 Mon Sep 17 00:00:00 2001 From: Nitya Dhanushkodi Date: Mon, 20 Mar 2023 10:00:29 -0700 Subject: [PATCH 2/3] peering: peering partition failover fixes (#16673) add local source partition for peered upstreams --- .changelog/16673.txt | 3 +++ agent/proxycfg/upstreams.go | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 .changelog/16673.txt diff --git a/.changelog/16673.txt b/.changelog/16673.txt new file mode 100644 index 00000000000..f72eedc61c8 --- /dev/null +++ b/.changelog/16673.txt @@ -0,0 +1,3 @@ +```release-note:bug +peering: Fixes a bug where the importing partition was not added to peered failover targets, which causes issues when the importing partition is a non-default partition. +``` diff --git a/agent/proxycfg/upstreams.go b/agent/proxycfg/upstreams.go index 7c16e9f7cf7..074463a54f5 100644 --- a/agent/proxycfg/upstreams.go +++ b/agent/proxycfg/upstreams.go @@ -447,6 +447,9 @@ func (s *handlerUpstreams) watchUpstreamTarget(ctx context.Context, snap *Config if opts.peer != "" { uid = NewUpstreamIDFromTargetID(opts.chainID) + // chainID has the partition stripped. However, when a target is in a cluster peer, the partition should be set + // to the local partition (i.e chain.Partition), since the peered target is imported into the local partition. + uid.OverridePartition(opts.entMeta.PartitionOrDefault()) correlationID = upstreamPeerWatchIDPrefix + uid.String() } From 91df48e4b9e3ecde4dd50e196741d45ac4a8cfac Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Mon, 15 May 2023 19:36:54 -0400 Subject: [PATCH 3/3] Override partition on target --- agent/xds/clusters.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agent/xds/clusters.go b/agent/xds/clusters.go index 3e4d4e5e376..d85865dda77 100644 --- a/agent/xds/clusters.go +++ b/agent/xds/clusters.go @@ -1282,6 +1282,11 @@ func (s *ResourceGenerator) makeUpstreamClustersForDiscoveryChain( targetUID := proxycfg.NewUpstreamIDFromTargetID(targetData.targetID) if targetUID.Peer != "" { + // targetID has the partition stripped, so targetUID will not have a partition either. However, + // when a failover target is in a cluster peer, the partition should be set to the local partition (i.e + // chain.Partition), since the peered failover target is imported into the local partition. + targetUID.OverridePartition(chain.Partition) + peerMeta, found := upstreamsSnapshot.UpstreamPeerMeta(targetUID) if !found { s.Logger.Warn("failed to fetch upstream peering metadata for cluster", "target", targetUID)