Skip to content

Commit

Permalink
Server side transaction failure in Cluster Mode (microsoft#702)
Browse files Browse the repository at this point in the history
* Removing IClusterSession as it can be fetched through respserver session. It's not set and results in object reference null exception for cluster mode transactions

* Version bumped.

---------

Co-authored-by: Badrish Chandramouli <[email protected]>
  • Loading branch information
Xizt and badrishc authored Oct 4, 2024
1 parent 748ec9a commit 28328d0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 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.29
name: 1.0.30
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.29";
readonly string version = "1.0.30";

/// <summary>
/// Resp protocol version
Expand Down
4 changes: 0 additions & 4 deletions libs/server/Transaction/TransactionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ public sealed unsafe partial class TransactionManager
// Not readonly to avoid defensive copy
GarnetWatchApi<BasicGarnetApi> garnetTxPrepareApi;

// Cluster session
IClusterSession clusterSession;

// Not readonly to avoid defensive copy
LockableGarnetApi garnetTxMainApi;

Expand Down Expand Up @@ -118,7 +115,6 @@ internal TransactionManager(
this.logger = logger;

this.respSession = respSession;
this.clusterSession = respSession.clusterSession;

watchContainer = new WatchedKeysContainer(initialSliceBufferSize, functionsState.watchVersionMap);
keyEntries = new TxnKeyEntries(initialSliceBufferSize, lockableContext, objectStoreLockableContext);
Expand Down
2 changes: 1 addition & 1 deletion libs/server/Transaction/TxnKeyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public unsafe void VerifyKeyOwnership(ArgSlice key, LockType type)
if (!clusterEnabled) return;

bool readOnly = type == LockType.Shared;
if (!clusterSession.CheckSingleKeySlotVerify(key, readOnly, respSession.SessionAsking))
if (!respSession.clusterSession.CheckSingleKeySlotVerify(key, readOnly, respSession.SessionAsking))
{
this.state = TxnState.Aborted;
return;
Expand Down

0 comments on commit 28328d0

Please sign in to comment.