Commit a84a15a
committed
fix: byte-range path skips empty chunks and deletes empty shards
The byte-range write path in ShardingCodec._encode_partial_sync was
encoding every affected inner chunk regardless of whether it was empty,
and never deleting fully-empty shards. This made test_delete_empty_shards
fail under the SyncCodecPipeline (the bench branch's default).
Now matches the full-rewrite path's behavior:
* When skip_empty (write_empty_chunks=False) is set and a merged chunk
equals the fill value, mark the chunk absent in the index instead of
writing data.
* After updating all affected entries, if the index is fully empty,
delete the shard rather than writing an empty index.
Also copy the shard index before mutating it; 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` test.
The asyncio.run call leaked event-loop self-pipe sockets that pytest's
unraisableexception plugin would later attribute to unrelated tests,
producing spurious "flaky" failures across the suite.1 parent ff0d5a2 commit a84a15a
2 files changed
+24
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
626 | 629 | | |
627 | 630 | | |
628 | 631 | | |
| |||
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
651 | 659 | | |
652 | 660 | | |
653 | 661 | | |
| |||
656 | 664 | | |
657 | 665 | | |
658 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
659 | 672 | | |
660 | 673 | | |
661 | 674 | | |
| |||
| 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 | | |
| |||
0 commit comments