Skip to content

Commit 9b22349

Browse files
committed
comment
1 parent 23101f5 commit 9b22349

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/storage/s3.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ impl S3Backend {
206206

207207
let etag = if let Some(mut etag) = res.e_tag {
208208
if let Some(range) = range {
209+
// we can generate a strong, unique etag for a range of the remote object too,
210+
// by just concatenating the original etag with the range start and end.
211+
//
212+
// About edge cases:
213+
// When the etag of the full archive changes after a rebuild,
214+
// all derived etags for files inside the archive will also change.
215+
//
216+
// This could lead to _changed_ ETags, where the single file inside the archive
217+
// is actually the same.
209218
etag = format!("\"{}:{}-{}\"", etag, range.start(), range.end())
210219
}
211220
match etag.parse::<headers::ETag>() {

0 commit comments

Comments
 (0)