Commit dc4f1f7
fix(client): fall back to default policy for unknown cluster commands
_executeWithPolicies routed every command through policy resolution, but
the cluster's resolver (StaticPolicyResolver(POLICIES)) has no fallback,
so any command absent from the policy table resolved to { ok: false }
and the engine threw "Policy resolution error". This broke user-defined
custom commands, scripts/functions whose dispatched name is not in the
table, and module commands the resolver was not built with.
Such commands have no request/response policy and nothing to split or
aggregate. Instead of throwing, fall back to a default policy
(default_keyed when the parser carries keys, else default_keyless) and
route through the existing pass-through default router/reducer — the
same single-client, key-routed behaviour as a direct _execute. Known
module commands the dynamic resolver does recognise still get their real
policy, so a module declaring multi_shard keeps working. Known commands
that cannot be split still throw from the splitter.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d1ccf7e commit dc4f1f7
1 file changed
Lines changed: 24 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
473 | 487 | | |
474 | 488 | | |
475 | 489 | | |
| |||
482 | 496 | | |
483 | 497 | | |
484 | 498 | | |
485 | | - | |
| 499 | + | |
486 | 500 | | |
487 | 501 | | |
488 | 502 | | |
| |||
0 commit comments