Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Change locking to use FasterBase hash buckets #799

Merged
merged 75 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a98babc
Locking fixes
TedHartMS Jan 10, 2023
efbf48b
Merge remote-tracking branch 'origin/main' into locktable-completepen…
badrishc Jan 10, 2023
d53aadf
More locking fixes:
TedHartMS Jan 11, 2023
61d8dbd
- Remove key-present optimization for SpinWaitUntilRecordIsClosed
TedHartMS Jan 11, 2023
9bc572f
Fix hash bucket overflow pointer during recovery
badrishc Jan 13, 2023
a866e95
WIP on locktable implemented via mainhash overflow buckets
TedHartMS Jan 17, 2023
0da8faf
merge 'main'
TedHartMS Jan 19, 2023
377ea8d
unstaged files missed in previous push
TedHartMS Jan 19, 2023
fcb021f
Merge latest 'main'
TedHartMS Jan 19, 2023
c9c25c1
Updates to EphemeralOnly locking for transfer-from-RO/RC
TedHartMS Jan 20, 2023
c85bde8
Change LockTableTests to OverflowBucketlockTableTests
TedHartMS Jan 20, 2023
366cbb5
Remove RecordInfo.Tentative, .IsIntermediate*
TedHartMS Jan 21, 2023
eca4bde
More locking WIP: session.NeedKeyLockCode, test cleanup
TedHartMS Jan 22, 2023
afb4034
merge 'main' (and add RecordInfo.ClearBitsForDiskImages)
TedHartMS Jan 22, 2023
29f2975
WIP locking: Tests build
TedHartMS Jan 23, 2023
07e7313
WIP on mainhash locking:
TedHartMS Jan 26, 2023
b1071a9
Most UTs run
TedHartMS Feb 11, 2023
bc89b53
More UTs succeed
TedHartMS Feb 12, 2023
85820f2
Still some UT failures
TedHartMS Feb 14, 2023
ac7f4a0
- use XLocks as Tentative indicator for insertions/splices at log tai…
TedHartMS Feb 16, 2023
ae079d9
More fixes
TedHartMS Feb 17, 2023
8d6f60d
Remove SpinWaitUntilRecordIsClosed; it was only used in ReadCache and…
TedHartMS Feb 18, 2023
97af4a6
- MixedModeTentativeOrClosed is not needed
TedHartMS Feb 18, 2023
cd1b0e0
Streamline locking and FindInMemory calls in InternalXxx
TedHartMS Feb 19, 2023
6abaa58
- Change names to pendingContext.Initial*Address and improve setting …
TedHartMS Feb 19, 2023
aa28c25
Clean up pending RMW call to CreateNewRecordRMW, per prior changes th…
TedHartMS Feb 19, 2023
6be7edf
Merge 'main'
TedHartMS Feb 19, 2023
d03433f
- Fix stale readcache assignment to recSrc.Log
TedHartMS Feb 20, 2023
04443b5
Allow length specification on KeyCode array operations
TedHartMS Feb 20, 2023
ac32faf
- Fix check for lock having escaped to eviction zone following BlockA…
TedHartMS Feb 20, 2023
dccb1dd
- Make sure the readcache bit is set when needed on addresses put int…
TedHartMS Feb 21, 2023
e7a2aed
Update remote project
TedHartMS Feb 21, 2023
40161e1
- Make sure FindAndUnlockTransferredRecord can go to SafeHeadAddress
TedHartMS Feb 21, 2023
709f4a8
Tweaks for benchmark with Mixed locking
TedHartMS Feb 21, 2023
4848e44
Add ILockableKey.CompareLockCodes
TedHartMS Feb 23, 2023
f3639ba
Change LockCode to just be hashcode, since we may grow the hash table.
TedHartMS Feb 24, 2023
60b41ec
- Make CPR consistency check work without conflict with the key latch…
TedHartMS Feb 25, 2023
44925c1
Remove duplicate opCtx param and removed sessionCtx (aka currentCtx, …
TedHartMS Feb 26, 2023
9b8bf92
Fix DoLockOp to compare bucket indexes, not KeyCodes
TedHartMS Feb 26, 2023
a842d94
Finish removal of duplicate sessionCtx param from calls where FasterS…
TedHartMS Feb 26, 2023
74f642c
Fix key duplication in readcache and log:
TedHartMS Feb 28, 2023
717dd24
merge 'main'
TedHartMS Feb 28, 2023
744e8cc
Replace use of SafeHeadAddress with SpinWaitUntilClosed in FindInRead…
TedHartMS Mar 2, 2023
7a66306
Remove LockingMode.EphemeralOnly
TedHartMS Mar 2, 2023
67ef400
Tweaks for the Standard locking change
TedHartMS Mar 2, 2023
0c2710e
fix remote to use LockingMode.Standard
TedHartMS Mar 2, 2023
8586a6f
Add DisposeTest comments and more Asserts
TedHartMS Mar 3, 2023
cefc751
Use calls on RecordSource to make it easier to verify correct matchin…
TedHartMS Mar 3, 2023
a35d7a4
Temporarily disable LocalMemoryDevice tests for investigation
TedHartMS Mar 3, 2023
14a26f5
test removal of DisposeTests
badrishc Mar 3, 2023
e48d926
- Fix for CTT to address SameKeyInsertAndCTTTest failure
TedHartMS Mar 4, 2023
b218ba2
[C#] MemOnlyCache sample: improved size tracking, including read cach…
badrishc Mar 9, 2023
574f9d4
Merge branch 'main' into locktable-mainhash
badrishc Mar 9, 2023
b280b2c
ClearBitsForDiskImages should unseal record as well (Q: why was it se…
badrishc Mar 10, 2023
2179bb9
Correct clearing of index bits during recovery
badrishc Mar 10, 2023
69b1694
Merge branch 'main' into locktable-mainhash
badrishc Mar 10, 2023
6e6ef7e
Merge branch 'main' into locktable-mainhash
badrishc Mar 11, 2023
2e7a8ef
Merge branch 'main' into locktable-mainhash
badrishc Mar 11, 2023
77c38bc
Remove RecordInfo sealing
TedHartMS Mar 14, 2023
74044b6
WIP Ephemeral locking at IFunctions-level only, part 1
TedHartMS Mar 15, 2023
32b701e
Remove unused SessionType enumeration; consolidate duplicate IFasterS…
TedHartMS Mar 16, 2023
9dd92c2
Merge branch 'main' into locktable-mainhash
badrishc Mar 16, 2023
7f1ee00
- Add EphemeralLocking readcache detach/reattach logic
TedHartMS Mar 18, 2023
78d7d2c
Merge branch 'locktable-mainhash' of https://github.com/microsoft/FAS…
TedHartMS Mar 18, 2023
585cc66
Rename a couple files
TedHartMS Mar 18, 2023
33b9851
re-add RecordInfo.Seal for Ephemeral locking; remove unused (RMW|Ups…
TedHartMS Mar 20, 2023
c4429c4
Remove single-key overloads of Lock() and Unlock()
TedHartMS Mar 20, 2023
f0c541f
Merge branch 'main' into locktable-mainhash
badrishc Mar 20, 2023
67a7849
- Update a too-aggressive assert.
TedHartMS Mar 20, 2023
7b348bc
Merge branch 'locktable-mainhash' of https://github.com/microsoft/FAS…
TedHartMS Mar 20, 2023
40f41ef
Improve previous MAX_PATH fix
TedHartMS Mar 20, 2023
041c0e4
Chnge Read of an expired to just return NOTFOUND | Expired rather tha…
TedHartMS Mar 20, 2023
52d4cd1
RETRY_LATER rather than trying to re-find splice point directly in Ve…
TedHartMS Mar 22, 2023
a2835e4
merge from remote
TedHartMS Mar 22, 2023
35b5a4f
Merge branch 'main' into locktable-mainhash
badrishc Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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