Skip to content

Commit 384be07

Browse files
comment
1 parent 1b25676 commit 384be07

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/atmst/blockstore/car_file.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ class OpportunisticStreamingCarBlockStore(BlockStore):
119119
120120
This should work in 99.999% of cases. The fallback case could fail if the CAR
121121
starts off in canonical order, but has duplicate record CIDs where the second
122-
record is *not* duplicated into the CAR.
122+
record is *not* duplicated into the CAR. Duplicate CIDs are relatively common
123+
in-the-wild, but accidentally-canonical block order is rare.
123124
124125
In such a case, an OptimisticRetryError is raised, and the caller should
125126
retry from scratch with optimistic=False.
@@ -152,6 +153,8 @@ def get_block(self, key: bytes) -> bytes:
152153
self._optimistic = False
153154
self._blocks[bytes(k)] = v
154155
self._slurp(self._car_iter)
156+
# fall thru
157+
155158
try:
156159
return self._blocks[key]
157160
except KeyError:

0 commit comments

Comments
 (0)