Skip to content

Commit 5193b6d

Browse files
authored
Merge branch 'dev' into badrishc/unlimited-epoch
2 parents 9b772b3 + eaa5734 commit 5193b6d

107 files changed

Lines changed: 1607 additions & 2324 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

benchmark/BDN.benchmark/Embedded/GarnetServerEmbedded.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ public EmbeddedNetworkHandler CreateNetworkHandler(SslClientAuthenticationOption
7272
{
7373
IncrementConnectionsReceived();
7474
handler.Start(tlsOptions, remoteEndpointName);
75-
76-
// Spin until auth finishes
77-
while (!handler.IsAuthenticated(out var fault))
78-
{
79-
if (fault != null)
80-
{
81-
throw new Exception("Authentication failed", fault);
82-
}
83-
84-
Thread.Sleep(1);
85-
}
8675
}
8776
catch (Exception ex)
8877
{

benchmark/BDN.benchmark/Operations/RawStringOperations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public unsafe class RawStringOperations : OperationsBase
1818
static ReadOnlySpan<byte> SETEX => "*4\r\n$5\r\nSETEX\r\n$1\r\nd\r\n$1\r\n9\r\n$1\r\nd\r\n"u8;
1919
Request setex;
2020

21-
static ReadOnlySpan<byte> SETNX => "*4\r\n$3\r\nSET\r\n$1\r\na\r\n$1\r\na\r\n$2\r\nNX\r\n"u8;
21+
static ReadOnlySpan<byte> SETNX => "*4\r\n$3\r\nSET\r\n$1\r\na\r\n$1\r\na\r\n$2\r\nNX\r\n"u8; // Becomes SETEXNX rather than SETNX
2222
Request setnx;
2323

24-
static ReadOnlySpan<byte> SETXX => "*4\r\n$3\r\nSET\r\n$1\r\na\r\n$1\r\na\r\n$2\r\nXX\r\n"u8;
24+
static ReadOnlySpan<byte> SETXX => "*4\r\n$3\r\nSET\r\n$1\r\na\r\n$1\r\na\r\n$2\r\nXX\r\n"u8; // Becomes SETEXXX rather than SETXX
2525
Request setxx;
2626

2727
static ReadOnlySpan<byte> GETNF => "*2\r\n$3\r\nGET\r\n$1\r\nb\r\n"u8;
Binary file not shown.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.201",
3+
"version": "10.0.203",
44
"rollForward": "latestMajor",
55
"allowPrerelease": false
66
}

libs/client/ClientSession/GarnetClientSession.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,6 @@ public unsafe void Connect(CancellationToken token = default)
157157
networkSendThrottleMax: networkSendThrottleMax,
158158
logger: logger);
159159
networkHandler.Start(sslOptions, EndPoint.ToString(), token);
160-
161-
// Spin until auth finishes or cancellation occurs
162-
while (!networkHandler.IsAuthenticated(out var fault))
163-
{
164-
if (fault != null)
165-
{
166-
throw new Exception("Authentication failed", fault);
167-
}
168-
169-
token.ThrowIfCancellationRequested();
170-
171-
Thread.Sleep(1);
172-
}
173-
174160
networkSender = networkHandler.GetNetworkSender();
175161
networkSender.GetResponseObject();
176162
offset = networkSender.GetResponseObjectHead();

libs/client/GarnetClient.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,6 @@ public void Connect(CancellationToken token = default)
213213
networkWriter = new NetworkWriter(this, socket, bufferSize, sslOptions, out networkHandler, sendPageSize, networkSendThrottleMax, epoch, PoolOwnerType.GarnetClient, logger);
214214
networkHandler.Start(sslOptions, EndPoint.ToString(), token);
215215

