-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add illumos build tag additionally to solaris * #7508079 [Go][Blob][2019-12-12] Blob Versioning (#190) * Generated code for 12-12-2019 spec * Fix test * Changes * Basic Testing and modification in WithVersionId function. * Added Tags and Versions in BlobListingDetails. * Added Tests * Added TestCases * Commented out tests which require versioning disabled. * Added Tests * Testcases 1-on-1 with python SDK * Moved all tests to same file for ease of accessibility Co-authored-by: zezha-msft <zezha@microsoft.com> * update to go1.14 * Minor Jumbo Blob Fix and Blob Versioning fix (#198) * Minor Jumbo Blob fix + versioning fix * Test Case Fix * Renamed struct back to original * Changed block blob limit (#199) * Minor versioning fix (#200) * [Go][Blob][2019-02-02] Set tier support on copy/put blob API (#203) * Added tier parameter in upload block blob function signature + Fixed usage + Wrote a test case for validation. * Added tier parameter in a. CopyFromURL, CommitBlockList of Block Blob b. Create (Page Blob) Fixed all occurrence * Minor Change * Added test * Rev go to 1.15, adal to 0.9.2 (#205) Update go to latest version Update adal dependency * #7508079 [Go][Blob][2019-12-12] Blob Versioning (#190) * Generated code for 12-12-2019 spec * Fix test * Changes * Basic Testing and modification in WithVersionId function. * Added Tags and Versions in BlobListingDetails. * Added Tests * Added TestCases * Commented out tests which require versioning disabled. * Added Tests * Testcases 1-on-1 with python SDK * Moved all tests to same file for ease of accessibility Co-authored-by: zezha-msft <zezha@microsoft.com> * Minor Jumbo Blob Fix and Blob Versioning fix (#198) * Minor Jumbo Blob fix + versioning fix * Test Case Fix * Renamed struct back to original * Changed block blob limit (#199) * update to go1.14 * Minor versioning fix (#200) * [Go][Blob][2019-02-02] Set tier support on copy/put blob API (#203) * Added tier parameter in upload block blob function signature + Fixed usage + Wrote a test case for validation. * Added tier parameter in a. CopyFromURL, CommitBlockList of Block Blob b. Create (Page Blob) Fixed all occurrence * Minor Change * Added test * Rev go to 1.15, adal to 0.9.2 (#205) Update go to latest version Update adal dependency * Fixing BlockBlobMaxUploadBlobBytes value (#207) Reverting BlockBlobMaxUploadBlobBytes to 256MB * Consider 502 as a temporary error (#204) * [highlevel] Stop using memory-mapped files While investigating this SDK for uploading and downloading large blobs (e.g. 25GB or more) it became apparent that the memory-mapped approach has some severe limitations: 1. Limits the file size on 32-bit systems (theoretically 4GB, but much less in practice). 2. Has no backpressure when writing to slower storage mediums. 3. Appears to finish faster, but the OS spends several minutes flushing the modified RAM to disk afterwards (depends on the speed of the disk). On a VM with 16GB of RAM and a slow disk (spinning in this case) the algorithm quickly overwhelms the available memory and causes severe performance degradation. It ended up simultaneously trying to flush to the slow data disk and page out to the slightly faster OS disk. The solution is to stop using memory-mapped files (at least the way the SDK currently uses then) and switch to the `io.ReaderAt` and `io.WriterAt` interfaces. They explicitly allow for parallel access to non-overlapping regions which make them a good candidate for this purpose. Benchmarking large downloads (25GB file) between azcopy 10.4.3 and these updates using a test app, the difference between them is within 10 seconds. When compared against the original code on a beefy machine with plenty of RAM the measured execution time is faster, but there is a little bit of delay while the last of the data flushes from RAM to disk. * PR feedback Co-authored-by: Till Wegmueller <toasterson@gmail.com> Co-authored-by: Ze Qian Zhang <zezha@microsoft.com> Co-authored-by: Mohit Sharma <65536214+mohsha-msft@users.noreply.github.com> Co-authored-by: Jonas-Taha El Sesiy <github@elsesiy.com> Co-authored-by: mohsha-msft <mohsha@microsoft.com> Co-authored-by: Kyle Farnung <kfarnung@outlook.com>
- Loading branch information
1 parent
510f9f0
commit 4e8f2d4
Showing
44 changed files
with
5,590 additions
and
841 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
language: go | ||
go: | ||
- "1.13" | ||
- "1.15" | ||
script: | ||
- export GO111MODULE=on | ||
- GOOS=linux go build ./azblob | ||
- GOOS=darwin go build ./azblob | ||
- GOOS=windows go build ./azblob | ||
- GOOS=solaris go build ./azblob | ||
- GOOS=illumos go build ./azblob | ||
- go test -race -short -cover -v ./azblob |
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,24 @@ | ||
package azblob | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
type bytesWriter []byte | ||
|
||
func newBytesWriter(b []byte) bytesWriter { | ||
return b | ||
} | ||
|
||
func (c bytesWriter) WriteAt(b []byte, off int64) (int, error) { | ||
if off >= int64(len(c)) || off < 0 { | ||
return 0, errors.New("Offset value is out of range") | ||
} | ||
|
||
n := copy(c[int(off):], b) | ||
if n < len(b) { | ||
return n, errors.New("Not enough space for all bytes") | ||
} | ||
|
||
return n, nil | ||
} |
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,30 @@ | ||
package azblob | ||
|
||
import ( | ||
"bytes" | ||
|
||
chk "gopkg.in/check.v1" | ||
) | ||
|
||
func (s *aztestsSuite) TestBytesWriterWriteAt(c *chk.C) { | ||
b := make([]byte, 10) | ||
buffer := newBytesWriter(b) | ||
|
||
count, err := buffer.WriteAt([]byte{1, 2}, 10) | ||
c.Assert(err, chk.ErrorMatches, "Offset value is out of range") | ||
c.Assert(count, chk.Equals, 0) | ||
|
||
count, err = buffer.WriteAt([]byte{1, 2}, -1) | ||
c.Assert(err, chk.ErrorMatches, "Offset value is out of range") | ||
c.Assert(count, chk.Equals, 0) | ||
|
||
count, err = buffer.WriteAt([]byte{1, 2}, 9) | ||
c.Assert(err, chk.ErrorMatches, "Not enough space for all bytes") | ||
c.Assert(count, chk.Equals, 1) | ||
c.Assert(bytes.Compare(b, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 1}), chk.Equals, 0) | ||
|
||
count, err = buffer.WriteAt([]byte{1, 2}, 8) | ||
c.Assert(err, chk.IsNil) | ||
c.Assert(count, chk.Equals, 2) | ||
c.Assert(bytes.Compare(b, []byte{0, 0, 0, 0, 0, 0, 0, 0, 1, 2}), chk.Equals, 0) | ||
} |
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
Oops, something went wrong.