Skip to content

Commit 945615d

Browse files
authored
Merge pull request microsoft#1939 from tyrielv/tyrielv/net10-remove-legacy
Remove GVFS.GVFlt and ESENT legacy disk layout upgrades
2 parents 7352617 + 1be4aca commit 945615d

21 files changed

Lines changed: 7 additions & 1165 deletions

Directory.Packages.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
1313

1414
<!-- Storage -->
15-
<PackageVersion Include="ManagedEsent" Version="1.9.4" />
1615
<PackageVersion Include="Microsoft.Data.Sqlite" Version="2.2.4" />
17-
<PackageVersion Include="Microsoft.Database.Collections.Generic" Version="1.9.4" />
18-
<PackageVersion Include="Microsoft.Database.Isam" Version="1.9.4" />
1916

2017
<!-- Compression -->
2118
<PackageVersion Include="SharpZipLib" Version="1.3.3" />

GVFS.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.FunctionalTests", "GVF
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.FunctionalTests.LockHolder", "GVFS\GVFS.FunctionalTests.LockHolder\GVFS.FunctionalTests.LockHolder.csproj", "{B26985C3-250A-4805-AA97-AD0604331AC7}"
1515
EndProject
16-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.GVFlt", "GVFS\GVFS.GVFlt\GVFS.GVFlt.csproj", "{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}"
17-
EndProject
1816
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Hooks", "GVFS\GVFS.Hooks\GVFS.Hooks.csproj", "{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}"
1917
EndProject
2018
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Mount", "GVFS\GVFS.Mount\GVFS.Mount.csproj", "{F96089C2-6D09-4349-B65D-9CCA6160C6A5}"
@@ -75,10 +73,6 @@ Global
7573
{B26985C3-250A-4805-AA97-AD0604331AC7}.Debug|x64.Build.0 = Debug|Any CPU
7674
{B26985C3-250A-4805-AA97-AD0604331AC7}.Release|x64.ActiveCfg = Release|Any CPU
7775
{B26985C3-250A-4805-AA97-AD0604331AC7}.Release|x64.Build.0 = Release|Any CPU
78-
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Debug|x64.ActiveCfg = Debug|Any CPU
79-
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Debug|x64.Build.0 = Debug|Any CPU
80-
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Release|x64.ActiveCfg = Release|Any CPU
81-
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Release|x64.Build.0 = Release|Any CPU
8276
{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}.Debug|x64.ActiveCfg = Debug|Any CPU
8377
{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}.Debug|x64.Build.0 = Debug|Any CPU
8478
{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}.Release|x64.ActiveCfg = Release|Any CPU

GVFS/FastFetch/FastFetch.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<FilesToSign Include="
2121
$(OutputPath)\FastFetch.exe;
2222
$(OutputPath)\GVFS.Common.dll;
23-
$(OutputPath)\GVFS.GVFlt.dll;
2423
$(OutputPath)\GVFS.Platform.Windows.dll;
2524
$(OutputPath)\GVFS.Virtualization.dll;">
2625
<Authenticode>Microsoft400</Authenticode>

GVFS/GVFS.FunctionalTests/GVFS.FunctionalTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<PackageReference Include="NUnitLite" />
1010
<PackageReference Include="NUnit3TestAdapter" />
1111
<PackageReference Include="Microsoft.Data.Sqlite" />
12-
<PackageReference Include="Microsoft.Database.Collections.Generic" />
1312
<PackageReference Include="Newtonsoft.Json" />
1413
<PackageReference Include="SharpZipLib" />
1514
<PackageReference Include="System.ServiceProcess.ServiceController" />

GVFS/GVFS.FunctionalTests/Tools/GVFSHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static class GVFSHelpers
3636

3737
private const int WindowsCurrentDiskLayoutMajorVersion = 19;
3838
private const int MacCurrentDiskLayoutMajorVersion = 19;
39-
private const int WindowsCurrentDiskLayoutMinimumMajorVersion = 7;
39+
private const int WindowsCurrentDiskLayoutMinimumMajorVersion = 14;
4040
private const int MacCurrentDiskLayoutMinimumMajorVersion = 18;
4141

