fix: unblock transactions only if requirements are correct (#2345)

fixes #2294

bug: we unblock XREADGROUP cmd even if we don't have new values

fix: added check with custom requirements for blocking comands
This commit is contained in:
Borys 2024-01-02 14:55:06 +02:00 committed by GitHub
parent 03f69ff6c3
commit 5b905452b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 110 additions and 56 deletions

View file

@ -39,7 +39,7 @@ class BlockingController {
// TODO: consider moving all watched functions to
// EngineShard with separate per db map.
//! AddWatched adds a transaction to the blocking queue.
void AddWatched(ArgSlice watch_keys, Transaction* me);
void AddWatched(ArgSlice watch_keys, KeyReadyChecker krc, Transaction* me);
// Called from operations that create keys like lpush, rename etc.
void AwakeWatched(DbIndex db_index, std::string_view db_key);
@ -54,7 +54,7 @@ class BlockingController {
using WatchQueueMap = absl::flat_hash_map<std::string, std::unique_ptr<WatchQueue>>;
void NotifyWatchQueue(std::string_view key, WatchQueueMap* wqm);
void NotifyWatchQueue(std::string_view key, WatchQueueMap* wqm, const DbContext& context);
// void NotifyConvergence(Transaction* tx);