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

@ -359,6 +359,10 @@ inline uint32_t MemberTimeSeconds(uint64_t now_ms) {
return (now_ms / 1000) - kMemberExpiryBase;
}
// Checks whether the touched key is valid for a blocking transaction watching it
using KeyReadyChecker =
std::function<bool(EngineShard*, const DbContext& context, Transaction* tx, std::string_view)>;
struct MemoryBytesFlag {
uint64_t value = 0;
};