Skip to content

Commit

Permalink
Correctly set IsInNewVersion bit + small null logger fix (#717)
Browse files Browse the repository at this point in the history
* Small fix to possibly null logger

* Correctly set IsInNewVersion bit for new records when operating in (v+1) during checkpointing. Needed to ensure that we start making in-place-updates on (v+1) version instead of continuously running in append-only mode during the checkpoint.

* nit

* Update version to 1.0.31
  • Loading branch information
badrishc authored Oct 12, 2024
1 parent e3c8a20 commit 6d635c5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .azure/pipelines/azure-pipelines-external-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 53) -- NOTE - these two values need to be the same
######################################
name: 1.0.30
name: 1.0.31
trigger:
branches:
include:
Expand Down
2 changes: 1 addition & 1 deletion libs/host/GarnetServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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.30";
readonly string version = "1.0.31";

/// <summary>
/// Resp protocol version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private unsafe void IOCallback(uint errorCode, uint numBytes, object context)
if (errorCode != 0)
{
var errorMessage = new Win32Exception((int)errorCode).Message;
logger.LogError("[DeviceLogCheckpointManager] OverlappedStream GetQueuedCompletionStatus error: {errorCode} msg: {errorMessage}", errorCode, errorMessage);
logger?.LogError("[DeviceLogCheckpointManager] OverlappedStream GetQueuedCompletionStatus error: {errorCode} msg: {errorMessage}", errorCode, errorMessage);
}
semaphore.Release();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
Expand Down Expand Up @@ -223,8 +222,7 @@ public readonly bool IsInNewVersion
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetIsInNewVersion() => word &= ~kInNewVersionBitMask;

public void SetIsInNewVersion() => word |= kInNewVersionBitMask;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetDirtyAndModified() => word |= kDirtyBitMask | kModifiedBitMask;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 6d635c5

Please sign in to comment.