4242
public static string ConvertPathToGitFormat(string path)

GVFS/GVFS.FunctionalTests/Windows/Tests/SharedCacheUpgradeTests.cs

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
using GVFS.FunctionalTests.Tests.MultiEnlistmentTests;
44
using GVFS.FunctionalTests.Tools;
55
using GVFS.FunctionalTests.Windows.Tests;
6-
using GVFS.FunctionalTests.Windows.Tools;
76
using GVFS.Tests.Should;
87
using NUnit.Framework;
98
using System;
10-
using System.Collections.Generic;
119
using System.IO;
1210

1311
namespace GVFS.FunctionalTests.Windows.Windows.Tests
@@ -33,115 +31,6 @@ public void SetCacheLocation()
3331
this.localCachePath = Path.Combine(this.localCacheParentPath, ".customGVFSCache");
3432
}
3533

36-
[TestCase]
37-
public void MountUpgradesLocalSizesToSharedCache()
38-
{
39-
GVFSFunctionalTestEnlistment enlistment = this.CloneAndMountEnlistment();
40-
enlistment.UnmountGVFS();
41-
42-
string localCacheRoot = GVFSHelpers.GetPersistedLocalCacheRoot(enlistment.DotGVFSRoot);
43-
string gitObjectsRoot = GVFSHelpers.GetPersistedGitObjectsRoot(enlistment.DotGVFSRoot);
44-
45-
// Delete the existing repo metadata
46-
string versionJsonPath = Path.Combine(enlistment.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
47-
versionJsonPath.ShouldBeAFile(this.fileSystem);
48-
this.fileSystem.DeleteFile(versionJsonPath);
49-
50-
// Since there isn't a sparse-checkout file that is used anymore one needs to be added
51-
// in order to test the old upgrades that might have needed it
52-
string sparseCheckoutPath = Path.Combine(enlistment.RepoRoot, TestConstants.DotGit.Info.SparseCheckoutPath);
53-
this.fileSystem.WriteAllText(sparseCheckoutPath, "/.gitattributes\r\n");
54-
55-
// "13.0" was the last version before blob sizes were moved out of Esent
56-
string metadataPath = Path.Combine(enlistment.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
57-
this.fileSystem.CreateEmptyFile(metadataPath);
58-
GVFSHelpers.SaveDiskLayoutVersion(enlistment.DotGVFSRoot, "13", "0");
59-
GVFSHelpers.SaveLocalCacheRoot(enlistment.DotGVFSRoot, localCacheRoot);
60-
GVFSHelpers.SaveGitObjectsRoot(enlistment.DotGVFSRoot, gitObjectsRoot);
61-
62-
// Create a legacy PersistedDictionary sizes database
63-
List<KeyValuePair<string, long>> entries = new List<KeyValuePair<string, long>>()
64-
{
65-
new KeyValuePair<string, long>(new string('0', 40), 1),
66-
new KeyValuePair<string, long>(new string('1', 40), 2),
67-
new KeyValuePair<string, long>(new string('2', 40), 4),
68-
new KeyValuePair<string, long>(new string('3', 40), 8),
69-
};
70-
71-
ESENTDatabase.CreateEsentBlobSizesDatabase(enlistment.DotGVFSRoot, entries);
72-
73-
enlistment.MountGVFS();
74-
75-
string majorVersion;
76-
string minorVersion;
77-
GVFSHelpers.GetPersistedDiskLayoutVersion(enlistment.DotGVFSRoot, out majorVersion, out minorVersion);
78-
79-
majorVersion
80-
.ShouldBeAnInt("Disk layout version should always be an int")
81-
.ShouldEqual(WindowsDiskLayoutUpgradeTests.CurrentDiskLayoutMajorVersion, "Disk layout version should be upgraded to the latest");
82-
83-
minorVersion
84-
.ShouldBeAnInt("Disk layout version should always be an int")
85-
.ShouldEqual(WindowsDiskLayoutUpgradeTests.CurrentDiskLayoutMinorVersion, "Disk layout version should be upgraded to the latest");
86-
87-
string newBlobSizesRoot = Path.Combine(Path.GetDirectoryName(gitObjectsRoot), WindowsDiskLayoutUpgradeTests.BlobSizesCacheName);
88-
GVFSHelpers.GetPersistedBlobSizesRoot(enlistment.DotGVFSRoot)
89-
.ShouldEqual(newBlobSizesRoot);
90-
91-
string blobSizesDbPath = Path.Combine(newBlobSizesRoot, WindowsDiskLayoutUpgradeTests.BlobSizesDBFileName);
92-
newBlobSizesRoot.ShouldBeADirectory(this.fileSystem);
93-
blobSizesDbPath.ShouldBeAFile(this.fileSystem);
94-
95-
foreach (KeyValuePair<string, long> entry in entries)
96-
{
97-
GVFSHelpers.SQLiteBlobSizesDatabaseHasEntry(blobSizesDbPath, entry.Key, entry.Value);
98-
}
99-
100-
// Upgrade a second repo, and make sure all sizes from both upgrades are in the shared database
101-
102-
GVFSFunctionalTestEnlistment enlistment2 = this.CloneAndMountEnlistment();
103-
enlistment2.UnmountGVFS();
104-
105-
// Delete the existing repo metadata
106-
versionJsonPath = Path.Combine(enlistment2.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
107-
versionJsonPath.ShouldBeAFile(this.fileSystem);
108-
this.fileSystem.DeleteFile(versionJsonPath);
109-
110-
// Since there isn't a sparse-checkout file that is used anymore one needs to be added
111-
// in order to test the old upgrades that might have needed it
112-
string sparseCheckoutPath2 = Path.Combine(enlistment2.RepoRoot, TestConstants.DotGit.Info.SparseCheckoutPath);
113-
this.fileSystem.WriteAllText(sparseCheckoutPath2, "/.gitattributes\r\n");
114-
115-
// "13.0" was the last version before blob sizes were moved out of Esent
116-
metadataPath = Path.Combine(enlistment2.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
117-
this.fileSystem.CreateEmptyFile(metadataPath);
118-
GVFSHelpers.SaveDiskLayoutVersion(enlistment2.DotGVFSRoot, "13", "0");
119-
GVFSHelpers.SaveLocalCacheRoot(enlistment2.DotGVFSRoot, localCacheRoot);
120-
GVFSHelpers.SaveGitObjectsRoot(enlistment2.DotGVFSRoot, gitObjectsRoot);
121-
122-
// Create a legacy PersistedDictionary sizes database
123-
List<KeyValuePair<string, long>> additionalEntries = new List<KeyValuePair<string, long>>()
124-
{
125-
new KeyValuePair<string, long>(new string('4', 40), 16),
126-
new KeyValuePair<string, long>(new string('5', 40), 32),
127-
new KeyValuePair<string, long>(new string('6', 40), 64),
128-
};
129-
130-
ESENTDatabase.CreateEsentBlobSizesDatabase(enlistment2.DotGVFSRoot, additionalEntries);
131-
132-
enlistment2.MountGVFS();
133-
134-
foreach (KeyValuePair<string, long> entry in entries)
135-
{
136-
GVFSHelpers.SQLiteBlobSizesDatabaseHasEntry(blobSizesDbPath, entry.Key, entry.Value);
137-
}
138-
139-
foreach (KeyValuePair<string, long> entry in additionalEntries)
140-
{
141-
GVFSHelpers.SQLiteBlobSizesDatabaseHasEntry(blobSizesDbPath, entry.Key, entry.Value);
142-
}
143-
}
144-
14534
private GVFSFunctionalTestEnlistment CloneAndMountEnlistment(string branch = null)
14635
{
14736
return this.CreateNewEnlistment(this.localCachePath, branch);

0 commit comments

Comments
 (0)