Commit c00518c
authored
MOD-14124 Handle shard error replies in internal command execution (#85)
* Handle shard error replies in internal command execution
When a shard replies with a Redis error (e.g. NOPERM) to an internal
command, the framework previously either silently disconnected
(cluster.c rejected non-ARRAY replies) or let the error reach
application reply parsers, causing assertion failures.
Changes:
- Allow REDIS_REPLY_ERROR through MR_OnDataResponseArrived to
MR_SetInternalCommandResults instead of disconnecting (cluster.c)
- Add MR_SetShardError() for top-level shard errors: captures the
error in e->errors, marks all steps done with NULL result
placeholders, and advances the nodesDone counter so the execution
completes normally
- Handle per-element errors: if an individual internal command reply
is an error, capture it in e->errors instead of calling replyParser
- Add NULL guard to MR_RecordFree for safe cleanup of NULL placeholders
Errors propagate through the existing e->errors mechanism, which
application-level done callbacks already consume via
check_and_reply_on_error().
* ## Summary
- Homebrew's LLVM `libclang` on macOS causes `bindgen` to generate an opaque
`Record` struct (with only `_address: u8`) instead of the actual definition
containing `recordType: *mut MRRecordType`, failing the Rust compilation.
- Added a post-processing step in `build.rs` that detects when bindgen produces
an opaque `Record` and patches the generated bindings with the correct field.
- Bumped `bindgen` dependency from `0.70` to `0.72`.
## Test plan
- [ ] macOS CI pipeline passes (`make run_tests`)
- [ ] Linux CI pipeline still passes (no change in behavior when Record is generated correctly)
* libmr error remove
* remove dead code
* fix remarks
* remove null check1 parent c21b080 commit c00518c
3 files changed
+16
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
| 1183 | + | |
1183 | 1184 | | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | 1187 | | |
1187 | 1188 | | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
1191 | 1201 | | |
1192 | | - | |
1193 | | - | |
1194 | 1202 | | |
1195 | 1203 | | |
1196 | 1204 | | |
| |||
1199 | 1207 | | |
1200 | 1208 | | |
1201 | 1209 | | |
1202 | | - | |
1203 | 1210 | | |
1204 | 1211 | | |
1205 | 1212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1379 | 1379 | | |
1380 | 1380 | | |
1381 | 1381 | | |
| 1382 | + | |
1382 | 1383 | | |
1383 | 1384 | | |
1384 | 1385 | | |
| |||
1778 | 1779 | | |
1779 | 1780 | | |
1780 | 1781 | | |
| 1782 | + | |
1781 | 1783 | | |
1782 | 1784 | | |
1783 | 1785 | | |
| |||
0 commit comments