Skip to content

Commit e04c46c

Browse files
committed
Update iterateAllChunks docs to mention duplicates
1 parent c579c5c commit e04c46c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

go/store/nbs/table.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,13 @@ type chunkSource interface {
265265
// currentSize returns the current total physical size of the chunkSource.
266266
currentSize() uint64
267267

268-
// scanAllChunks will call the provided function for each chunk in the chunkSource. This is currently used
268+
// iterateAllChunks will call the provided function for each chunk in the chunkSource. This is currently used
269269
// to perform integrity checks, and the chunk passed in will have the address from the index, and the content
270-
// loaded. This iterator doesn't have a way to stop the iteration other than the context being canceled.
270+
// loaded. Note that there may be duplicate chunks in the chunkSource, so the callback may be called multiple times
271+
// with the same chunk id and content.
271272
//
272-
// If there is a failure reading the chunk, the error will be returned - note that this can happen in the middle of
273+
// This iterator doesn't have a way to stop the iteration other than the context being canceled. If there is a failure
274+
// reading the chunk, the error will be returned - note that this can happen in the middle of
273275
// the scan, and will likely mean that the scan didn't complete. Note that errors returned by this method are not
274276
// related to the callback - if the callback discovers an error, it must manage that out of band.
275277
iterateAllChunks(context.Context, func(chunk chunks.Chunk), *Stats) error

0 commit comments

Comments
 (0)