Commit 12e304c
committed
fix: byte-range fast path requires write_empty_chunks=True
The byte-range path in ShardingCodec._encode_partial_sync writes
every affected inner chunk into its fixed-size data slot. This is
incompatible with write_empty_chunks=False (the default), which
expects empty chunks to be compacted out of the shard layout entirely.
Add `not skip_empty` to the gate. With the default config, partial
shard writes go through the full-rewrite path (which honors the
compact layout). With write_empty_chunks=True, the byte-range
optimization is used.
Also copy the shard index before mutating; the decoded view may be
backed by a read-only buffer (mmap-style reads from LocalStore).
Plus: convert tests/test_sync_pipeline.py::test_memory_store_set_range
from `asyncio.run(...)` inside a sync test to a plain `async def`.
The asyncio.run call leaked event-loop self-pipe sockets that pytest's
unraisableexception plugin would later attribute to unrelated tests.
Update test_partial_shard_write_uses_set_range to opt into
write_empty_chunks=True so the byte-range path is actually exercised.1 parent ff0d5a2 commit 12e304c
2 files changed
Lines changed: 23 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
609 | 613 | | |
610 | 614 | | |
611 | 615 | | |
| 616 | + | |
612 | 617 | | |
613 | 618 | | |
614 | 619 | | |
| |||
622 | 627 | | |
623 | 628 | | |
624 | 629 | | |
625 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
626 | 634 | | |
627 | 635 | | |
628 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
440 | 439 | | |
441 | 440 | | |
442 | 441 | | |
443 | | - | |
| 442 | + | |
444 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
445 | 448 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 449 | + | |
| 450 | + | |
458 | 451 | | |
459 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
460 | 455 | | |
461 | 456 | | |
462 | 457 | | |
| |||
528 | 523 | | |
529 | 524 | | |
530 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
531 | 529 | | |
532 | 530 | | |
533 | 531 | | |
| |||
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
| 537 | + | |
539 | 538 | | |
540 | 539 | | |
541 | 540 | | |
| |||
0 commit comments