chore: LockTable tracks fingerprints of keys (#2839)

* chore: LockTable tracks fingerprints of keys

It's a first step that will probably simplify dependencies in many places
where we need to keep key strings for that. A second step will be to reduce the CPU load
of multi-key operations like MSET and precompute Fingerprints once.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-04-10 17:52:53 +03:00 committed by GitHub
parent 56a7f85e39
commit da5c51d1dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 59 additions and 57 deletions

View file

@ -8,6 +8,7 @@
#include "core/string_or_view.h"
#include "facade/dragonfly_connection.h"
#include "facade/op_status.h"
#include "server/cluster/slot_set.h"
#include "server/common.h"
#include "server/conn_context.h"
#include "server/table.h"
@ -367,9 +368,6 @@ class DbSlice {
// Returns true if the key can be locked under m. Does not lock.
bool CheckLock(IntentLock::Mode m, DbIndex dbid, std::string_view key) const;
// Returns true if all keys can be locked under m. Does not lock.
bool CheckLock(IntentLock::Mode m, const KeyLockArgs& lock_args) const;
size_t db_array_size() const {
return db_arr_.size();
}