Skip to content

Commit ab94a81

Browse files
committed
Require the latest 6.x before upgrading to 7
The RavenDB 6.2 to 7.2 data upgrade is one-way, and the 6.x data migrations must finish on RavenDB 6.2 first. Add 6.21.0 as the last version of major 6 to the upgrade path, as 5.11.0 was added for the move to 6. Instances on an older version are told to upgrade to 6.21.0 first.
1 parent 5243e2e commit ab94a81

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
namespace ServiceControlInstaller.Engine.UnitTests.Configuration
2+
{
3+
using NuGet.Versioning;
4+
using NUnit.Framework;
5+
using ServiceControlInstaller.Engine.Configuration.ServiceControl;
6+
7+
[TestFixture]
8+
public class UpgradeInfoTests
9+
{
10+
[TestCase("6.21.0")]
11+
[TestCase("6.21.0-beta.1")]
12+
[TestCase("6.21.2")]
13+
[TestCase("6.22.0")]
14+
[TestCase("7.0.0")]
15+
public void Should_accept_the_latest_version_of_major_6_and_later(string current)
16+
{
17+
var upgradeInfo = UpgradeInfo.GetUpgradePathFor(SemanticVersion.Parse(current));
18+
19+
Assert.Multiple(() =>
20+
{
21+
Assert.That(upgradeInfo.HasIncompatibleVersion, Is.False);
22+
Assert.That(upgradeInfo.UpgradePath, Is.Empty);
23+
});
24+
}
25+
26+
[TestCase("6.0.0", "6.21.0")]
27+
[TestCase("6.20.0", "6.21.0")]
28+
public void Should_require_the_latest_version_of_major_6_from_an_older_6(string current, string expectedPath)
29+
{
30+
var upgradeInfo = UpgradeInfo.GetUpgradePathFor(SemanticVersion.Parse(current));
31+
32+
Assert.Multiple(() =>
33+
{
34+
Assert.That(upgradeInfo.HasIncompatibleVersion, Is.True);
35+
Assert.That(upgradeInfo.ToString(), Is.EqualTo(expectedPath));
36+
});
37+
}
38+
39+
[TestCase("5.11.0", "6.21.0")]
40+
[TestCase("5.11.11", "6.21.0")]
41+
[TestCase("5.0.0", "5.11.0 ➡️ 6.21.0")]
42+
[TestCase("4.33.0", "5.11.0 ➡️ 6.21.0")]
43+
[TestCase("4.26.0", "4.33.0 ➡️ 5.11.0 ➡️ 6.21.0")]
44+
[TestCase("1.0.0", "1.48.0 ➡️ 2.1.5 ➡️ 3.8.4 ➡️ 4.33.0 ➡️ 5.11.0 ➡️ 6.21.0")]
45+
public void Should_keep_requiring_the_last_version_of_each_earlier_major(string current, string expectedPath)
46+
{
47+
var upgradeInfo = UpgradeInfo.GetUpgradePathFor(SemanticVersion.Parse(current));
48+
49+
Assert.Multiple(() =>
50+
{
51+
Assert.That(upgradeInfo.HasIncompatibleVersion, Is.True);
52+
Assert.That(upgradeInfo.ToString(), Is.EqualTo(expectedPath));
53+
});
54+
}
55+
}
56+
}

‎src/ServiceControlInstaller.Engine/Configuration/ServiceControl/UpgradeInfo.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public class UpgradeInfo
1111
new(2, 1, 5),
1212
new(3, 8, 4),
1313
new(4, 33, 0), // Added IngestErrorMessages setting to enable message replay during 4to5 upgrade guide scenario
14-
new(5, 11, 0)
14+
new(5, 11, 0),
15+
new(6, 21, 0)
1516
];
1617

1718
public SemanticVersion[] UpgradePath { get; private init; }

0 commit comments

Comments
 (0)