You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoking SADD over existing string key unexpectedly works without errors and
seemingly results in two duplicated keys. Then invoking RPUSH operation over
the same key results in GarnetServer Assert and cryptic SERedis client errors.
Use the below code or the attached console app project: GarnetIssue5.zip
usingStackExchange.Redis;usingSystem;usingSystem.Linq;usingvarredis=ConnectionMultiplexer.Connect("127.0.0.1:3278,syncTimeout=600000");varserver=redis.GetServers()[0];vardb=redis.GetDatabase();conststringkey="test:1";// do StringSetdb.StringSet(key,"v1");// do SetAdd using the same key// expected: An error is returned when the value stored at key is not a set. https://redis.io/docs/latest/commands/sadd/// result: No error and the result is True ~ successvarres1=db.SetAdd(key,"v2");Console.WriteLine(res1);// True// two keys "test:1"varkeys=server.Keys(db.Database,key).ToList();Console.WriteLine(keys.Count);// 2foreach(varkinkeys)// two "test:1"Console.WriteLine(k);// do ListRightPush using the same key// expected: When key holds a value that is not a list, an error is returned. https://redis.io/docs/latest/commands/rpush/// result: Assert in GarnetServer, cryptic errors in SERedis clientdb.ListRightPush(key,"v3");
Garnet uses two stores internally: a main store to hold raw strings and an object store to hold objects. Thus it's not unexpected to allow the same key in both stores. Changing this will require us to check both stores every time, which is too expensive. We are working on unifying the two indexes but that's not ready yet.
However, we still need to see why the subsequent ListRightPush behaved in an unexpected manner.
Describe the bug
Invoking SADD over existing string key unexpectedly works without errors and
seemingly results in two duplicated keys. Then invoking RPUSH operation over
the same key results in GarnetServer Assert and cryptic SERedis client errors.
GarnetServer Assert:
garnet/libs/server/Objects/Set/SetObject.cs
Line 111 in 2dc2c73
Steps to reproduce the bug
Use the below code or the attached console app project:
GarnetIssue5.zip
Output: unexpected "True", two duplicated keys "test:1", cryptic SERedis client error
Expected behavior
Additional context
The text was updated successfully, but these errors were encountered: