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

Fix hang issue when memory cache is full #6

Open
wants to merge 2 commits into
base: currentmaster
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Microsoft Azure Storage Data Movement Library (2.0.0)
# Microsoft Azure Storage Data Movement Library (2.0.1)

The Microsoft Azure Storage Data Movement Library designed for high-performance uploading, downloading and copying Azure Storage Blob and File. This library is based on the core data movement framework that powers [AzCopy](https://azure.microsoft.com/documentation/articles/storage-use-azcopy/).

Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020.11.20 Version 2.0.1
* All Service on both .Net Framework and .Net Core
- Fixed an issue which may cause data loss in copying with ServiceSideSyncCopy, when source and destination are both Page Blob or Azure File.

2020.08.31 Version 2.0.0
* All Service on both .Net Framework and .Net Core
- Upgraded Microsoft.Azure.Storage.Blob from 11.1.2 to 11.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ override protected void PostFetchSourceAttributes()
protected override async Task DoPreCopyAsync()
{
this.hasWork = false;
this.pagesToCopy = new List<long>();
this.pageListBag = new ConcurrentBag<List<long>>();
long rangeSpanOffset = this.nextRangesSpanOffset;
long rangeSpanLength = Math.Min(Constants.PageRangesSpanSize, this.SourceHandler.TotalLength - rangeSpanOffset);

Expand Down Expand Up @@ -95,6 +93,7 @@ protected override async Task DoPreCopyAsync()

if (this.getRangesCountdownEvent.Signal())
{
this.pagesToCopy = new List<long>();
foreach (var pageListInARange in this.pageListBag)
{
this.pagesToCopy.AddRange(pageListInARange);
Expand Down Expand Up @@ -157,6 +156,7 @@ private void PrepareForCopy()
{
int rangeSpanCount = (int)Math.Ceiling(((double)(this.SourceHandler.TotalLength - this.nextRangesSpanOffset)) / Constants.PageRangesSpanSize);
this.getRangesCountdownEvent = new CountdownEvent(rangeSpanCount);
this.pageListBag = new ConcurrentBag<List<long>>();
this.state = State.PreCopy;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ private void SetFinish()

private void SetBlockDownloadHasWork()
{
this.isStateSwitchedInternal = false;

if (this.HasWork)
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Microsoft.WindowsAzure.Storage.DataMovement Class Library</Description>
<Version>2.0.0.0</Version>
<Version>2.0.1.0</Version>
<Authors>Microsoft</Authors>
<TargetFramework>netstandard2.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\lib\**\*.cs;..\..\tools\AssemblyInfo\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<Compile Include="..\..\lib\**\*.cs;..\..\tools\AssemblyInfo\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**;..\..\lib\obj\**" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion netcore/MsTestLib/MsTestLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\test\MsTestLib\**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<Compile Include="..\..\test\MsTestLib\**\*.cs" Exclude="bin\**;obj\**;..\..\test\MsTestLib\obj\**;**\*.xproj;packages\**" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<Reference Include="Microsoft.Azure.Storage.Common, Version=11.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.Common.11.2.2\lib\net452\Microsoft.Azure.Storage.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Storage.DataMovement, Version=2.0.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.DataMovement.2.0.0\lib\net452\Microsoft.Azure.Storage.DataMovement.dll</HintPath>
<Reference Include="Microsoft.Azure.Storage.DataMovement, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.DataMovement.2.0.1\lib\net452\Microsoft.Azure.Storage.DataMovement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Storage.File, Version=11.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.File.11.2.2\lib\net452\Microsoft.Azure.Storage.File.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Storage.Blob" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.Common" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.DataMovement" version="2.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.DataMovement" version="2.0.1" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.File" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.KeyVault.Core" Version="3.0.3" />
<PackageReference Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.1" />
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<Reference Include="Microsoft.Azure.Storage.Common, Version=11.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.Common.11.2.2\lib\net452\Microsoft.Azure.Storage.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Storage.DataMovement, Version=2.0.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.DataMovement.2.0.0\lib\net452\Microsoft.Azure.Storage.DataMovement.dll</HintPath>
<Reference Include="Microsoft.Azure.Storage.DataMovement, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.DataMovement.2.0.1\lib\net452\Microsoft.Azure.Storage.DataMovement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Storage.File, Version=11.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.File.11.2.2\lib\net452\Microsoft.Azure.Storage.File.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.Blob" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.Common" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.DataMovement" version="2.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.DataMovement" version="2.0.1" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.File" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.1" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<Reference Include="Microsoft.Azure.Storage.Common, Version=11.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.Common.11.2.2\lib\net452\Microsoft.Azure.Storage.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Storage.DataMovement, Version=2.0.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.DataMovement.2.0.0\lib\net452\Microsoft.Azure.Storage.DataMovement.dll</HintPath>
<Reference Include="Microsoft.Azure.Storage.DataMovement, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.DataMovement.2.0.1\lib\net452\Microsoft.Azure.Storage.DataMovement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Storage.File, Version=11.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.Storage.File.11.2.2\lib\net452\Microsoft.Azure.Storage.File.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion samples/S3ToAzureSample/S3ToAzureSample/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Storage.Blob" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.Common" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.DataMovement" version="2.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.DataMovement" version="2.0.1" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.File" version="11.2.2" targetFramework="net452" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
Expand Down
26 changes: 21 additions & 5 deletions test/DMLibTest/Cases/BigFileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace DMLibTest
using System.Collections.Generic;
using System.Threading.Tasks;
using DMLibTestCodeGen;
using Microsoft.Azure.Storage.DataMovement;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MS.Test.Common.MsTestLib;

Expand Down Expand Up @@ -67,13 +68,28 @@ public void MyTestCleanup()
[DMLibTestMethodSet(DMLibTestMethodSet.AllValidDirection)]
public void TransferBigSizeObject()
{
DMLibDataInfo sourceDataInfo = new DMLibDataInfo(string.Empty);
DMLibDataHelper.AddMultipleFilesBigSize(sourceDataInfo.RootNode, DMLibTestBase.FileName);
int originParallel = TransferManager.Configurations.ParallelOperations;
TransferManager.Configurations.ParallelOperations = 4;
try
{
DMLibDataInfo sourceDataInfo = new DMLibDataInfo(string.Empty);
DMLibDataHelper.AddMultipleFilesBigSize(sourceDataInfo.RootNode, DMLibTestBase.FileName);

var result = this.ExecuteTestCase(sourceDataInfo, new TestExecutionOptions<DMLibDataInfo>());
var option = new TestExecutionOptions<DMLibDataInfo>();
var result = this.ExecuteTestCase(sourceDataInfo, option);

Test.Assert(result.Exceptions.Count == 0, "Verify no exception is thrown.");
Test.Assert(DMLibDataHelper.Equals(sourceDataInfo, result.DataInfo), "Verify transfer result.");
Test.Assert(result.Exceptions.Count == 0, "Verify no exception is thrown.");
Test.Assert(DMLibDataHelper.Equals(sourceDataInfo, result.DataInfo), "Verify transfer result.");

if (!(DMLibTestContext.DestType == DMLibDataType.Local || DMLibTestContext.DestType == DMLibDataType.Stream))
{
this.ValidateDestinationMD5ByDownloading(result.DataInfo, option);
}
}
finally
{
TransferManager.Configurations.ParallelOperations = originParallel;
}
}
}
}
2 changes: 1 addition & 1 deletion test/DMLibTest/Framework/DMLibDataHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void AddMultipleFilesNormalSize(DirNode dirNode, string filePrefix

public static void AddMultipleFilesBigSize(DirNode dirNode, string filePrefix)
{
int[] fileSizes = new int[] { 32000, 64 * 1024 };
int[] fileSizes = new int[] { 32000, 64 * 1024, 257 * 1024, 1024 * 1024};
AddMultipleFilesDifferentSize(dirNode, filePrefix, fileSizes);
}

Expand Down
4 changes: 2 additions & 2 deletions tools/AssemblyInfo/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
using System.Resources;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]

[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure Storage")]
Expand Down
2 changes: 1 addition & 1 deletion tools/nupkg/Microsoft.Azure.Storage.DataMovement.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>Microsoft.Azure.Storage.DataMovement</id>
<version>2.0.0</version>
<version>2.0.1</version>
<title>Microsoft Azure Storage Data Movement Library</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
Expand Down