Skip to content

Record the key of --command requests in --failed-keys-file - #599

Merged
fcostaoliveira merged 1 commit into
masterfrom
fix/failed-keys-arbitrary-key
Oct 14, 2026
Merged

fcostaoliveira merged 1 commit into
masterfrom
fix/failed-keys-arbitrary-key

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

--failed-keys-file logs every failed --command request with an empty key, for example ARBITRARY,"","-MOVED 6971 ..." (seen in the output review of #583). That makes the file useless for finding which keys failed. Built-in SET/GET rows are also "" unless --retry-on-error is on.

Root cause

  • request::m_key is set only by send_set_command(), send_get_command() and send_mget_command(), inside if (m_config->retry_on_error), and by verify_request.
  • send_arbitrary_command_end() never calls set_key_for_log(). The __key__ value passes through send_arbitrary_command(arg, val, len), but nothing keeps it.

m_key has a second reader: cluster retry_after_redirect(), replay re-routing and the -READONLY path hash it to find the slot owner. For arbitrary requests the key was empty, so a -MOVED retry went back to the same shard and kept getting MOVED until --max-retries ran out.

Fix

  • send_arbitrary_command() keeps the first key_type value it writes, in a reused per-connection std::string. That value includes any {tag} prefix or suffix, so it is the key actually sent. The CSV logs it, and retries hash its {tag}. The first send of a {t}:__key__ command is still routed by the bare __key__ value; that is Cluster --command: text around __key__ (e.g. '{tag}-__key__', 'user:__key__') is ignored when choosing the shard (requests get -MOVED) #614, fixed by Route cluster --command requests by the full key argument #616.
  • send_arbitrary_command_end() attaches it to the request. For multi-key commands only the first key is kept, the same as MGET.
  • Keys are captured for SET/GET/MGET/arbitrary whenever --retry-on-error or --failed-keys-file is set. The new private helper wants_request_key() holds that condition. When neither flag is set, nothing is copied.
  • Recording a key must not change recovery. The -READONLY handler routes by m_key only under --retry-on-error. It also treats a slot primary equal to the rejecting connection as "no live primary", because the map is stale: it refreshes and drops instead of re-queuing onto the node that was just demoted. The MOVED and replay paths already require --retry-on-error.
  • With --transaction, -READONLY never resends a command on another connection. Resending would split the MULTI/EXEC block, so the handler drops and refreshes, like MOVED/ASK and replay hand-off.
  • Out of scope: --monitor-input requests in cluster mode. Their keys are literal arguments, so those requests still carry no key.

Tests

This PR is one commit, 5a25881, rebased onto master c6006e7 (after #593). Every commit in the history is correct on its own: there is no intermediate commit where --failed-keys-file changes -READONLY recovery.

--help for --failed-keys-file now says the logged key is the one sent, including any {tag} and affixes, and that a multi-key command logs only its first key.

New test test_retry_on_error.py:test_failed_keys_file_records_key (standalone; it skips in cluster mode like its neighbours). It seeds keys of the wrong type and checks that the CSV key column equals the keys sent in each of these cases:

  • LPUSH __key__ v
  • the same command with --retry-on-error
  • the affixed LPUSH {t}:__key__ v
  • SINTER __key__ list-__key__, which must log its first key
  • built-in GET without --retry-on-error
  • MGET without --retry-on-error, which fails with -NOPERM through an ACL user that lacks mget
binary runs result
origin/master c6006e7 1 fails: the CSV key column is "" (e.g. ['', '', ''] == ['fk:1', 'fk:2', 'fk:3'])
origin/master e4d14e8 (earlier 4-case version) 5 0/5 pass, same failure
this branch (5a25881) 1 (earlier heads 5) pass

At 5a25881, all passing:

  • test_retry_on_error.py: 9/9 on --env oss, and 9/9 on --env oss-cluster --shards-count 3 --use-slaves.
  • test_cluster_redirect_stats.py: 9/9.
  • test_read_preference_modes.py: 8/8 with replicas.
  • test_read_preference_failover.py: 2/2 with replicas.
  • test_cluster_transaction.py: 17/17 with replicas.

Cluster routing was measured by hand on 3 primaries:

  • Command: --cluster-mode --retry-on-error --max-retries=3 -t1 -c2 --pipeline=16 --test-time=6 --command="SET __key__ v" --failed-keys-file=...
  • A 200-slot redis-cli --cluster reshard runs 2 s into each run.
  • Terminal MOVED rows per run:
    • master: 8, 14, 15, 13, 14, all with key ""
    • this branch: 0, 0, 0, 1, 0, with the real key

The branch matches what built-in SET/GET already get.

memtier_benchmark without --cluster-mode, pointed at a cluster node, shows the #583-style row change from ARBITRARY,"","-MOVED 10166 ..." to ARBITRARY,"k:1","-MOVED 10166 ...".

Cluster coverage is in tests/test_cluster_failed_keys.py, which uses two scripted peers, A and B (see the PR comments for full numbers):

  • -READONLY from a demoted A, with and without --failed-keys-file and --retry-on-error: the test expects 1 write on A, 49 on B, and at least 2 CLUSTER SLOTS.
  • MOVED retry with --retry-on-error, with and without --failed-keys-file, for built-in SET, --command and a {b}:__key__ key. After the refresh A keeps half the slots, so a retry not routed by its key loops on A. The test checks Count, Connection Errors and the redirect count from the JSON stats, and expects at most 2 redirects. A keyless retry gives 6.
  • Stable topology, a write sent to replica B via --command-is-read --read-preference=secondary. Without --retry-on-error, every -READONLY from B schedules a refresh (at least half of B's writes, 47 of 48 measured), with or without --failed-keys-file. With it, all 50 writes complete on A with no refresh. How many writes reach B before its connection is ready depends on timing, so the checks are relative and require at least one write on B.
  • --transaction with --pipeline=4: a -READONLY inside MULTI must never reach B outside MULTI. The test also requires at least one -READONLY sent after A served the new map, so it can't pass without exercising the handler.

tests/test_cluster_readonly_drop.py (from #593) checks that a request dropped after -READONLY still counts as an op. With this PR, its single self-primary peer takes the first drop site (the map names the rejecting connection), so the refused-retry site lost its coverage. The file now has two tests:

  • test_readonly_stale_primary_drop_counted: the original single-peer case, which takes site 1.
  • test_readonly_refused_retry_counted: two peers, with B the slot primary and A its replica. A write sent to A is re-routed to B, and --max-retries=0 refuses the retry, so it takes site 2.

Mutants each test kills (5a25881 passes test_cluster_failed_keys.py + test_cluster_readonly_drop.py 6/6 in 3/3 runs, and 9/9 with three suites running in parallel):

build failing test
!m_config->transaction removed from the READONLY guard --transaction READONLY: 1 SET reached B outside MULTI
retry_on_error && removed from the READONLY guard replica READONLY: 0 refreshes for 49 writes on B
site 2 (refused retry) back to finalize_dropped_redirect test_readonly_refused_retry_counted: Count 1, expected 20
site 1 (no live primary) back to finalize_dropped_redirect test_readonly_stale_primary_drop_counted: Ops/sec 0
wants_request_key() = failed_keys_file only MOVED retry without the file: 6 redirects
retry hashes the whole key instead of the {tag} MOVED retry, tagged key: 6 redirects, failed row
MGET key gated on retry_on_error records_key, MGET case: key ""
arbitrary command keeps the last key records_key, SINTER case: list-fk:N logged

Affected versions

2.4.0 through 2.5.2 and master.

Fixes #596

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🤖 Automated first-pass review — a human maintainer's review is still required before merge.

Thanks for this. I went through the diff and the description, and left a few comments below.

The CSV part looks right to me. Every send_arbitrary_command(arg, val, len) call site in client.cpp / cluster_client.cpp ends with a matching send_arbitrary_command_end(), so I don't see a way for m_arbitrary_log_key to carry over into the next request. When neither flag is set nothing is copied, so the default hot path doesn't change. And filling a column that used to be "" doesn't change the CSV format, so I see no compat concern there. The test_retry_on_error.py case failing 0/5 on master and passing 5/5 here is the kind of fails-then-passes evidence we want for an output fix.

  1. I think this PR is really three changes: the CSV key fix, the -READONLY p != conn_id stale-map change, and the --transaction guard on -READONLY. The last two change cluster recovery behaviour for --retry-on-error users even when --failed-keys-file isn't set. Did you consider moving the -READONLY changes into their own PR? I'm not insisting. I can see that they partly exist so that filling m_key doesn't change recovery. But it would make bisecting easier if one of them regresses.

  2. On p != conn_id: with --retry-on-error, a built-in SET that gets -READONLY from a node the map still calls primary used to be re-queued on the same connection. Now it's dropped as a terminal error after the refresh. I agree that looping on a demoted node is worse. Still, I wonder whether a user who passed --retry-on-error would expect the request to be held and retried once the refresh lands, rather than dropped. Is there a reason it can't be parked like the MOVED path does? If that's out of scope, fine, but it might deserve a line in the description as an intended behaviour change.

  3. A few assertions in test_cluster_failed_keys.py rely on exact counts (writes["A"] == 1 / writes["B"] == 49, writes["A"] == 50) and on the 10 ms / 50 ms sleeps in the scripted peers. They look deterministic at --pipeline=1, but have these been run under the ASAN/valgrind CI jobs? Those are where I'd expect timing assumptions to break first.

  4. Nitpicking: the MGET case creates an ACL user, so it needs Redis 6+. If any CI matrix entry still runs an older server, it might be worth a version skip.

The core fix looks solid to me. I'd mostly like to hear back on (2) before this merges.

@fcostaoliveira

fcostaoliveira commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

This also fixes the -READONLY reroute for --command traffic in cluster mode, which I found while working on #592. Before this branch, arbitrary_request never carried m_key, so the READONLY branch of cluster_client::handle_response() always ended up with primary_target == UINT_MAX, even with --retry-on-error. It then dropped the request and sent CLUSTER SLOTS on the replica every time.

Repro: local 3 primaries + 3 replicas, a write script that a replica rejects with -READONLY:

memtier_benchmark -s 127.0.0.1 -p <primary> --cluster-mode \
  --read-preference secondary --read-preference-fallback primary \
  --command 'EVAL "return redis.call(\"set\",KEYS[1],\"x\")" 1 __key__' --command-is-read \
  -t 2 -c 2 --requests 500 --retry-on-error
Build EVALs executed on primaries (of 2000) -READONLY on replicas CLUSTER SLOTS sent
master e4d14e8 655 / 648 / 661 1345 / 1352 / 1339 1347 / 1353 / 1340
this branch a900781 2000 / 2000 / 2000 1974 / 1970 / 1967 4 / 4 / 4

So with this branch, every rejected request is retried on the slot primary and completes.

One leftover, small enough that I haven't filed it: without --retry-on-error and without --failed-keys-file, the request still has no key. Each -READONLY then still takes the "no live primary known" branch and sends CLUSTER SLOTS on the replica. That's 13,412 refreshes for 20,000 requests (--requests 5000), against 4 when --failed-keys-file is set. The request is dropped either way, so only the extra refreshes differ. A refresh on a replica connection is also what exposes the stall in #602.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Fix for the semantics block (READONLY recovery changed by --failed-keys-file)

The reviewer was right. The previous head let --failed-keys-file fill request::m_key, and the -READONLY handler routed by m_key whether or not --retry-on-error was set. After a demotion the slot map still names the rejecting connection as the primary. That connection is connected, so the handler never took its "no live primary → set_cluster_slots() + drop" branch, never refreshed, and every later write went back to the demoted node.

The new commit changes the READONLY handler in cluster_client::handle_response():

  • It routes by m_key only under --retry-on-error. That is the only mode in which it can retry. Without retry, a recorded key no longer affects recovery: the handler takes the same refresh + drop branch as before Record the key of --command requests in --failed-keys-file #599.
  • It treats slot_primary_conn_id() == conn_id as "no live primary". If the map still says the connection that just answered -READONLY is the primary, the map is stale, so the handler refreshes instead of re-queuing onto it. This is what the handler comment already required. Built-in SET/GET with --retry-on-error had the same re-queue loop on master, so this fixes that too.
  • It updates the stale retry_after_redirect() header comment.

The MOVED and replay paths already returned early without --retry-on-error, so they need no change.

Numbers, before → after (reviewer's fakes; previous head ae9d33b vs this head 74df2aa):

scenario origin/master 1ef64ef previous head this head
fake_demote, --command "INCR __key__" -n 200 --failed-keys-file 2 CLUSTER SLOTS, A:1, B:199 1 CLUSTER SLOTS, A:200, B:0 2 CLUSTER SLOTS, A:1, B:199
same, no --failed-keys-file 2, A:1, B:199 2, A:1, B:199 2, A:1, B:199
fake_ro, --ratio=1:0 -n 50 --failed-keys-file 50 CLUSTER SLOTS / 50 SET 1 / 50 50 / 50
fake_ro, same + --retry-on-error --max-retries=3 1 / 200 (re-queues onto the rejecting conn) 1 / 200 50 / 50

New tests in tests/test_cluster_failed_keys.py. Two scripted RESP peers, in the style of test_cluster_redirect_stats.py. The first CLUSTER SLOTS reply says A is the primary for every slot, and every later reply says B is.

  • test_failed_keys_file_does_not_change_readonly_recovery: A answers writes with -READONLY. Runs built-in SET and --command, each with and without --failed-keys-file and --retry-on-error. It asserts exactly 1 write on A, 49 on B, at least 2 CLUSTER SLOTS, and a single memtier-1 row in the CSV.
  • test_command_moved_retry_goes_to_key_owner: A answers writes with -MOVED, and --retry-on-error is on. It asserts that all 20 writes complete on B and that nothing is logged as failed. This covers the cluster routing claim for --command, which the standalone test skipped.

Results over 5 runs each:

  • this head: 2/2 tests pass in 5/5 runs.
  • previous head: the READONLY test fails in 5/5 runs (A:50/B:0, 1 CLUSTER SLOTS).
  • origin/master: both tests fail in 5/5 runs. --command MOVED retries are dropped as REPLAY,"",no-slot-owner-for-replay, SET with --retry-on-error loops on A, and keys are "".

Other suites at 74df2aa:

  • test_retry_on_error.py: 9/9 on standalone and 9/9 on a 3-shard cluster with replicas.
  • test_cluster_redirect_stats.py: 4/4.
  • test_read_preference_failover.py: 2/2 on a 3-shard cluster with replicas.

The branch is rebased on origin/master 1ef64ef. The head is 74df2aa, on top of the rebased original commit ae9d33b.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Following up on the automated first-pass review:

  • Routing side effect: a scripted test now covers it. test_command_moved_retry_goes_to_key_owner checks that a --command retried after -MOVED lands on the key's new owner, and it fails on master. The semantics review also found that the -READONLY handler routed by m_key without --retry-on-error, so recording a failed key changed recovery. 74df2aa fixes that (details in the comment above). The --transaction paths are unchanged.
  • Stale retry_after_redirect() comment: updated in 74df2aa. The same-connection fallback now only applies to requests with no key.
  • --monitor-input in cluster mode: agreed, it's out of scope. Its keys are literal arguments, so those requests still carry no key, and MOVED retries there still go back to the same connection. I've added a note to the PR body and to the comment above retry_after_redirect().

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

@fcostaoliveira, about the -READONLY reroute for --command:

  • With --retry-on-error: still in place. At 74df2aa the handler routes by key to the slot primary, as on the earlier head. It now also treats "slot primary == the connection that just said READONLY" as a stale map and refreshes, instead of re-queuing onto it. In your EVAL setup the primary is a different connection from the rejecting replica, so that branch doesn't fire and your 2000/2000 result should still hold. I couldn't re-run your repro here, because my local 3+3 cluster never produced -READONLY for that EVAL, even on master.
  • Your leftover case (no retry flag): I've made that the intended behaviour, with or without --failed-keys-file. The semantics review blocked the earlier head because the file alone changed recovery: 1 CLUSTER SLOTS and every write back to a demoted primary. Recording a failure must not change routing, so without --retry-on-error the handler now does what master does, a refresh and a drop. The 4-vs-13,412 refresh difference you measured was that same side effect. If the extra refreshes on replica connections are worth reducing, that should be its own change. It ties into Cluster --read-preference: connections held during a replica's CLUSTER SLOTS refresh are never woken; --requests run stops short #602.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

472442a addresses the lifetime and test reviews of 74df2aa.

Lifetime BLOCK: -READONLY split a --transaction block. The READONLY routing condition now also requires !m_config->transaction, so a -READONLY inside MULTI drops and refreshes, like MOVED/ASK and replay hand-off. On the reviewer's harness (--pipeline=4 --requests=60 --retry-on-error --max-retries=3), naked SETs on B went from 1 in 3/3 runs on 74df2aa to 0 in 5/5 runs.

Semantics SHOULD-FIX: the retry_on_error guard was untested. New test: a stable topology where a write marked --command-is-read goes to replica B. Without --retry-on-error it must refresh on each -READONLY (at least 40 per 50 requests; measured 47), with or without --failed-keys-file. With --retry-on-error, all 50 writes complete on A with no refresh.

Test-review items:

  • MOVED retry: the test now uses a map where A keeps half the slots after the refresh, so a retry not routed by its key loops on A. It runs with and without --failed-keys-file, for SET, --command and a {b}:__key__ key. It asserts Count, Connection Errors and the redirect count from the JSON stats, not write counts. Cluster mode rejects multi-key commands, so the {tag} key is the cluster case.
  • records_key: new MGET case without --retry-on-error (-NOPERM through an ACL user without mget), and SINTER __key__ list-__key__, which pins "first key only".

Every test now fails on a mutant:

build fails
74df2aa --transaction READONLY (1 SET reached B outside MULTI)
retry_on_error && removed from the READONLY guard replica READONLY (0 refreshes)
wants_request_key() = failed_keys_file only (M3) MOVED retry, no file (6 redirects)
retry hashes the whole key, not the {tag} MOVED retry, tagged key
MGET key gated on retry_on_error (M11) records_key MGET (key "")
arbitrary keeps the last key records_key SINTER (list-fk:N)

At 472442a:

  • test_cluster_failed_keys.py: 4/4 in 5/5 runs.
  • test_retry_on_error.py: 9/9 on standalone and 9/9 on a 3-shard cluster with replicas.
  • test_cluster_transaction.py: 17/17 on a 3-shard cluster with replicas.
  • test_read_preference_failover.py: 2/2.
  • test_cluster_redirect_stats.py: 4/4.

The PR body now says the {t}:__key__ fix covers the logged key and retry routing only. The first send is still routed by the bare key (#614, fixed in #616).

send_arbitrary_command_end() never attached the __key__ value to the
arbitrary_request, so every failed --command request was logged to
--failed-keys-file as `ARBITRARY,"",...`. SET/GET/MGET attached their key
only under --retry-on-error, so without it they logged "" as well.

Keep the first key_type argument written for an arbitrary command (with
any {tag} and affixes, i.e. the key actually sent) and attach it when the
request is created. Capture keys for SET/GET/MGET/arbitrary whenever
--retry-on-error or --failed-keys-file is set (wants_request_key()).

request::m_key is also what cluster retry_after_redirect(), replay
re-routing and the -READONLY handler hash to find the slot owner, so:

- A --command retried after -MOVED now follows its key to the new owner
  instead of going back to the same shard until --max-retries runs out.
- Recording a failure must not change recovery. The -READONLY handler
  routes by m_key only under --retry-on-error, and never under
  --transaction, where resending one command elsewhere would split the
  MULTI/EXEC block (MOVED/ASK and replay hand-off already refuse this).
- A slot map that still names the rejecting connection as the primary is
  stale (it was just demoted), so -READONLY refreshes instead of
  re-queuing onto it. Built-in SET/GET with --retry-on-error looped there
  before.

The first send of a {tag}ged --command is still routed by the bare key
(#614).

Tests:
- test_retry_on_error.py: the CSV key column for --command (plain,
  {tag}ged, with --retry-on-error, two keys -> first key), built-in GET and
  MGET without --retry-on-error.
- test_cluster_failed_keys.py, scripted A/B peers: -READONLY recovery after
  a demotion with and without --failed-keys-file / --retry-on-error; a
  write sent to a replica refreshes on every -READONLY without
  --retry-on-error; -READONLY inside --transaction is never resent outside
  MULTI; MOVED retries (SET, --command, {tag}ged key, with and without
  --failed-keys-file) reach the key's owner within two redirects.
- test_cluster_readonly_drop.py: the single self-primary peer now takes
  the first drop site (the map names the rejecting connection), so add a
  two-node case for the refused-retry site: a write sent to replica A is
  re-routed to primary B and refused by --max-retries=0. Both must count
  the dropped op.

Document in --help that a multi-key command logs only its first key.

Fixes #596

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fcostaoliveira
fcostaoliveira force-pushed the fix/failed-keys-arbitrary-key branch from 472442a to 5a25881 Compare October 14, 2026 04:30
@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Final head: 5a25881, rebased onto master c6006e7 (after #593) and squashed into one commit.

  • Bisect safety (maint): ae9d33b, 74df2aa and 472442a are now one commit, so no commit in the history lets --failed-keys-file change -READONLY recovery.

  • Conflict with Count requests dropped after -READONLY as ops #593: kept both changes. The condition is Count requests dropped after -READONLY as ops #593's assert(request != NULL) without request &&, plus retry_on_error && !transaction && p != conn_id.

  • Count requests dropped after -READONLY as ops #593's site-2 coverage: with this PR, the single self-primary peer in test_cluster_readonly_drop.py takes site 1, so a site-2 revert went unnoticed. The file now has test_readonly_stale_primary_drop_counted (single peer, site 1) and test_readonly_refused_retry_counted. The new test uses two peers: A is a replica answering -READONLY, and B is the slot primary. A --command-is-read write goes to A, and --max-retries=0 refuses the retry. Results:

    build result
    5a25881 2/2, 3/3 runs
    site 2 back to finalize_dropped_redirect fails: Count 1 instead of 20
    site 1 back to finalize_dropped_redirect fails: Ops/sec 0
  • Nits:

    • The --help text for --failed-keys-file now says multi-key commands log only their first key, including the {tag} and affixes.
    • The baseline in the PR body is master c6006e7.
  • Test hardening (bot review): see the reply below.

Suites at 5a25881, all passing:

  • test_cluster_failed_keys.py + test_cluster_readonly_drop.py: 6/6.
  • test_retry_on_error.py: 9/9 on oss and 9/9 on oss-cluster with replicas.
  • test_cluster_redirect_stats.py: 9/9.
  • test_read_preference_modes.py: 8/8.
  • test_read_preference_failover.py: 2/2.
  • test_cluster_transaction.py: 17/17.

🤖 Generated with Claude Code

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Replying to the updated automated review, point by point:

  • Per-request cost with --failed-keys-file alone. I measured it on a local redis, with -t2 -c25 --pipeline=16 --test-time=10, alternating with and without the file, 5 runs each:

    workload ops/sec median, no file with file
    --command="SET __key__ __data__" 696,990 694,284 (-0.4%)
    built-in --ratio=1:10 851,310 792,128 (-7%)

    The built-in difference is within noise on this shared 14-core box: the no-file runs alone range from 694k to 897k. CPU time per op (--requests, /usr/bin/time) came out lower with the file in both workloads (-12% and -5%), which is also noise. So I can't show a measurable cost. The extra work per request is one malloc, copy and free of the key, against about 1.6 µs of client CPU per op. I've left the copy as it is. If a maintainer wants a firm number, I can run a clean A/B on a dedicated box.

  • Timing in the scripted-peer tests. These tests ran in the ASAN and TSAN cluster jobs on 472442a, and the measured values matched the local ones: 47 refreshes against the ≥40 floor, 48 writes on B, and A=1 with 3 CLUSTER SLOTS in the transaction test. Running three suites in parallel locally did break one floor, though. Under load, all 50 writes went to the primary through --read-preference-fallback=primary before the replica connection was ready. 5a25881 changes this:

    • No fixed floors any more. The replica test checks refreshes against the writes that actually reached the replica (at least half), and requires at least one such write, so it fails loudly instead of passing without running the scenario.
    • The fake primary delays its SET replies by 10 ms in that mode, so the replica has time to become ready.
    • The transaction test counts the -READONLY replies A sends after it has served the new map, and requires at least one. If the 50 ms delay ever stops covering the refresh, the test fails instead of passing silently.
    • Three suites in parallel locally: 9/9 runs pass. The mutants (READONLY guard removed, --transaction guard removed) still fail.
  • m_arbitrary_log_key reset: thanks for tracing the callers.

  • Nit, the wants_request_key() comment: now lists MOVED/ASK retry, replay and -READONLY routing.

🤖 Generated with Claude Code

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.

--failed-keys-file logs an empty key for --command requests (and for SET/GET without --retry-on-error)

1 participant