Commit 7e32113
authored
refactor(meta): upgrade openraft to v0.10.0-alpha.13 (#19193)
refactor(meta): upgrade openraft to v0.10.0-alpha.13 and handle oversized payloads
Upgrade openraft dependency and adapt to API changes in the new version.
The main changes include a new streaming apply API, updated watch receiver
trait methods, and automatic payload size management for AppendEntries.
In openraft 0.10.0, `PayloadTooLarge` error was removed. This change
implements automatic payload size management in `append_entries()` by
reducing entry count and retrying when payloads exceed gRPC limits.
Changes:
- Upgrade openraft from `v0.10.0-alpha.11` to `v0.10.0-alpha.13`
- Update `TypeConfig` to use new `Responder<T>` and `ErrorSource` types
- Add type aliases: `WatchReceiver<T>`, `Unreachable`, `EntryResponder`
- Change `SMV003::apply_entries()` to accept stream instead of iterator
- Replace `.borrow()` with `.borrow_watched()` for watch receivers
- Add `From<SnapshotStoreError> for io::Error` implementation
- Update tests to use stream-based apply API
- Add retry loop in `append_entries()` to handle oversized payloads
- Add `build_partial_append_request()` helper for creating partial requests
- Check payload size before sending against `advisory_encoding_size()`
- Handle `tonic::Code::ResourceExhausted` by reducing entries and retrying
- Return `Unreachable` error when single entry exceeds size limit
- Remove obsolete `new_append_entries_raft_req()` function1 parent 1cbe48f commit 7e32113
File tree
22 files changed
+306
-244
lines changed- src/meta
- raft-store/src/sm_v003
- service
- src
- meta_node
- meta_service
- store
- meta_raft_log
- meta_raft_state_machine
- tests/it
- grpc
- meta_node
- types/src
- cmd
- tests/metactl/subcommands
22 files changed
+306
-244
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
26 | 24 | | |
27 | 25 | | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
| 245 | + | |
| 246 | + | |
250 | 247 | | |
251 | 248 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
261 | 255 | | |
262 | 256 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
| 257 | + | |
| 258 | + | |
269 | 259 | | |
270 | 260 | | |
271 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
| 333 | + | |
336 | 334 | | |
337 | 335 | | |
338 | 336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
330 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
331 | 336 | | |
332 | 337 | | |
333 | 338 | | |
| |||
351 | 356 | | |
352 | 357 | | |
353 | 358 | | |
354 | | - | |
| 359 | + | |
355 | 360 | | |
356 | 361 | | |
357 | 362 | | |
| |||
369 | 374 | | |
370 | 375 | | |
371 | 376 | | |
372 | | - | |
| 377 | + | |
373 | 378 | | |
374 | 379 | | |
375 | 380 | | |
| |||
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
391 | | - | |
| 396 | + | |
392 | 397 | | |
393 | 398 | | |
394 | 399 | | |
| |||
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
406 | | - | |
| 411 | + | |
407 | 412 | | |
408 | 413 | | |
409 | 414 | | |
| |||
1193 | 1198 | | |
1194 | 1199 | | |
1195 | 1200 | | |
1196 | | - | |
| 1201 | + | |
1197 | 1202 | | |
1198 | 1203 | | |
1199 | 1204 | | |
| |||
1455 | 1460 | | |
1456 | 1461 | | |
1457 | 1462 | | |
1458 | | - | |
| 1463 | + | |
1459 | 1464 | | |
1460 | 1465 | | |
1461 | 1466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
0 commit comments