Skip to content

Commit 1803cd6

Browse files
authored
Restored previous single shot upload threshold (Azure#16365)
* Restored previous single shot upload threshold * PR comments * PR comments * PR comments
1 parent ff4cea7 commit 1803cd6

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

sdk/storage/Azure.Storage.Blobs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Added CanAccountGenerateSasUri property, GenerateAccountSasUri() to BlobServiceClient.
1111
- Deprecated property BlobSasBuilder.Version, so when generating SAS will always use the latest Storage Service SAS version.
1212
- Added ability to get parent BlobContainerClient from BlobBaseClient and to get parent BlobServiceClient from BlobContainerClient.
13+
- Restored single upload threshold for parallel uploads from 5 TB to 256 MB.
1314

1415
## 12.7.0-preview.1 (2020-09-30)
1516
- Added support for service version 2020-02-10.

sdk/storage/Azure.Storage.Blobs/tests/BlockBlobClientTests.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,48 @@ await blob.UploadAsync(
20982098
Assert.AreEqual(blobSize, progress.List[progress.List.Count - 1]);
20992099
}
21002100

2101+
[LiveOnly]
2102+
[Test]
2103+
public async Task UploadAsync_SingleUpload_DefaultThreshold()
2104+
{
2105+
await using DisposingContainer test = await GetTestContainerAsync();
2106+
2107+
// Arrange
2108+
var blockBlobName = GetNewBlobName();
2109+
BlockBlobClient blob = InstrumentClient(test.Container.GetBlockBlobClient(blockBlobName));
2110+
long blobSize = Constants.Blob.Block.Pre_2019_12_12_MaxUploadBytes - 1;
2111+
var data = GetRandomBuffer(blobSize);
2112+
using Stream stream = new MemoryStream(data);
2113+
2114+
// Act
2115+
await blob.UploadAsync(content: stream);
2116+
2117+
// Assert
2118+
Response<BlockList> blockListResponse = await blob.GetBlockListAsync();
2119+
Assert.AreEqual(0, blockListResponse.Value.CommittedBlocks.ToList().Count);
2120+
}
2121+
2122+
[LiveOnly]
2123+
[Test]
2124+
public async Task UploadAsync_MultipleUpload_DefaultThreshold()
2125+
{
2126+
await using DisposingContainer test = await GetTestContainerAsync();
2127+
2128+
// Arrange
2129+
var blockBlobName = GetNewBlobName();
2130+
BlockBlobClient blob = InstrumentClient(test.Container.GetBlockBlobClient(blockBlobName));
2131+
long blobSize = Constants.Blob.Block.Pre_2019_12_12_MaxUploadBytes + 1;
2132+
var data = GetRandomBuffer(blobSize);
2133+
using Stream stream = new MemoryStream(data);
2134+
2135+
// Act
2136+
await blob.UploadAsync(content: stream);
2137+
2138+
// Assert
2139+
Response<BlockList> blockListResponse = await blob.GetBlockListAsync();
2140+
Assert.AreEqual(33, blockListResponse.Value.CommittedBlocks.ToList().Count);
2141+
}
2142+
21012143
[Test]
21022144
[ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2019_12_12)]
21032145
public async Task UploadAsync_VersionId()

sdk/storage/Azure.Storage.Common/src/Shared/PartitionedUploader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public PartitionedUploader(
130130
}
131131
else
132132
{
133-
_singleUploadThreshold = Constants.Blob.Block.MaxUploadBytes;
133+
_singleUploadThreshold = Constants.Blob.Block.Pre_2019_12_12_MaxUploadBytes;
134134
}
135135

136136
// Set _blockSize

sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Added ability to set Position on streams created with DataLakeFileClient.OpenRead().
99
- Added CanGenerateSasUri property and GenerateSasUri() to DataLakePathClient, DataLakeFileClient, DataLakeDirectoryClient and DataLakeFileSystemClient.
1010
- Added CanGenerateAccountSasUri property and GenerateAccountSasUri() to DataLakeServiceClient.
11+
- Restored single upload threshold for parallel uploads from 5 TB to 256 MB.
1112

1213
## 12.5.0-preview.1 (2020-09-30)
1314
- Added support for service version 2020-02-10.

0 commit comments

Comments
 (0)