Repository navigation
Treat an unknown-command HELLO reply as RESP2 under --protocol=resp2 - #884
Merged
Merged
Conversation
With --protocol=resp2 memtier sends HELLO 2 during connection setup. A server without HELLO (Redis before 6.0, or another RESP server) answers "-ERR unknown command 'HELLO'", which was treated as a fatal setup failure, so the run never sent a request and was ended by --connection-stage-timeout. RESP2 is the wire default, so the connection can simply go on: the unknown-command reply now completes the HELLO step, with one warning per process. Under --protocol=resp3 the failure stays fatal, but now says that the server does not support HELLO and RESP3 needs Redis 6.0 or later. Other HELLO errors are unchanged. Fixes #488. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reply answers memtier's own HELLO, so the quoted command name need not be checked: any -ERR unknown command covers servers that word it differently. The RESP3 note now says when Redis added HELLO rather than what every server requires. The RESP3 test's peer echoes '3'. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both scripted-peer options (reject_data from #894, hello_error from this PR) and both sets of new tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #488.
With
--protocol=resp2, memtier sendsHELLO 2during connection setup and treats any error reply as fatal. A server without HELLO (Redis < 6.0, or another RESP server) answers-ERR unknown command 'HELLO', so the run sent no requests and--connection-stage-timeoutended it with exit 2. The default protocol sends no HELLO and is unaffected.Fix (
shard_connection.cpp):--protocol=resp2: an unknown-command reply to HELLO counts as a successful HELLO step, since RESP2 is the wire default. One warning per process says the server does not support HELLO, so RESP2 was assumed.--protocol=resp3: it stays fatal, with an added line:server does not support HELLO, so RESP3 is unavailable (Redis added HELLO in 6.0).-NOPROTO, auth errors) behave as before. No new flags.Any
-ERR unknown commandreply to HELLO counts, whatever the quoting ('HELLO'in Redis 6+, backticks in 5.x, or none), since it answers memtier's own HELLO.Tests: the scripted peer in
tests/test_cluster_slots_bad_reply.pygets ahello_erroroption, andtests/test_connection_setup_rejected.pygets three tests:-NOPROTOunder RESP2 still fails.With master's
shard_connection.cppthe first two fail: the RESP2 run exits 2 withHELLO failedand 0 requests. Against a real Redis 5.0.14 (redis:5) with--protocol=resp2, master exits 2 and this PR runs normally, standalone and in cluster mode, with-a,--select-dband--pipeline=16. Results (ASan + UBSan, Ubuntu 24.04 container):make checkpasses, and both touched test files pass 37/37 standalone.🤖 Generated with Claude Code
Note
Low Risk
Narrow change to connection-setup HELLO handling for explicit resp2/resp3; workload and auth paths unchanged aside from allowing older Redis to proceed.
Overview
Fixes #488: with
--protocol=resp2, memtier no longer aborts connection setup when the server replies toHELLOwith unknown command (Redis < 6.0 and other RESP servers withoutHELLO).In
shard_connection.cpp, a newis_unknown_hello_error()matcher (case-insensitive-ERR unknown command) changesrt_hellohandling: under RESP2, that reply is treated as a successful setup step (wire-default RESP2), with one process-wide warning; under RESP3, setup still fails but logs that RESP3 needs HELLO (Redis 6.0+). Other HELLO failures (e.g.-NOPROTO) are unchanged.Tests: the scripted peer gains
hello_error, plus three cases intest_connection_setup_rejected.py(RESP2 succeeds, RESP3 fails clearly, non-unknown HELLO still fails).Reviewed by Cursor Bugbot for commit 249b99b. Bugbot is set up for automated code reviews on this repo. Configure here.