Before this change, we only allowed a single non-negative index or a wildcard inside brackets [].
For example, "$.foo[1]".
This PR extends the indexing expression to negative indices. It also builds up the foundation
to support [begin:end] slices, though this has not been implemented in this PR.
Finally, it adds more coverage to tests.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Done in preparation to make ShardArgs a smart iterable type,
but currently it's just a wrapper aroung ArgSlice.
Also refactored common.{h,cc} into tx_base.{h,cc}
In addition, fixed a bug in key tracking, where we wrongly created weak_ref
in a shard thread instead of doing this in the coordinator thread.
Finally, identified another bug (not fixed yet) where we track all the arguments
instead of tracking keys only.
Besides this, no functional changes around the moved code.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* change ACL DELUSER, ACL WHOAMI, and some ACL DRYRUN string/integer responses.
* change ACL GETUSER response, when the user does not exist, it should reply (nil).
This fixes compatibility issues with frameworks like Lettuce Java that expect exact words when parsing INFO response.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: get rid of lock keys
1. Introduce LockTag a type representing the part of the key that is used for locking.
2. Hash keys once in each transaction.
3. Expose swap_memory_bytes metric.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* helm templating and test cases for namespace support in prometheus rule crd
* updated prometheus rules
---------
Co-authored-by: Yash Jagdale <yash@databahn.ai>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
* chore: improve reply latency of SendScoredArray
Use SendStringArrInternal that reduces dramatically number of socket calls for long arrays.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
For high connection rate cases it can be significant.
In addition, refactor reply_builder so we could use SendStringArrInternal
for more cases like SendScoredArray that also has high latency overhead for replies.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: romange <romange@users.noreply.github.com>
The main change here is introduction of the strong type LockTag
that differentiates from a string_view key.
Also, some testing improvements to improve the footprint of the next PR.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* feat(server): Allow configuration of hashtag extraction
Before this PR: Hashtags, if enabled, meant the text between `{` and `}`
in the key (if exists and non-empty).
After this PR:
* Hashtags can _still_ be enabled / disabled
* Hashtag open / close char can be specified (and can be the same), like `:` popular with BullMQ
* Hashtag can include `N` closing tags to skip, like `{a}b}c}d` with `2` will return `a}b}c`.
This will allow some existing systems to migrate without code changes in
client code.