216-
// Spin until auth finishes or cancellation occurs
217-
while (!networkHandler.IsAuthenticated(out var fault))
218-
{
219-
if (fault != null)
220-
{
221-
throw new Exception("Authentication failed", fault);
222-
}
223-
224-
token.ThrowIfCancellationRequested();
225-
226-
Thread.Sleep(1);
227-
}
228-
229216
if (timeoutMilliseconds > 0)
230217
{
231218
Task.Run(TimeoutChecker);

libs/cluster/Server/ClusterProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public void AddNewCheckpointEntry(bool full, AofAddress CheckpointCoveredAofAddr
172172
}
173173

174174
/// <inheritdoc />
175-
public void SafeTruncateAOF(AofAddress truncateUntil)
175+
public void SafeTruncateAOF(in AofAddress truncateUntil)
176176
{
177177
if (clusterManager.CurrentConfig.LocalNodeRole == NodeRole.PRIMARY)
178178
replicationManager.AofSyncDriverStore.SafeTruncateAof(truncateUntil);

libs/cluster/Server/Gossip/GarnetServerNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ byte[] GetMostRecentConfig()
165165
if (clusterProvider.replicationManager != null)
166166
// NOTE: We update replication offset for sublog-0 because this info is used in CLUSTER NODES
167167
// and we cannot have multiple replication offsets without changing the expected CLUSTER NODES response
168-
lastConfig.LazyUpdateLocalReplicationOffset(clusterProvider.replicationManager.ReplicationOffset[0]);
168+
lastConfig.LazyUpdateLocalReplicationOffset(clusterProvider.replicationManager.GetReplicationOffset(0));
169169
byteArray = lastConfig.ToByteArray();
170170
}
171171
else

libs/cluster/Server/Replication/CheckpointFileType.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,23 @@ enum CheckpointFileType : byte
1515
/// <summary>
1616
/// Store Hybrid LOG - Main
1717
/// </summary>
18-
STORE_HLOG,
18+
STORE_HLOG = 1,
1919
/// <summary>
2020
/// Store Hybrid LOG - Object
2121
/// </summary>
22-
STORE_HLOG_OBJ,
23-
/// <summary>
24-
/// Store Delta Log
25-
/// </summary>
26-
STORE_DLOG,
22+
STORE_HLOG_OBJ = 2,
23+
// Value 3 reserved (was STORE_DLOG, removed with incremental snapshots)
2724
/// <summary>
2825
/// Store Index
2926
/// </summary>
30-
STORE_INDEX,
27+
STORE_INDEX = 4,
3128
/// <summary>
3229
/// Store Snapshot - Main
3330
/// </summary>
34-
STORE_SNAPSHOT,
31+
STORE_SNAPSHOT = 5,
3532
/// <summary>
3633
/// Store Snapshot - Object
3734
/// </summary>
38-
STORE_SNAPSHOT_OBJ,
35+
STORE_SNAPSHOT_OBJ = 6,
3936
}
4037
}

libs/cluster/Server/Replication/CheckpointStore.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Garnet.common;
88
using Garnet.server;
99
using Microsoft.Extensions.Logging;
10-
using Tsavorite.core;
1110

1211
namespace Garnet.cluster
1312
{
@@ -278,23 +277,8 @@ void GetCheckpointCookieMetadata(StoreType storeType, Guid fileToken, ref AofAdd
278277
RecoveredReplicationId = null;
279278
if (fileToken == default) return;
280279
var ckptManager = clusterProvider.ReplicationLogCheckpointManager;
281-
var pageSizeBits = clusterProvider.serverOptions.PageSizeBits();
282280

283-
using (var deltaFileDevice = ckptManager.GetDeltaLogDevice(fileToken))
284-
{
285-
if (deltaFileDevice is not null)
286-
{
287-
deltaFileDevice.Initialize(-1);
288-
if (deltaFileDevice.GetFileSize(0) > 0)
289-
{
290-
var deltaLog = new DeltaLog(deltaFileDevice, pageSizeBits, -1);
291-
deltaLog.InitializeForReads();
292-
ckptManager.GetCheckpointCookieMetadata(fileToken, deltaLog, true, -1, ref recoveredSafeAofAddress, out RecoveredReplicationId);
293-
return;
294-
}
295-
}
296-
}
297-
ckptManager.GetCheckpointCookieMetadata(fileToken, null, false, -1, ref recoveredSafeAofAddress, out RecoveredReplicationId);
281+
ckptManager.GetCheckpointCookieMetadata(fileToken, ref recoveredSafeAofAddress, out RecoveredReplicationId);
298282
}
299283
}
300284

0 commit comments

Comments
 (0)