Skip to content

Conversation

@currantw
Copy link
Collaborator

Add RefreshTopologyFromInitialNodes Configuration Option

Overview

This PR adds support for the RefreshTopologyFromInitialNodes configuration option, enabling cluster topology refresh using only the initial seed nodes rather than the internal cluster view.

Changes

  • ClusterClientConfigurationBuilder: Added RefreshTopologyFromInitialNodes boolean property with default value false, with WithRefreshTopologyFromInitialNodes(bool) fluent builder method.
  • ConnectionConfig: Updated internal record to include RefreshTopologyFromInitialNodes field.
  • FFI.ConnectionConfig: Updated constructor to accept and pass the configuration value to the native layer.
  • ConnectionRequest: Added properly marshalled boolean field for FFI.
  • ConnectionConfigurationTests: New test class with coverage for topology refresh

Consistency

This implementation follows the same patterns established in other language clients:

  • Python: #4855
  • Java: #4870
  • Go: #4871
  • Node: #4872

Checklist

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • Documentation is updated (XML docs added).
  • Follows existing C# client patterns and conventions.
  • No breaking changes

@currantw currantw requested a review from Copilot October 30, 2025 16:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the RefreshTopologyFromInitialNodes configuration option for cluster clients, enabling topology updates to query only the initial nodes instead of the internal cluster view. It also updates the VS Code default solution setting.

  • Adds RefreshTopologyFromInitialNodes property and WithRefreshTopologyFromInitialNodes() method to ClusterClientConfigurationBuilder
  • Threads the new boolean configuration through the internal FFI structs and connection configuration
  • Updates VS Code workspace settings to use the correct solution file name

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/Valkey.Glide.UnitTests/ConnectionConfigurationTests.cs Adds unit tests verifying the default, true, and false values of RefreshTopologyFromInitialNodes
sources/Valkey.Glide/Internals/FFI.structs.cs Adds the refreshTopologyFromInitialNodes parameter to the FFI ConnectionConfig and ConnectionRequest structs
sources/Valkey.Glide/ConnectionConfiguration.cs Adds the RefreshTopologyFromInitialNodes property and builder method to ClusterClientConfigurationBuilder, plus updates the internal config record
.vscode/settings.json Updates the default solution file name from "csharp.sln" to "Valkey.Glide.sln"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@currantw currantw changed the base branch from currantw/topology-refresh to main October 30, 2025 17:05
@currantw currantw changed the title feat: Add RefreshTopologyFromInitialNodes Configuration Option feat: Add RefreshTopologyFromInitialNodes Oct 30, 2025
@currantw currantw self-assigned this Oct 30, 2025
@currantw currantw marked this pull request as ready for review October 30, 2025 17:22
@currantw currantw requested a review from a team as a code owner October 30, 2025 17:22
@currantw currantw force-pushed the currantw/topology-refresh branch from a83f4b7 to a16c178 Compare November 4, 2025 00:19
@currantw currantw force-pushed the currantw/topology-refresh branch from a16c178 to d60bab5 Compare November 5, 2025 17:54
@currantw currantw force-pushed the currantw/topology-refresh branch from d60bab5 to 34caecc Compare November 5, 2025 20:06
Signed-off-by: currantw <[email protected]>
@currantw currantw merged commit b1ae357 into valkey-io:main Nov 6, 2025
11 checks passed
@currantw currantw deleted the currantw/topology-refresh branch November 6, 2025 16:57
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.

5 participants