Skip to content

fix: fallback to any known node when control node not found by endpoint#847

Merged
dkropachev merged 1 commit intoscylladb:scylla-4.xfrom
dkropachev:fix/schema-queries-fallback-node-lookup
Mar 19, 2026
Merged

fix: fallback to any known node when control node not found by endpoint#847
dkropachev merged 1 commit intoscylladb:scylla-4.xfrom
dkropachev:fix/schema-queries-fallback-node-lookup

Conversation

@dkropachev
Copy link
Copy Markdown

@dkropachev dkropachev commented Mar 19, 2026

Summary

  • When findNode(channel.getEndPoint()) returns empty (e.g. PrivateLink/proxy setups where the control endpoint differs from metadata), fall back to the first available node in metadata instead of throwing an IllegalStateException.
  • The original code chained .orElse() with a Map.Entry (type mismatch) followed by .orElseThrow() on a non-Optional, which didn't compile.

Test plan

  • Verify schema refresh works when control endpoint matches a node in metadata (existing behavior)
  • Verify schema refresh falls back gracefully when control endpoint doesn't match any node
  • Verify IllegalStateException is still thrown when metadata has zero nodes

When the control connection endpoint doesn't match any node in metadata
(e.g. with PrivateLink or proxy setups), fall back to the first available
node instead of immediately throwing an exception.
Copy link
Copy Markdown

@nikagra nikagra left a comment

Choose a reason for hiding this comment

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

👍

@dkropachev dkropachev merged commit 2a6fb7c into scylladb:scylla-4.x Mar 19, 2026
18 of 20 checks passed
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