From 60a76c1ac3a4bc474338b53d558da7366d98cbf3 Mon Sep 17 00:00:00 2001 From: Philo Date: Tue, 29 Oct 2024 14:30:08 -0700 Subject: [PATCH 1/4] Update default Redis version from 4.0.0 to 6.0.0 for Azure Redis resources --- docs/ReleaseNotes.md | 2 +- src/StackExchange.Redis/Configuration/AzureOptionsProvider.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 5ed2d6cfa..0107c1260 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -8,7 +8,7 @@ Current package versions: ## Unreleased -No pending unreleased changes. +- Update default Redis version from 4.0.0 to 6.0.0 for Azure Redis resources ## 2.8.16 diff --git a/src/StackExchange.Redis/Configuration/AzureOptionsProvider.cs b/src/StackExchange.Redis/Configuration/AzureOptionsProvider.cs index 6e38e15a9..dcdb9f26a 100644 --- a/src/StackExchange.Redis/Configuration/AzureOptionsProvider.cs +++ b/src/StackExchange.Redis/Configuration/AzureOptionsProvider.cs @@ -16,9 +16,9 @@ public class AzureOptionsProvider : DefaultOptionsProvider public override bool AbortOnConnectFail => false; /// - /// The minimum version of Redis in Azure is 4, so use the widest set of available commands when connecting. + /// The minimum version of Redis in Azure is 6, so use the widest set of available commands when connecting. /// - public override Version DefaultVersion => RedisFeatures.v4_0_0; + public override Version DefaultVersion => RedisFeatures.v6_0_0; /// /// List of domains known to be Azure Redis, so we can light up some helpful functionality From 5296aeece8e51b1543bd48a7b66a0783c1ba6bf1 Mon Sep 17 00:00:00 2001 From: Philo Date: Tue, 29 Oct 2024 14:35:50 -0700 Subject: [PATCH 2/4] complete release note --- docs/ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 0107c1260..f6e274254 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -8,7 +8,7 @@ Current package versions: ## Unreleased -- Update default Redis version from 4.0.0 to 6.0.0 for Azure Redis resources +- Update default Redis version from 4.0.0 to 6.0.0 for Azure Redis resources ([#2810 by philon-msft](https://github.com/StackExchange/StackExchange.Redis/pull/2810)) ## 2.8.16 From ba5ab254d719c27a11be5383a3261f690d0c3009 Mon Sep 17 00:00:00 2001 From: Philo Date: Tue, 29 Oct 2024 16:04:50 -0700 Subject: [PATCH 3/4] Fix tests --- tests/StackExchange.Redis.Tests/ConfigTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/StackExchange.Redis.Tests/ConfigTests.cs b/tests/StackExchange.Redis.Tests/ConfigTests.cs index 2a4b2bc75..75f6d25f4 100644 --- a/tests/StackExchange.Redis.Tests/ConfigTests.cs +++ b/tests/StackExchange.Redis.Tests/ConfigTests.cs @@ -25,7 +25,7 @@ public class ConfigTests : TestBase public ConfigTests(ITestOutputHelper output, SharedConnectionFixture fixture) : base(output, fixture) { } public Version DefaultVersion = new(3, 0, 0); - public Version DefaultAzureVersion = new(4, 0, 0); + public Version DefaultAzureVersion = new(6, 0, 0); [Fact] public void ExpectedFields() From f082b734ca412b406cdafb3dd44fe5e3f96920c0 Mon Sep 17 00:00:00 2001 From: Philo Date: Tue, 29 Oct 2024 16:05:34 -0700 Subject: [PATCH 4/4] Fix VS style errors --- .../ConnectionFailedErrorsTests.cs | 4 ++-- tests/StackExchange.Redis.Tests/FailoverTests.cs | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/StackExchange.Redis.Tests/ConnectionFailedErrorsTests.cs b/tests/StackExchange.Redis.Tests/ConnectionFailedErrorsTests.cs index df3802118..d359bd4b4 100644 --- a/tests/StackExchange.Redis.Tests/ConnectionFailedErrorsTests.cs +++ b/tests/StackExchange.Redis.Tests/ConnectionFailedErrorsTests.cs @@ -178,8 +178,8 @@ public async Task CheckFailureRecovered() { using var conn = Create(keepAlive: 1, connectTimeout: 10000, allowAdmin: true, log: Writer, shared: false); - await RunBlockingSynchronousWithExtraThreadAsync(innerScenario).ForAwait(); - void innerScenario() + await RunBlockingSynchronousWithExtraThreadAsync(InnerScenario).ForAwait(); + void InnerScenario() { conn.GetDatabase(); var server = conn.GetServer(conn.GetEndPoints()[0]); diff --git a/tests/StackExchange.Redis.Tests/FailoverTests.cs b/tests/StackExchange.Redis.Tests/FailoverTests.cs index e40d12a14..4827c5aba 100644 --- a/tests/StackExchange.Redis.Tests/FailoverTests.cs +++ b/tests/StackExchange.Redis.Tests/FailoverTests.cs @@ -208,10 +208,7 @@ public async Task SubscriptionsSurviveConnectionFailureAsync() var sub = conn.GetSubscriber(); int counter = 0; Assert.True(sub.IsConnected()); - await sub.SubscribeAsync(channel, delegate - { - Interlocked.Increment(ref counter); - }).ConfigureAwait(false); + await sub.SubscribeAsync(channel, (_, _) => Interlocked.Increment(ref counter)).ConfigureAwait(false); var profile1 = Log(profiler); @@ -257,8 +254,7 @@ await sub.SubscribeAsync(channel, delegate // Ensure we've sent the subscribe command after reconnecting var profile2 = Log(profiler); - //Assert.Equal(1, profile2.Count(p => p.Command == nameof(RedisCommand.SUBSCRIBE))); - + // Assert.Equal(1, profile2.Count(p => p.Command == nameof(RedisCommand.SUBSCRIBE))); Log("Issuing ping after reconnected"); sub.Ping(); @@ -395,7 +391,7 @@ public async Task SubscriptionsSurvivePrimarySwitchAsync() Log(" IsReplica: " + !server.IsReplica); Log(" Type: " + server.ServerType); } - //Skip.Inconclusive("Not enough latency."); + // Skip.Inconclusive("Not enough latency."); } Assert.True(sanityCheck, $"B Connection: {TestConfig.Current.FailoverPrimaryServerAndPort} should be a replica"); Assert.False(bConn.GetServer(TestConfig.Current.FailoverReplicaServerAndPort).IsReplica, $"B Connection: {TestConfig.Current.FailoverReplicaServerAndPort} should be a primary");