20318: Fix BadChecksum error not propagated through cache layer.
authorTom Clegg <tom@curii.com>
Thu, 11 Jan 2024 16:22:27 +0000 (11:22 -0500)
committerTom Clegg <tom@curii.com>
Thu, 11 Jan 2024 16:22:27 +0000 (11:22 -0500)
commit295d13d6d07dd2a659d93d026e5a7505cbc42936
tree44292f69b54d9b2c88226bd17d7401d2db25e18e
parent7d18adc6b2026b8ad75308efece69843139269fa
20318: Fix BadChecksum error not propagated through cache layer.

Previously, ReadAt would not return an error as long as enough bytes
were read, because the error might mean the read was truncated after
the point needed for the current read. This had the unintended
consequence that even a BadChecksum error returned on the final read
would not be propagated.

The updated version propagates errors even if the requested bytes were
retrieved, so the only case where a bad checksum error can be
undetected is when the read does not reach the end of the block *and*
the block has not been fully retrieved yet.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
sdk/go/arvados/keep_cache.go