Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage Explorer] Add support for High Throughput Append Blob #2480

Merged
merged 6 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ func (raw rawCopyCmdArgs) cook() (CookedCopyCmdArgs, error) {
}

// If the given blobType is AppendBlob, block-size-mb should not be greater than
// 4MB.
// 100MB.
if cookedSize, _ := blockSizeInBytes(raw.blockSizeMB); cooked.blobType == common.EBlobType.AppendBlob() && cookedSize > common.MaxAppendBlobBlockSize {
return cooked, fmt.Errorf("block size cannot be greater than 4MB for AppendBlob blob type")
return cooked, fmt.Errorf("block size cannot be greater than 100MB for AppendBlob blob type")
siminsavani-msft marked this conversation as resolved.
Show resolved Hide resolved
}

err = cooked.blockBlobTier.Parse(raw.blockBlobTier)
Expand Down Expand Up @@ -1540,7 +1540,7 @@ func (cca *CookedCopyCmdArgs) processCopyJobPartOrders() (err error) {
options := createClientOptions(common.AzcopyCurrentJobLogger)
var azureFileSpecificOptions any
if cca.FromTo.From() == common.ELocation.File() {
azureFileSpecificOptions = &common.FileClientOptions {
azureFileSpecificOptions = &common.FileClientOptions{
AllowTrailingDot: cca.trailingDot == common.ETrailingDotOption.Enable(),
}
}
Expand Down
8 changes: 4 additions & 4 deletions common/fe-ste-models.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func (ExitCode) Error() ExitCode { return ExitCode(1) }
// NoExit is used as a marker, to suppress the normal exit behaviour
func (ExitCode) NoExit() ExitCode { return ExitCode(99) }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
type LogLevel uint8

const (
Expand Down Expand Up @@ -397,15 +397,15 @@ func (ll LogLevel) String() string {
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LogSanitizer can be implemented to clean secrets from lines logged by ForceLog
// By default no implementation is provided here, because pipeline may be used in many different
// contexts, so the correct implementation is context-dependent
type LogSanitizer interface {
SanitizeLogMessage(raw string) string
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var EJobPriority = JobPriority(0)

// JobPriority defines the transfer priorities supported by the Storage Transfer Engine's channels
Expand Down Expand Up @@ -1073,7 +1073,7 @@ func (i *InvalidMetadataHandleOption) UnmarshalJSON(b []byte) error {
const (
DefaultBlockBlobBlockSize = 8 * 1024 * 1024
MaxBlockBlobBlockSize = 4000 * 1024 * 1024
MaxAppendBlobBlockSize = 4 * 1024 * 1024
MaxAppendBlobBlockSize = 100 * 1024 * 1024
siminsavani-msft marked this conversation as resolved.
Show resolved Hide resolved
DefaultPageBlobChunkSize = 4 * 1024 * 1024
DefaultAzureFileChunkSize = 4 * 1024 * 1024
MaxRangeGetSize = 4 * 1024 * 1024
Expand Down
57 changes: 57 additions & 0 deletions e2etest/zt_basic_copy_sync_remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,63 @@ func TestBasic_CopyUploadLargeBlob(t *testing.T) {
}, EAccountType.Standard(), EAccountType.Standard(), "")
}

func TestBasic_CopyUploadLargeAppendBlob(t *testing.T) {
dst := common.EBlobType.AppendBlob()
src := dst

RunScenarios(t, eOperation.Copy(), eTestFromTo.Other(common.EFromTo.BlobBlob(), common.EFromTo.LocalBlob()), eValidate.Auto(), anonymousAuthOnly, anonymousAuthOnly, params{
recursive: true,
blobType: src.String(),
}, &hooks{
beforeRunJob: func(h hookHelper) {
h.CreateFile(f("test.txt", with{blobType: dst}), false)
},
afterValidation: func(h hookHelper) {
props := h.GetDestination().getAllProperties(h.GetAsserter())
bprops, ok := props["test.txt"]
h.GetAsserter().Assert(ok, equals(), true)
if ok {
h.GetAsserter().Assert(bprops.blobType, equals(), dst)
}
},
}, testFiles{
defaultSize: "100M",

shouldTransfer: []interface{}{
f("test.txt", with{blobType: src}),
},
}, EAccountType.Standard(), EAccountType.Standard(), src.String()+"-"+dst.String())
}

func TestBasic_CopyUploadLargeAppendBlobBlockSizeFlag(t *testing.T) {
dst := common.EBlobType.AppendBlob()
src := dst

RunScenarios(t, eOperation.Copy(), eTestFromTo.Other(common.EFromTo.BlobBlob(), common.EFromTo.LocalBlob()), eValidate.Auto(), anonymousAuthOnly, anonymousAuthOnly, params{
recursive: true,
blobType: src.String(),
blockSizeMB: 100, // 100 MB
}, &hooks{
beforeRunJob: func(h hookHelper) {
h.CreateFile(f("test.txt", with{blobType: dst}), false)
},
afterValidation: func(h hookHelper) {
props := h.GetDestination().getAllProperties(h.GetAsserter())
bprops, ok := props["test.txt"]
h.GetAsserter().Assert(ok, equals(), true)
if ok {
h.GetAsserter().Assert(bprops.blobType, equals(), dst)
}
},
}, testFiles{
defaultSize: "100M",
siminsavani-msft marked this conversation as resolved.
Show resolved Hide resolved

shouldTransfer: []interface{}{
f("test.txt", with{blobType: src}),
},
}, EAccountType.Standard(), EAccountType.Standard(), src.String()+"-"+dst.String())
}

func TestBasic_CopyDownloadSingleBlob(t *testing.T) {
RunScenarios(t, eOperation.CopyAndSync(), eTestFromTo.AllDownloads(), eValidate.Auto(), allCredentialTypes, anonymousAuthOnly, params{
recursive: true,
Expand Down