From c0ae5a930eeebd9fccb8e6f86f0c23f98defec8a Mon Sep 17 00:00:00 2001 From: Badrish Chandramouli Date: Thu, 16 May 2024 15:41:29 -0700 Subject: [PATCH] Fix page post-flush page fixup logic (#390) * Fix page post-flush page fixup logic if ReadOnlyAddress has moved past end address. * update version --- .azure/pipelines/azure-pipelines-external-release.yml | 2 +- libs/host/GarnetServer.cs | 2 +- .../Tsavorite/cs/src/core/Allocator/AllocatorBase.cs | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.azure/pipelines/azure-pipelines-external-release.yml b/.azure/pipelines/azure-pipelines-external-release.yml index 2d159090f9..7ac6ad903c 100644 --- a/.azure/pipelines/azure-pipelines-external-release.yml +++ b/.azure/pipelines/azure-pipelines-external-release.yml @@ -3,7 +3,7 @@ # 1) update the name: string below (line 6) -- this is the version for the nuget package (e.g. 1.0.0) # 2) update \libs\host\GarnetServer.cs readonly string version (~line 45) -- NOTE - these two values need to be the same ###################################### -name: 1.0.8 +name: 1.0.9 trigger: none resources: repositories: diff --git a/libs/host/GarnetServer.cs b/libs/host/GarnetServer.cs index c8f90f05b9..e14e27a668 100644 --- a/libs/host/GarnetServer.cs +++ b/libs/host/GarnetServer.cs @@ -42,7 +42,7 @@ public class GarnetServer : IDisposable protected StoreWrapper storeWrapper; // IMPORTANT: Keep the version in sync with .azure\pipelines\azure-pipelines-external-release.yml line ~6. - readonly string version = "1.0.8"; + readonly string version = "1.0.9"; /// /// Resp protocol version diff --git a/libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs b/libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs index b6dfac758f..2058eb2f83 100644 --- a/libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs +++ b/libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs @@ -2268,12 +2268,15 @@ protected void AsyncFlushPageToDeviceCallback(uint errorCode, uint numBytes, obj if (result.fromAddress > startAddress) startAddress = result.fromAddress; + if (result.untilAddress < endAddress) + endAddress = result.untilAddress; + var _readOnlyAddress = SafeReadOnlyAddress; if (_readOnlyAddress > startAddress) startAddress = _readOnlyAddress; + if (_readOnlyAddress > endAddress) + endAddress = _readOnlyAddress; - if (result.untilAddress < endAddress) - endAddress = result.untilAddress; int flushWidth = (int)(endAddress - startAddress); if (flushWidth > 0)