Commit a85904d
fix(client): route and split the raw cluster sendCommand path correctly
The policy refactor folded the raw cluster sendCommand into
_executeWithPolicies but built its parser wrong, regressing behaviour
master got right by routing on the explicit firstKey:
- firstKey was prepended to args, so redisArgs[0] became a key instead
of the command name (breaking policy resolution) and no key was ever
marked, leaving parser.firstKey unset so routing fell back to
undefined.
- makeFn ignored the per-entry sub-parser and always sent the original
args, so a split multi_shard command sent the full command to every
shard.
Build redisArgs as an exact copy of args (command name at index 0) and
register the caller's firstKey via a new BasicCommandParser.markRoutingKey,
which records the key for routing without re-appending it to redisArgs.
Send p.redisArgs from the closure so split sub-commands each carry their
own slot's arguments. A known multi_shard command sent raw now splits
correctly, since the resolver supplies its key specs and the splitter
operates on the flat redisArgs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent dc4f1f7 commit a85904d
3 files changed
Lines changed: 55 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
620 | 624 | | |
621 | | - | |
622 | 625 | | |
| 626 | + | |
623 | 627 | | |
624 | 628 | | |
625 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
626 | 632 | | |
627 | 633 | | |
628 | 634 | | |
629 | 635 | | |
630 | | - | |
| 636 | + | |
631 | 637 | | |
632 | 638 | | |
633 | 639 | | |
| |||
0 commit comments