-
Notifications
You must be signed in to change notification settings - Fork 610
Closed
Description
Describe the bug
With SERedis, StringAppend
fails over expired key in the described test case.
Steps to reproduce the bug
[Test]
public void SetExpiryThenExpireAndAppend()
{
using var redis = ConnectionMultiplexer.Connect(TestUtils.GetConfig());
var db = redis.GetDatabase(0);
var key = "user:string1";
string value1 = "a";
string value2 = "ab";
var ttl = TimeSpan.FromMilliseconds(100);
var ok = db.StringSet(key, value1, ttl);
ClassicAssert.IsTrue(ok);
Thread.Sleep(ttl * 2);
var len = db.StringAppend(key, value2);
ClassicAssert.IsTrue(len == 2);
}
This test fails in libs\server\Storage\Functions\MainStore\RMWMethods.cs
Expected behavior
The test passes and the result string length is 2 (string "ab").
Release version
1.0.53
IDE
Microsoft Visual Studio Community 2022 (64-bit) - Version 17.12.4
OS version
Windows 11
Additional context
Log records on described issues look like
(one record split into several lines)
08::33::58 crit: Session[0] [127.0.0.1:54048] [038F25B1] ProcessMessages threw an exception:
System.ArgumentException: Destination is too short. (Parameter 'destination')
at Garnet.server.MainSessionFunctions.InitialUpdater(SpanByte& key, RawStringInput& input, SpanByte& value, SpanByteAndMemory& output, RMWInfo& rmwInfo, RecordInfo& recordInfo) in /_/libs/server/Storage/Functions/MainStore/RMWMethods.cs:line 66
at Tsavorite.core.TsavoriteKV`4.ReinitializeExpiredRecord[TInput,TOutput,TContext,TSessionFunctionsWrapper](TKey& key, TInput& input, TValue& value, TOutput& output, RecordInfo& recordInfo, RMWInfo& rmwInfo, Int64 logicalAddress, TSessionFunctionsWrapper sessionFunctions, Boolean isIpu, OperationStatus& status) in /_/libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:line 594
at Garnet.server.StorageSession.APPEND[TContext](SpanByte& key, RawStringInput& input, SpanByteAndMemory& output, TContext& context) in /_/libs/server/Storage/Session/MainStore/MainStoreOps.cs:line 480
at Garnet.server.GarnetApi`2.APPEND(SpanByte& key, RawStringInput& input, SpanByteAndMemory& output) in /_/libs/server/API/GarnetApi.cs:line 173
at Garnet.server.RespServerSession.NetworkAppend[TGarnetApi](TGarnetApi& storageApi) in /_/libs/server/Resp/BasicCommands.cs:line 811
at Garnet.server.RespServerSession.ProcessMessages() in /_/libs/server/Resp/RespServerSession.cs:line 461
at Garnet.server.RespServerSession.TryConsumeMessages(Byte* reqBuffer, Int32 bytesReceived) in /_/libs/server/Resp/RespServerSession.cs:line 321
Metadata
Metadata
Assignees
Labels
No labels