CORE: Track HELLO and AUTH state for reconnection - #5145
Merged
Conversation
pratheep-kumar
marked this pull request as ready for review
January 9, 2026 15:21
Contributor
Author
|
@xShinnRyuu @jduo @affonsov Please review this. Thanks. This unblocks PR |
27 tasks
jduo
approved these changes
Jan 15, 2026
affonsov
reviewed
Jan 15, 2026
Collaborator
|
Hi @pratheep-kumar, there is feedback from other maintainers, could you address them? Please add a reply to the review comments so that they can accurately review the changes you have made to fix them. Thank you |
Collaborator
|
Hi @pratheep-kumar , as mentioned above there are some unaddressed comments. Would you be able to handle these to complete the PR? Thanks. |
Collaborator
|
Sorry for the delay in reviews. There’s a review comment left by someone on our team. If you’re able to take care of that, we’ll be happy to merge it right away. Otherwise, I can also jump in and help get it across the line. |
xShinnRyuu
approved these changes
Feb 13, 2026
…ersisting authentication state - Add update_connection_username() and update_connection_protocol() methods to ClusterConnection for cluster-wide state updates - Add UpdateConnectionUsername and UpdateConnectionProtocol operations to cluster routing - Reclassify AUTH command as write operation in cluster routing to ensure state is tracked across all nodes - Update CHANGELOG.md to document HELLO and AUTH state tracking feature - Ensure reconnections preserve protocol version and username from previous successful connections Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
affonsov
force-pushed
the
reconnection-info-update
branch
from
February 13, 2026 18:42
65f5678 to
7c37fc5
Compare
tavomaciel
pushed a commit
to tavomaciel/valkey-glide
that referenced
this pull request
Feb 16, 2026
- Add update_username() and update_protocol() methods to Client for persisting authentication state - Add update_connection_username() and update_connection_protocol() methods to ClusterConnection for cluster-wide state updates - Add UpdateConnectionUsername and UpdateConnectionProtocol operations to cluster routing - Reclassify AUTH command as write operation in cluster routing to ensure state is tracked across all nodes - Update CHANGELOG.md to document HELLO and AUTH state tracking feature - Ensure reconnections preserve protocol version and username from previous successful connections Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> Co-authored-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
prashanna-frsh
pushed a commit
to prashanna-frsh/valkey-glide
that referenced
this pull request
Feb 16, 2026
- Add update_username() and update_protocol() methods to Client for persisting authentication state - Add update_connection_username() and update_connection_protocol() methods to ClusterConnection for cluster-wide state updates - Add UpdateConnectionUsername and UpdateConnectionProtocol operations to cluster routing - Reclassify AUTH command as write operation in cluster routing to ensure state is tracked across all nodes - Update CHANGELOG.md to document HELLO and AUTH state tracking feature - Ensure reconnections preserve protocol version and username from previous successful connections Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> Co-authored-by: Pratheep Kumar <pratheepkumar0403@gmail.com> Signed-off-by: prashanna-frsh <prashanna.rajendran@freshworks.com>
prashanna-frsh
pushed a commit
to prashanna-frsh/valkey-glide
that referenced
this pull request
Feb 16, 2026
- Add update_username() and update_protocol() methods to Client for persisting authentication state - Add update_connection_username() and update_connection_protocol() methods to ClusterConnection for cluster-wide state updates - Add UpdateConnectionUsername and UpdateConnectionProtocol operations to cluster routing - Reclassify AUTH command as write operation in cluster routing to ensure state is tracked across all nodes - Update CHANGELOG.md to document HELLO and AUTH state tracking feature - Ensure reconnections preserve protocol version and username from previous successful connections Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> Co-authored-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
Kaushik-Vijayakumar
pushed a commit
to Kaushik-Vijayakumar/valkey-glide
that referenced
this pull request
Feb 17, 2026
- Add update_username() and update_protocol() methods to Client for persisting authentication state - Add update_connection_username() and update_connection_protocol() methods to ClusterConnection for cluster-wide state updates - Add UpdateConnectionUsername and UpdateConnectionProtocol operations to cluster routing - Reclassify AUTH command as write operation in cluster routing to ensure state is tracked across all nodes - Update CHANGELOG.md to document HELLO and AUTH state tracking feature - Ensure reconnections preserve protocol version and username from previous successful connections Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> Co-authored-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
affonsov
pushed a commit
that referenced
this pull request
Aug 21, 2026
- Add update_username() and update_protocol() methods to Client for persisting authentication state - Add update_connection_username() and update_connection_protocol() methods to ClusterConnection for cluster-wide state updates - Add UpdateConnectionUsername and UpdateConnectionProtocol operations to cluster routing - Reclassify AUTH command as write operation in cluster routing to ensure state is tracked across all nodes - Update CHANGELOG.md to document HELLO and AUTH state tracking feature - Ensure reconnections preserve protocol version and username from previous successful connections Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> Co-authored-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue link
This Pull Request is linked to issue: #5146
Description
This PR implements state tracking for
HELLOandAUTHcommands in glide-core, ensuring that protocol version changes and runtime authentication updates persist across automatic reconnections.Problem
Previously, when a client executed
HELLOorAUTHcommands at runtime and the connection was automatically reconnected, the state changes (protocol version, credentials) were lost. This prevented language bindings from safely exposing these commands as first-class APIs.Solution
1. Protocol Version Tracking (
glide-core/src/client/reconnecting_connection.rs)update_connection_protocol()method to store protocol version changes inconnection_info2. HELLO Command Handling (
glide-core/src/client/mod.rs)is_hello_command()to detect HELLO command executionhandle_hello_command()to extract and store:3. AUTH Command Handling (
glide-core/src/client/mod.rs)handle_auth_command()to track runtime credential changes4. Reconnection Logic Updates
5. Testing
test_hello_command_persistence_after_reconnection()- verifies protocol version persiststest_auth_command_persistence_after_reconnection()- verifies credentials persisttest_select_command_persistence_after_reconnection()Impact on Language Bindings
This unblocks language bindings from exposing
HELLOandAUTHas first-class APIs:hello()andauth()methodsFollows Existing Patterns
This implementation follows the established patterns for:
SELECTcommand tracking (update_connection_database())CLIENT SETNAMEcommand tracking (update_connection_client_name())updateConnectionPassword()methodChecklist
Before submitting the PR make sure the following are checked:
Breaking Changes
None. This is a backward-compatible enhancement.
Additional Notes
connection_infoensures thread-safe access during concurrent command execution and reconnectionupdateConnectionPassword()- useupdateConnectionPassword()for config-based auth, andAUTHcommand for runtime credential switching