Skip to content

upstream: support SDS in HCS-built clusters#45351

Merged
mathetake merged 3 commits into
envoyproxy:mainfrom
mathetake:fix-prod-cluster-info-factory-sds
Jun 11, 2026
Merged

upstream: support SDS in HCS-built clusters#45351
mathetake merged 3 commits into
envoyproxy:mainfrom
mathetake:fix-prod-cluster-info-factory-sds

Conversation

@mathetake

Copy link
Copy Markdown
Member

Commit Message: upstream: support SDS in HCS-built clusters
Additional Description:

ProdClusterInfoFactory constructed TransportSocketFactoryContextImpl with the 3-arg ctor, leaving init_manager_ null. The SDS branch of getTlsCertificateConfigProviders (context_config_impl.cc:74) calls factory_context.initManager() unconditionally, so any HCS carrying tls_certificate_sds_secret_configs aborts the proxy in HdsCluster construction. Passing the server's init manager would also assert at runtime because HCS arrives long after the server has transitioned to Initialized.

Mirror the per-cluster pattern used by ClusterImplBase for CDS clusters (upstream_impl.cc:1622): construct a fresh Init::ManagerImpl for each HCS-built cluster, set it on the factory_context, build the transport socket factory and matcher, then drive initialize() with a no-op watcher so the registered SDS subscriptions kick off their file watchers immediately.

Risk Level: mid (touches core)
Testing: done
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #45351 was opened by mathetake.

see: more, trace.

ProdClusterInfoFactory constructed TransportSocketFactoryContextImpl
with the 3-arg ctor, leaving init_manager_ null. The SDS branch of
getTlsCertificateConfigProviders (context_config_impl.cc:74) calls
factory_context.initManager() unconditionally, so any HCS carrying
tls_certificate_sds_secret_configs aborts the proxy in HdsCluster
construction. Passing the server's init manager would also assert at
runtime because HCS arrives long after the server has transitioned to
Initialized.

Mirror the per-cluster pattern used by ClusterImplBase for CDS clusters
(upstream_impl.cc:1622): construct a fresh Init::ManagerImpl for each
HCS-built cluster, set it on the factory_context, build the transport
socket factory and matcher, then drive initialize() with a no-op watcher
so the registered SDS subscriptions kick off their file watchers
immediately.

Signed-off-by: Takeshi Yoneda <tyoneda@netflix.com>
@mathetake
mathetake force-pushed the fix-prod-cluster-info-factory-sds branch from f757c95 to 02a6d90 Compare May 29, 2026 16:14
@mathetake
mathetake marked this pull request as ready for review May 29, 2026 16:24
params.server_context_, *scope, params.server_context_.messageValidationVisitor());
factory_context.setInitManager(init_manager);

// TODO(JimmyCYJ): Support SDS for HDS cluster.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is basically about resolving this TODO

@mathetake

Copy link
Copy Markdown
Member Author

/retest

@mathetake
mathetake requested a review from wbpcode June 8, 2026 23:06
std::unique_ptr<ClusterInfoImpl>);

Init::WatcherImpl noop_watcher("HdsCluster cluster info", []() {});
init_manager.initialize(noop_watcher);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one question, what will happens if the cluster cannot complete the initialization immediately (for example, , what will happens?

I checked the source code, the init manager is designed to be safe even the init manager is destroyed before the target or in reverse.

@wbpcode

wbpcode commented Jun 11, 2026

Copy link
Copy Markdown
Member

/retest

@mathetake
mathetake merged commit 444c0b8 into envoyproxy:main Jun 11, 2026
28 checks passed
@mathetake
mathetake deleted the fix-prod-cluster-info-factory-sds branch June 11, 2026 15:35
nezdolik pushed a commit to nezdolik/envoy that referenced this pull request Jun 16, 2026
Commit Message: upstream: support SDS in HCS-built clusters
Additional Description:

ProdClusterInfoFactory constructed TransportSocketFactoryContextImpl
with the 3-arg ctor, leaving init_manager_ null. The SDS branch of
getTlsCertificateConfigProviders (context_config_impl.cc:74) calls
factory_context.initManager() unconditionally, so any HCS carrying
tls_certificate_sds_secret_configs aborts the proxy in HdsCluster
construction. Passing the server's init manager would also assert at
runtime because HCS arrives long after the server has transitioned to
Initialized.

Mirror the per-cluster pattern used by ClusterImplBase for CDS clusters
(upstream_impl.cc:1622): construct a fresh Init::ManagerImpl for each
HCS-built cluster, set it on the factory_context, build the transport
socket factory and matcher, then drive initialize() with a no-op watcher
so the registered SDS subscriptions kick off their file watchers
immediately.

Risk Level: mid (touches core)
Testing: done
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Takeshi Yoneda <tyoneda@netflix.com>
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.

2 participants