Skip to content

docs: add Node Discovery Mode configuration guide - #295

Open
Aryex wants to merge 1 commit into
mainfrom
alexl/agent/csharp-node-discovery-mode
Open

docs: add Node Discovery Mode configuration guide#295
Aryex wants to merge 1 commit into
mainfrom
alexl/agent/csharp-node-discovery-mode

Conversation

@Aryex

@Aryex Aryex commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add documentation for the NodeDiscoveryMode configuration option that controls how standalone clients discover node roles and topology during connection initialization.

⚠️ Attention: This PR was generated automatically. Verify that all relevant pages have been updated.

Source Commits

  • bf3f63e — Add NodeDiscoveryMode configuration option for standalone clients (#455)

Changes

  • Created new how-to page how-to/connections/node-discovery-mode.mdx documenting:
    • Three discovery modes: Standard, Static, DiscoverAll
    • Complete code examples for all 6 languages (Python, Java, Node.js, Go, PHP, C#)
    • Use-case guidance for each mode (proxy compatibility, auto-discovery, default behavior)
    • Limitations and caveats (Static + ClientName, DiscoverAll one-time only, DiscoverAll + read-only exclusivity)
  • Updated astro.config.mjs sidebar to include the new page in the Connections section

Context

C# #455 implements NodeDiscoveryMode for the C# standalone client, bringing it in line with the other language bindings (Python, Java, Node.js, Go) from valkey-glide #5724. The feature enables proxy compatibility (Static mode skips INFO REPLICATION) and auto-discovery of replicas (DiscoverAll mode). This documentation covers all language clients since the feature was previously undocumented.

cc @jamesx-improving


This PR was generated by the automated documentation pipeline.

@Aryex Aryex added AI Generated documentation Improvements or additions to documentation csharp labels Jul 26, 2026
@Aryex
Aryex force-pushed the alexl/agent/csharp-node-discovery-mode branch from 78e85f6 to bb59435 Compare July 26, 2026 21:26
@Aryex
Aryex requested a review from currantw July 27, 2026 14:54
Signed-off-by: kiro-agent <kiro-agent@users.noreply.github.com>
@Aryex
Aryex force-pushed the alexl/agent/csharp-node-discovery-mode branch from bb59435 to 153cf1b Compare July 27, 2026 14:56
@Aryex
Aryex marked this pull request as ready for review July 27, 2026 14:56

@currantw currantw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed to 153cf1b.

Comment on lines +266 to +307
## Limitations and Caveats

### Static Mode + ClientName

Do not set a client name when using Static mode with a proxy. Proxies may not support the `CLIENT SETNAME` command that the client sends during connection setup, causing the connection to fail.

### DiscoverAll — One-Time Discovery

Discovery happens only at client creation time. Topology changes that occur after the client is created (e.g., a new replica joining) are not re-discovered. To pick up topology changes, recreate the client.

### DiscoverAll + Read-Only Are Mutually Exclusive

DiscoverAll mode requires `INFO REPLICATION` to discover the topology. Read-only mode skips this command. Because of this conflict, combining DiscoverAll with read-only mode is rejected at client creation time.

### Standalone Mode Only

NodeDiscoveryMode is only relevant for standalone clients. In cluster mode, the client uses its own built-in topology discovery mechanism, and this setting is ignored.

## When to Use Each Mode

### Standard (default)

Use Standard mode when:
- You are connecting directly to Valkey nodes (no proxy in between)
- You want the client to verify which node is the primary and which are replicas
- You are providing addresses for all nodes you want the client to connect to

This is the safest and most common choice. Existing code continues to work without changes.

### Static

Use Static mode when:
- Connecting through a proxy (Envoy, Twemproxy, HAProxy) that does not support `INFO REPLICATION`
- The topology is known and will not change (e.g., a single-node deployment)
- You want to minimize connection setup overhead by skipping role verification

### DiscoverAll

Use DiscoverAll mode when:
- You want to connect to all nodes in a replication group but only know one node's address
- You are using `PreferReplica` read strategy and want the client to automatically find replicas
- Your infrastructure provides a single entry point but the client should spread reads across replicas

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it makes sense to incorporate this information into the section for each mode above, rather than in separate section (keep all info for a particular mode in one place).


Standard is the default — no configuration needed. The client sends `INFO REPLICATION` to each provided address to verify node roles.

<Tabs syncKey="progLangInExamples">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are ALL these examples necessary? They only differ by a single line, so seems like just one example for each language would be fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated csharp documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants