-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix S3 gateway cross-repo copies (#7468)
* Fix S3 gateway cross-repo copies putobject and friends were confusing src and dst repositories, which will not do. Fixes #7467. * Test S3 gateway multipart copy in Esti * [esti] Use sigV4 for S3 gateway MPU copy tests We might only have a problem with sigV2, which is considerably less important by now. * Add copy-source to sigV2 signed headers and restore sigV2 signing This should make MPU copies that are signed using sigV2 work with the S3 gateway. * [bug] Make randomReader return EOF when it's done Otherwise infinite loop on upload >:-( * Try again with sigv4 * [bug] Actually request multipart-range in copy Exercise another code path, don't triple data size, and keep the originally intended logic. * [bug] Use distinct repository name from TestS3CopyObject Repositories not always deleted, so if we don't do this we get a conflict. * [bug] Start, End on MinIO client CopySrcOptions are inclusive bounds * [bug] Azure copyPartRange should stage block on destination copyPartRange should stage a block on the destination. This matters When source and destination containers are different. * [CR] Put all "const ...ContentLength..." together and document them * [CR] Rename RandomReader -> NewRandomReader Because it returns a new random reader, and also that matches the Go naming conventions. :-)
- Loading branch information
1 parent
a0200d0
commit 2cc79fa
Showing
9 changed files
with
208 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package testutil | ||
|
||
import ( | ||
"hash/crc64" | ||
"io" | ||
) | ||
|
||
const bufSize = 4 << 16 | ||
|
||
var table *crc64.Table = crc64.MakeTable(crc64.ECMA) | ||
|
||
// ChecksumReader returns the checksum (CRC-64) of the contents of reader. | ||
func ChecksumReader(reader io.Reader) (uint64, error) { | ||
buf := make([]byte, bufSize) | ||
var val uint64 | ||
for { | ||
n, err := reader.Read(buf) | ||
if err != nil { | ||
if err == io.EOF { | ||
return val, nil | ||
} | ||
return val, err | ||
} | ||
if n == 0 { | ||
return val, nil | ||
} | ||
val = crc64.Update(val, table, buf[:n]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters