Commit e0c56cc
committed
fix(pullsync): return empty offer at gap boundary to prevent interval over-advancement
When SubscribeBin returns a first chunk whose BinID is beyond the requested
start, the server has no chunks at [start, firstBinID-1]. Previously the
server included the chunk in the offer with Topmost=firstBinID, causing the
client to advance its interval across BinIDs it never received.
collectAddrs now detects this case: when the first chunk is within the
historical range (BinID <= historicalCursor) and its BinID is beyond the
requested start, the server returns an empty offer with Topmost=firstBinID-1.
The client advances its interval to the gap boundary only, then issues a new
Get from firstBinID and receives the chunk cleanly on the next round.
The check is skipped for start=0 (the BinID namespace starts at 1; the
puller always uses start>=1 in practice, but test helpers may pass 0).
A new test, TestSync_HistoricalGapReturnsEmptyOfferAtBoundary, covers the
gap-boundary case directly.1 parent 2c7d7b7 commit e0c56cc
2 files changed
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
487 | 498 | | |
488 | 499 | | |
489 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
400 | 443 | | |
401 | 444 | | |
402 | 445 | | |
| |||
0 commit comments