Skip to content

Commit

Permalink
[C#] Change locking to use FasterBase hash buckets (#799)
Browse files Browse the repository at this point in the history
* Locking fixes
- CompletePending* must also check to lock non-auxiliary records
- Ephemeral locking must look for lock evictions as well
- InternalLock must check for SpinWaitUntilRecordIsClosed
- Replace oneMiss handling in InternalLock
- EphemeralSUnlock must follow unlock failures
- LockTable should have its own bufferPool
- Ensure OnPagesClosed does eviction scans in address order

* More locking fixes:
- Fix missing unlock of a Tombstoned record in InternalContinuePendingRead
- Add more Asserts where ManualLocking requires a locked record
- Update and remove obsolete comments

* - Remove key-present optimization for SpinWaitUntilRecordIsClosed
- Better checking on following records transferred from LockTable in InternalLock(unlock)
- Add some additional comments

* Fix hash bucket overflow pointer during recovery
Fix debug assert logic

* WIP on locktable implemented via mainhash overflow buckets

* unstaged files missed in previous push

* Updates to EphemeralOnly locking for transfer-from-RO/RC

* Change LockTableTests to OverflowBucketlockTableTests

* Remove RecordInfo.Tentative, .IsIntermediate*

* More locking WIP: session.NeedKeyLockCode, test cleanup

* WIP locking: Tests build

* WIP on mainhash locking:
- Add KeyCode creation and sorting and methods public and internal
- Remove unnecessary IsLocked (it does not make work with EphemeralOnly and SessionControlled may map to multiple keys)
- More tests run now

* Most UTs run

* More UTs succeed

* Still some UT failures

* - use XLocks as Tentative indicator for insertions/splices at log tail and readcache insertions
- improve readcache consistency checking
- clear HasInMemoryLock when HeadAddress goes above srcRecord address following BlockAllocate
- rename LockingMode.SessionControlled -> Mixed and other renaming for clarity
- remove some unused methods
- fix locking sequences in InternalContinuePendingR(ead|MW)

* More fixes
- Missing 'ref' on recordInfo var in FindAndUnlockTransferredRecord
- Improve record allocation checking for below-HA in-memory source and RecordInfo lock clearing if so
- Add LockCode to HashEntryInfo in DEBUG

* Remove SpinWaitUntilRecordIsClosed; it was only used in ReadCache and in the relevant case we just need to wait for ReadCacheEvict to complete.

* - MixedModeTentativeOrClosed is not needed
- Add/Improve some ToString()s
- Remove unused RecSrc.ClearSrc()
- Rename to HasRecordInfoLock
- Move ICPRead HandleImmediateRetryStatus outside the lock scope
- Consoldiate EphemeralSUnlock(AfterPendingIO)

* Streamline locking and FindInMemory calls in InternalXxx

* - Change names to pendingContext.Initial*Address and improve setting of these in InternalXxx and handling of these in CompletePending*() and TryFindRecordInMemory.
    - Also consistentize related param names for readcache and log search to minAddress.

* Clean up pending RMW call to CreateNewRecordRMW, per prior changes that make the inputSrc unnecessary.

* - Fix stale readcache assignment to recSrc.Log
- make searches after pendingIO completion non-inclusive of minAddress
- Some ToString() and naming changes for consistency
- Remove RecordInfo.IsValidUpdateOrLockSource (superseded by direct call to .IsClosed)

* Allow length specification on KeyCode array operations

* - Fix check for lock having escaped to eviction zone following BlockAllocate
- Add some comments for SafeHeadAddress et al.

* - Make sure the readcache bit is set when needed on addresses put into stackCtx.newLogicalAddress.
- Rename to HandleNewRecordOnException for clarity

* Update remote project

* - Make sure FindAndUnlockTransferredRecord can go to SafeHeadAddress
- Add non-ref overload of GetLockCode

* Tweaks for benchmark with Mixed locking

* Add ILockableKey.CompareLockCodes

* Change LockCode to just be hashcode, since we may grow the hash table.

* - Make CPR consistency check work without conflict with the key latches in the HashBuckets.
- Change some names for clarity.
- Pending read completion should return values from any in-memory record, as they are the latest

* Remove duplicate opCtx param and removed sessionCtx (aka currentCtx, aka ctx) from calls where FasterSession was also passed (in favor of (new) FasterSession.SessionCtx), where the called method has a type constraint of "where FasterSession : IFasterSession<Key, Value, Input, Output, Context>". Not yet done: converting "whereFasterSession : IFasterSession" constraints to generic to remove the duplicate ctx parameter.

* Fix DoLockOp to compare bucket indexes, not KeyCodes

* Finish removal of duplicate sessionCtx param from calls where FasterSession was also passed (in favor of (new) FasterSession.SessionCtx), where the called method has a type constraint of "where FasterSession : IFasterSession" (non-generic). This cannot be done in Synchronization (the state machines) due to their use of NullFasterSession.

* Fix key duplication in readcache and log:
- VerifyInMemoryAddresses should not refresh hei if no splice point is present
- FindRecordInMemory checks pendingContext.InitialHash
- Move CompleteCopyToTail in ITCTT into the non-readcache section
- TryFindRecordInMemory needs to check pc.InitialEntryIndex's readcache bit
- Updaters need to scan down to hlog.ReadOnlyAddress to ensure the "key is not at or below LatestLogicalAddress" logic holds
- ReadCacheCheckTailAfterSplice needs to check hei.*Address readcache bit

* Replace use of SafeHeadAddress with SpinWaitUntilClosed in FindInReadCache

* Remove LockingMode.EphemeralOnly
add --hashpack arg to FASTER.benchmark

* Tweaks for the Standard locking change

* fix remote to use LockingMode.Standard

* Add DisposeTest comments and more Asserts

* Use calls on RecordSource to make it easier to verify correct matching of log and physicalAddress

* Temporarily disable LocalMemoryDevice tests for investigation

* test removal of DisposeTests

* - Fix for CTT to address SameKeyInsertAndCTTTest failure
- Add missing arg parsing for MemOnlyCache
- Re-enable DeviceType.LocalMemory in tests

* [C#] MemOnlyCache sample: improved size tracking, including read cache (#800)

* Improved cache size tracking, including read cache

* Rename MemOnlyCache to ResizableCacheStore.

* update doc

* fixes

* Updates

* ClearBitsForDiskImages should unseal record as well (Q: why was it sealed to begin with?)

* Correct clearing of index bits during recovery

* Remove RecordInfo sealing

* WIP Ephemeral locking at IFunctions-level only, part 1

* Remove unused SessionType enumeration; consolidate duplicate IFasterSession implementations

* - Add EphemeralLocking  readcache detach/reattach logic
- Remove unused ReadFlags.ResetModifiedBit

* Rename a couple files

* re-add RecordInfo.Seal for Ephemeral locking; remove  unused (RMW|Upsert)Action.NeedMoreSpace (this is the default 'false' behavior)

* Remove single-key overloads of Lock() and Unlock()

* - Update a too-aggressive assert.
- CreateLogDevice errors on Windows if path > MAX_PATH minus room for segment#.

* Improve previous MAX_PATH fix

* Chnge Read of an expired to just return NOTFOUND | Expired rather than tombstoning

* RETRY_LATER rather than trying to re-find splice point directly in VerifyInMemoryAddresses

---------

Co-authored-by: Badrish Chandramouli <badrishc@microsoft.com>
  • Loading branch information
TedHartMS and badrishc authored Mar 23, 2023
1 parent 8c52f54 commit 3c6dad7
Show file tree
Hide file tree
Showing 110 changed files with 5,176 additions and 6,643 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://raw.githubusercontent.com/microsoft/FASTER/master/docs/assets/images/faster-logo.png" alt="FASTER logo" width="600px" />
<img src="https://raw.githubusercontent.com/microsoft/FASTER/main/docs/assets/images/faster-logo.png" alt="FASTER logo" width="600px" />
</p>

[![NuGet](https://img.shields.io/nuget/v/Microsoft.FASTER.Core.svg)](https://www.nuget.org/packages/Microsoft.FASTER.Core/)
Expand Down
22 changes: 11 additions & 11 deletions cs/FASTER.sln
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecondaryReaderStore", "sam
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VersionedRead", "samples\ReadAddress\VersionedRead.csproj", "{33ED9E1B-1EF0-4984-A07A-7A26C205A446}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MemOnlyCache", "samples\MemOnlyCache\MemOnlyCache.csproj", "{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsyncStress", "playground\AsyncStress\AsyncStress.csproj", "{9EFCF8C5-320B-473C-83DE-3815981D465B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FasterLogStress", "playground\FasterLogMLSDTest\FasterLogStress.csproj", "{E8C7FB0F-38B8-468A-B1CA-8793DF8F2693}"
Expand Down Expand Up @@ -112,6 +110,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{CEDB9572-7
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResizableCacheStore", "samples\ResizableCacheStore\ResizableCacheStore.csproj", "{B4A55211-5457-44B9-8BCB-A5488C994965}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -288,14 +288,6 @@ Global
{33ED9E1B-1EF0-4984-A07A-7A26C205A446}.Release|Any CPU.Build.0 = Release|x64
{33ED9E1B-1EF0-4984-A07A-7A26C205A446}.Release|x64.ActiveCfg = Release|x64
{33ED9E1B-1EF0-4984-A07A-7A26C205A446}.Release|x64.Build.0 = Release|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Debug|Any CPU.ActiveCfg = Debug|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Debug|Any CPU.Build.0 = Debug|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Debug|x64.ActiveCfg = Debug|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Debug|x64.Build.0 = Debug|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Release|Any CPU.ActiveCfg = Release|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Release|Any CPU.Build.0 = Release|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Release|x64.ActiveCfg = Release|x64
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864}.Release|x64.Build.0 = Release|x64
{9EFCF8C5-320B-473C-83DE-3815981D465B}.Debug|Any CPU.ActiveCfg = Debug|x64
{9EFCF8C5-320B-473C-83DE-3815981D465B}.Debug|Any CPU.Build.0 = Debug|x64
{9EFCF8C5-320B-473C-83DE-3815981D465B}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -335,6 +327,14 @@ Global
{AF996720-DB6C-4ED7-9693-B9531F0B119A}.Release|Any CPU.Build.0 = Release|Any CPU
{AF996720-DB6C-4ED7-9693-B9531F0B119A}.Release|x64.ActiveCfg = Release|Any CPU
{AF996720-DB6C-4ED7-9693-B9531F0B119A}.Release|x64.Build.0 = Release|Any CPU
{B4A55211-5457-44B9-8BCB-A5488C994965}.Debug|Any CPU.ActiveCfg = Debug|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Debug|Any CPU.Build.0 = Debug|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Debug|x64.ActiveCfg = Debug|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Debug|x64.Build.0 = Debug|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Release|Any CPU.ActiveCfg = Release|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Release|Any CPU.Build.0 = Release|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Release|x64.ActiveCfg = Release|x64
{B4A55211-5457-44B9-8BCB-A5488C994965}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -363,12 +363,12 @@ Global
{E2A1C205-4D35-448C-A72F-B9A4AE28EB4E} = {62BC1134-B6E1-476A-B894-7CA278A8B6DE}
{EBE313E5-22D2-4C74-BA1F-16B60404B335} = {62BC1134-B6E1-476A-B894-7CA278A8B6DE}
{33ED9E1B-1EF0-4984-A07A-7A26C205A446} = {62BC1134-B6E1-476A-B894-7CA278A8B6DE}
{998D4C78-B0C5-40FF-9BDC-716BAC8CF864} = {62BC1134-B6E1-476A-B894-7CA278A8B6DE}
{9EFCF8C5-320B-473C-83DE-3815981D465B} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{E8C7FB0F-38B8-468A-B1CA-8793DF8F2693} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{A265D9D2-3FEA-48BB-B1CC-273ECFEA0611} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{DC3E0640-9A36-43D0-AA37-A1B61B0BFBC9} = {62BC1134-B6E1-476A-B894-7CA278A8B6DE}
{AF996720-DB6C-4ED7-9693-B9531F0B119A} = {5E4C9997-3350-4761-9FC9-F27649848B1D}
{B4A55211-5457-44B9-8BCB-A5488C994965} = {62BC1134-B6E1-476A-B894-7CA278A8B6DE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A0750637-2CCB-4139-B25E-F2CE740DCFAC}
Expand Down
8 changes: 4 additions & 4 deletions cs/benchmark/FasterSpanByteYcsbBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ internal FasterSpanByteYcsbBenchmark(KeySpanByte[] i_keys_, KeySpanByte[] t_keys

if (testLoader.Options.UseSmallMemoryLog)
store = new FasterKV<SpanByte, SpanByte>
(testLoader.MaxKey / 2, new LogSettings { LogDevice = device, PreallocateLog = true, PageSizeBits = 22, SegmentSizeBits = 26, MemorySizeBits = 26 },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, disableEphemeralLocking: testLoader.LockImpl != LockImpl.Ephemeral);
(testLoader.MaxKey / testLoader.Options.HashPacking, new LogSettings { LogDevice = device, PreallocateLog = true, PageSizeBits = 22, SegmentSizeBits = 26, MemorySizeBits = 26 },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, lockingMode: testLoader.LockingMode);
else
store = new FasterKV<SpanByte, SpanByte>
(testLoader.MaxKey / 2, new LogSettings { LogDevice = device, PreallocateLog = true, MemorySizeBits = 35 },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, disableEphemeralLocking: testLoader.LockImpl != LockImpl.Ephemeral);
(testLoader.MaxKey / testLoader.Options.HashPacking, new LogSettings { LogDevice = device, PreallocateLog = true, MemorySizeBits = 35 },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, lockingMode: testLoader.LockingMode);
}

internal void Dispose()
Expand Down
32 changes: 4 additions & 28 deletions cs/benchmark/FasterYcsbBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ internal FASTER_YcsbBenchmark(Key[] i_keys_, Key[] t_keys_, TestLoader testLoade

if (testLoader.Options.UseSmallMemoryLog)
store = new FasterKV<Key, Value>
(testLoader.MaxKey / 4, new LogSettings { LogDevice = device, PreallocateLog = true, PageSizeBits = 25, SegmentSizeBits = 30, MemorySizeBits = 28 },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, disableEphemeralLocking: testLoader.LockImpl != LockImpl.Ephemeral);
(testLoader.MaxKey / testLoader.Options.HashPacking, new LogSettings { LogDevice = device, PreallocateLog = true, PageSizeBits = 25, SegmentSizeBits = 30, MemorySizeBits = 28 },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, lockingMode: testLoader.LockingMode);
else
store = new FasterKV<Key, Value>
(testLoader.MaxKey / 2, new LogSettings { LogDevice = device, PreallocateLog = true },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, disableEphemeralLocking: testLoader.LockImpl != LockImpl.Ephemeral);
(testLoader.MaxKey / testLoader.Options.HashPacking, new LogSettings { LogDevice = device, PreallocateLog = true },
new CheckpointSettings { CheckpointDir = testLoader.BackupPath }, lockingMode: testLoader.LockingMode);
}

internal void Dispose()
Expand Down Expand Up @@ -310,22 +310,6 @@ internal unsafe (double, double) Run(TestLoader testLoader)
dash.Start();
#endif

ClientSession<Key, Value, Input, Output, Empty, Functions> session = default;
LockableUnsafeContext<Key, Value, Input, Output, Empty, Functions> luContext = default;

(Key key, LockType kind) xlock = (new Key { value = long.MaxValue }, LockType.Exclusive);
(Key key, LockType kind) slock = (new Key { value = long.MaxValue - 1 }, LockType.Shared);
if (testLoader.Options.LockImpl == (int)LockImpl.Manual)
{
session = store.For(functions).NewSession<Functions>();
luContext = session.LockableUnsafeContext;
luContext.BeginLockable();

Console.WriteLine("Taking 2 manual locks");
luContext.Lock(xlock.key, xlock.kind);
luContext.Lock(slock.key, slock.kind);
}

Thread[] workers = new Thread[testLoader.Options.ThreadCount];

Console.WriteLine("Executing setup.");
Expand Down Expand Up @@ -432,14 +416,6 @@ internal unsafe (double, double) Run(TestLoader testLoader)
worker.Join();
}

if (testLoader.Options.LockImpl == (int)LockImpl.Manual)
{
luContext.Unlock(xlock.key, xlock.kind);
luContext.Unlock(slock.key, slock.kind);
luContext.EndLockable();
session.Dispose();
}

waiter.Reset();

#if DASHBOARD
Expand Down
11 changes: 7 additions & 4 deletions cs/benchmark/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ class Options
[Option('z', "locking", Required = false, Default = 0,
HelpText = "Locking Implementation:" +
"\n 0 = None (default)" +
"\n 1 = Ephemeral locking using RecordInfo.SpinLock()" +
"\n 2 = Manual locking using LockableUnsafeContext")]
public int LockImpl { get; set; }
"\n 1 = Mixed-mode locking using main HashTable buckets")]
public int LockingMode { get; set; }

[Option('i', "iterations", Required = false, Default = 1,
HelpText = "Number of iterations of the test to run")]
Expand Down Expand Up @@ -71,6 +70,10 @@ class Options
HelpText = "Use Small Memory log in experiment")]
public bool UseSmallMemoryLog { get; set; }

[Option("hashpack", Required = false, Default = 2,
HelpText = "The hash table packing; divide the number of keys by this to cause hash collisions")]
public int HashPacking { get; set; }

[Option("safectx", Required = false, Default = false,
HelpText = "Use 'safe' context (slower, per-operation epoch control) in experiment")]
public bool UseSafeContext { get; set; }
Expand All @@ -96,7 +99,7 @@ class Options
public string GetOptionsString()
{
static string boolStr(bool value) => value ? "y" : "n";
return $"d: {DistributionName.ToLower()}; n: {NumaStyle}; r: {ReadPercent}; t: {ThreadCount}; z: {LockImpl}; i: {IterationCount};"
return $"d: {DistributionName.ToLower()}; n: {NumaStyle}; r: {ReadPercent}; t: {ThreadCount}; z: {LockingMode}; i: {IterationCount}; hp: {HashPacking}"
+ $" sd: {boolStr(UseSmallData)}; sm: {boolStr(UseSmallMemoryLog)}; sy: {boolStr(this.UseSyntheticData)}; safectx: {boolStr(this.UseSafeContext)};"
+ $" chkptms: {this.PeriodicCheckpointMilliseconds}; chkpttype: {(this.PeriodicCheckpointMilliseconds > 0 ? this.PeriodicCheckpointType.ToString() : "None")};"
+ $" chkptincr: {boolStr(this.PeriodicCheckpointTryIncremental)}";
Expand Down
14 changes: 11 additions & 3 deletions cs/benchmark/TestLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TestLoader
internal KeySpanByte[] txn_span_keys = default;

internal readonly BenchmarkType BenchmarkType;
internal readonly LockImpl LockImpl;
internal readonly LockingMode LockingMode;
internal readonly long InitCount;
internal readonly long TxnCount;
internal readonly int MaxKey;
Expand Down Expand Up @@ -60,13 +60,21 @@ static bool verifyOption(bool isValid, string name)
if (!verifyOption(Options.NumaStyle >= 0 && Options.NumaStyle <= 1, "NumaStyle"))
return;

this.LockImpl = (LockImpl)Options.LockImpl;
if (!verifyOption(Enum.IsDefined(typeof(LockImpl), this.LockImpl), "Lock Implementation"))
this.LockingMode = Options.LockingMode switch
{
0 => LockingMode.None,
1 => LockingMode.Standard,
_ => throw new InvalidOperationException($"Unknown Locking mode int: {Options.LockingMode}")
};
if (!verifyOption(Enum.IsDefined(typeof(LockingMode), this.LockingMode), "LockingMode"))
return;

if (!verifyOption(Options.IterationCount > 0, "Iteration Count"))
return;

if (!verifyOption(Options.HashPacking > 0, "Iteration Count"))
return;

if (!verifyOption(Options.ReadPercent >= -1 && Options.ReadPercent <= 100, "Read Percent"))
return;

Expand Down
7 changes: 0 additions & 7 deletions cs/benchmark/YcsbConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ enum BenchmarkType : byte
ConcurrentDictionaryYcsb
};

enum LockImpl : byte
{
None = 0,
Ephemeral = 1,
Manual = 2
};

enum AddressLineNum : int
{
Before = 1,
Expand Down
3 changes: 2 additions & 1 deletion cs/remote/samples/FixedLenServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using FASTER.server;
using System.Diagnostics;
using Microsoft.Extensions.Logging;
using FASTER.core;

namespace FasterFixedLenServer
{
Expand Down Expand Up @@ -38,7 +39,7 @@ static void Main(string[] args)
builder.SetMinimumLevel(LogLevel.Error);
});

using var server = new FixedLenServer<Key, Value, Input, Output, Functions>(opts.GetServerOptions(), () => new Functions(), disableEphemeralLocking: true);
using var server = new FixedLenServer<Key, Value, Input, Output, Functions>(opts.GetServerOptions(), () => new Functions(), lockingMode: LockingMode.Standard);
server.Start();
Console.WriteLine("Started server");

Expand Down
6 changes: 3 additions & 3 deletions cs/remote/src/FASTER.server/Servers/FixedLenServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public sealed class FixedLenServer<Key, Value, Input, Output, Functions> : Gener
/// </summary>
/// <param name="opts"></param>
/// <param name="functionsGen"></param>
/// <param name="disableEphemeralLocking"></param>
/// <param name="lockingMode"></param>
/// <param name="maxSizeSettings"></param>
/// <param name="loggerFactory"></param>
public FixedLenServer(ServerOptions opts, Func<Functions> functionsGen, bool disableEphemeralLocking, MaxSizeSettings maxSizeSettings = default, ILoggerFactory loggerFactory = null)
: base(opts, functionsGen, new FixedLenSerializer<Key, Value, Input, Output>(), new FixedLenKeySerializer<Key, Input>(), disableEphemeralLocking, maxSizeSettings, loggerFactory)
public FixedLenServer(ServerOptions opts, Func<Functions> functionsGen, LockingMode lockingMode, MaxSizeSettings maxSizeSettings = default, ILoggerFactory loggerFactory = null)
: base(opts, functionsGen, new FixedLenSerializer<Key, Value, Input, Output>(), new FixedLenKeySerializer<Key, Input>(), lockingMode: lockingMode, maxSizeSettings, loggerFactory)
{
}
}
Expand Down
6 changes: 3 additions & 3 deletions cs/remote/src/FASTER.server/Servers/GenericServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public class GenericServer<Key, Value, Input, Output, Functions, ParameterSerial
/// <param name="functionsGen"></param>
/// <param name="serializer"></param>
/// <param name="keyInputSerializer"></param>
/// <param name="disableEphemeralLocking"></param>
/// <param name="lockingMode"></param>
/// <param name="maxSizeSettings"></param>
/// <param name="loggerFactory"></param>
public GenericServer(ServerOptions opts, Func<Functions> functionsGen, ParameterSerializer serializer, IKeyInputSerializer<Key, Input> keyInputSerializer,
bool disableEphemeralLocking, MaxSizeSettings maxSizeSettings = default, ILoggerFactory loggerFactory = null)
LockingMode lockingMode, MaxSizeSettings maxSizeSettings = default, ILoggerFactory loggerFactory = null)
{
this.opts = opts;

Expand All @@ -45,7 +45,7 @@ public GenericServer(ServerOptions opts, Func<Functions> functionsGen, Parameter
if (!Directory.Exists(opts.CheckpointDir))
Directory.CreateDirectory(opts.CheckpointDir);

store = new FasterKV<Key, Value>(indexSize, logSettings, checkpointSettings, disableEphemeralLocking: disableEphemeralLocking, loggerFactory: loggerFactory);
store = new FasterKV<Key, Value>(indexSize, logSettings, checkpointSettings, lockingMode: lockingMode, loggerFactory: loggerFactory);

if (opts.Recover)
{
Expand Down
2 changes: 1 addition & 1 deletion cs/remote/src/FASTER.server/Servers/VarLenServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public VarLenServer(ServerOptions opts, ILoggerFactory loggerFactory = null)
if (!Directory.Exists(opts.CheckpointDir))
Directory.CreateDirectory(opts.CheckpointDir);

store = new FasterKV<SpanByte, SpanByte>(indexSize, logSettings, checkpointSettings, disableEphemeralLocking: false, loggerFactory: loggerFactory);
store = new FasterKV<SpanByte, SpanByte>(indexSize, logSettings, checkpointSettings, lockingMode: LockingMode.Standard, loggerFactory: loggerFactory);

if (!opts.DisablePubSub)
{
Expand Down
2 changes: 1 addition & 1 deletion cs/remote/test/FASTER.remote.test/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static FixedLenServer<long, long, long, long, SimpleFunctions<long, long,
Recover = tryRecover,
IndexSize = "1m",
};
return new FixedLenServer<long, long, long, long, SimpleFunctions<long, long, long>>(opts, () => new SimpleFunctions<long, long, long>(merger), disableEphemeralLocking: true);
return new FixedLenServer<long, long, long, long, SimpleFunctions<long, long, long>>(opts, () => new SimpleFunctions<long, long, long>(merger), lockingMode: LockingMode.Standard);
}

/// <summary>
Expand Down
Loading

0 comments on commit 3c6dad7

Please sign in to comment.