Skip to content

xds: Move backend service label plumbing to CDS#12882

Open
becomeStar wants to merge 1 commit into
grpc:masterfrom
becomeStar:xds-backend-service-plumbing-cds
Open

xds: Move backend service label plumbing to CDS#12882
becomeStar wants to merge 1 commit into
grpc:masterfrom
becomeStar:xds-backend-service-plumbing-cds

Conversation

@becomeStar

Copy link
Copy Markdown
Contributor

Addresses #12431.

This moves backend service metric label plumbing from xds_cluster_impl to cds, matching the A75/A89 aggregate cluster behavior.

Previously, xds_cluster_impl added the grpc.lb.backend_service pick-details label and propagated NameResolver.ATTR_BACKEND_SERVICE to its child policy. That works for simple clusters, but it is the wrong layer after A75 because aggregate clusters need the leaf CDS cluster name, not the aggregate root cluster name.

This change makes CDS responsible for backend service plumbing:

  • non-aggregate CDS adds the grpc.lb.backend_service pick-details label using the CDS cluster name
  • non-aggregate CDS propagates NameResolver.ATTR_BACKEND_SERVICE to its child policy, so WRR can consume the backend service context
  • aggregate root CDS does not add the backend service attribute or pick-details label
  • leaf CDS instances under an aggregate cluster add their own leaf cluster name
  • xds_cluster_impl no longer owns backend service pick-details label or child attribute propagation

The existing InternalEquivalentAddressGroup.ATTR_BACKEND_SERVICE path is left unchanged for endpoint/subchannel metrics.

Tests cover:

  • non-aggregate CDS propagating NameResolver.ATTR_BACKEND_SERVICE
  • non-aggregate CDS adding grpc.lb.backend_service
  • aggregate root CDS not adding the root cluster name
  • aggregate leaf CDS instances propagating leaf cluster names
  • xds_cluster_impl no longer adding backend service labels or attributes
  • picker tests using a non-null PickDetailsConsumer, matching the real PickSubchannelArgs contract

A75 changed aggregate cluster handling so aggregate clusters are
 represented as priority children whose children are CDS policies.
In that structure, A89 expects backend service metric plumbing to go
 through CDS instead of xds_cluster_impl.

Set NameResolver.ATTR_BACKEND_SERVICE from CdsLoadBalancer2 for
 non-aggregate leaf clusters so WRR metrics can read the backend service.
Also add the grpc.lb.backend_service pick details label from
 the leaf CDS picker wrapper.

Do not add the aggregate root cluster as backend_service. Remove the
 old backend_service attribute and pick details label handling from
 ClusterImplLoadBalancer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant