* feat(server): support multi eval in lock ahead mode
1. remove validation to allow multi eval only in global script mode
2. send error if there is a mode conflict when running eval inside multi
3. reset uniqe_keys_ when transaction finishes
If an empty buffer is passed to the socket Recv function - it returns error 103.
Even if we returned success, this would lead to the endless loop since the parser
requires more data to parse the load.
Fixes#1680
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Partially addresses #1730.
Beforehand we removed entries from mcflag only inside DbSlice::Del function
but we delete entries in other cases too (like expiration) and in this case we left
dangling entries in mcflag table. The fix adds the deletion of mcflag entries into PerformDeletion function.
It by itself does not explain the crash but
dangling entries cause UB (because the keys are references to non-existent PrimeKeys)
so maybe this somehow causes inconsistency where a key is not present in mcflags.
I am not sure I fixed the original issue but I surely fixed a corruption bug.
In addition, I removed the redundant check fail and added error logs to follow up on this later.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* Add a coverage workflow to dragonfly.
* Try and make the testing permissive
* Apply suggestions from code review
Signed-off-by: Roy Jacobson <roi.jacobson1@gmail.com>
* Remove redundant parts
---------
Signed-off-by: Roy Jacobson <roi.jacobson1@gmail.com>
1. Add acl categories to each command
2. Extend `facade::CommandId` to include acl category
3. Add dragonfly extensions to acl categories for modules like search, json etc (since modules in redis do not have acl categories by default but in dragonfly these are not implemented as modules)
Specifically add comparison operator that supports lex mode, score mode
and infinity abstractions for both modes.
Also, introduce LEQ/GEQ range queries for bptree_set.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: several improvements around sorted map
1. Pass memory_resource to sorted_map.
2. Get rid of GetDict leaky accessor in SortedMap and introduce a proper
Scan method.
3. Introduce correct BPTree type inside SortedMap::DFImpl.
4. Added a test for bptree_test that covers sds comparison
(apparently, sdscmp can return values outside of [-1, 1] range).
Fixed bptree code to support a proper spec for three-way comparison.
5. Expose pointers to internal objects allocated by score_map so we could insert them
into bptree.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: fix comments
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* Enable configuring service type LoadBalancer IP
Signed-off-by: David Mutia <davidmutia47@gmail.com>
* Add tests for loadBalancerIP
Signed-off-by: David Mutia <davidmutia47@gmail.com>
* chore: get rid of cmdstats_map (#1687)
cmdstats_map were on the hotpath and are needed only to update the command stats.
Instead, I introduced the stats withing the CommandId itself that we lookup anyways.
Also, it removes fragile dependency on naked command name char* pointers.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
---------
Signed-off-by: David Mutia <davidmutia47@gmail.com>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
cmdstats_map were on the hotpath and are needed only to update the command stats.
Instead, I introduced the stats withing the CommandId itself that we lookup anyways.
Also, it removes fragile dependency on naked command name char* pointers.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>