Skip to content

Commit 8368524

Browse files
committed
comment
1 parent 44928d8 commit 8368524

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
@@ -212,6 +212,15 @@ impl S3Backend {
212212

213213
let etag = if let Some(mut etag) = res.e_tag {
214214
if let Some(range) = range {
215+
// we can generate a strong, unique etag for a range of the remote object too,
216+
// by just concatenating the original etag with the range start and end.
217+
//
218+
// About edge cases:
219+
// When the etag of the full archive changes after a rebuild,
220+
// all derived etags for files inside the archive will also change.
221+
//
222+
// This could lead to _changed_ ETags, where the single file inside the archive
223+
// is actually the same.
215224
etag = format!("\"{}:{}-{}\"", etag, range.start(), range.end())
216225
}
217226
match etag.parse::<headers::ETag>() {

0 commit comments

Comments
 (0)