mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
feat(server): Add --lock_on_hashtags
mode. (#1611)
* feat(server): Add `--lock_on_hashtags` mode. This new mode effectively locks hashtags (i.e. strings within {curly braces}) instead of the full keys being used. This can allow scripts to access undeclared keys if they all use a common hashtag, like for the case of BullMQ. To make sure this mode is tested, I added a way to specify flags via env variables, and modified `ci.yml` to run all tests using this mode as well. While at it, I also added `--cluster_mode=emulated` mode to CI.
This commit is contained in:
parent
8040bed10f
commit
67a4c4e6cb
13 changed files with 229 additions and 31 deletions
|
@ -50,6 +50,11 @@ class Transaction;
|
|||
class EngineShard;
|
||||
|
||||
struct KeyLockArgs {
|
||||
static bool IsLockHashTagEnabled();
|
||||
|
||||
// Before acquiring and releasing keys, one must "normalize" them via GetLockKey().
|
||||
static std::string_view GetLockKey(std::string_view key);
|
||||
|
||||
DbIndex db_index = 0;
|
||||
ArgSlice args;
|
||||
unsigned key_step = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue