chore: get rid of lock keys (#2894)

* 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>
This commit is contained in:
Roman Gershman 2024-04-21 11:34:42 +03:00 committed by GitHub
parent 9b9c32c91d
commit 2ff7ff9841
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 136 additions and 133 deletions

View file

@ -69,8 +69,7 @@ struct LockTagOptions {
struct KeyLockArgs {
DbIndex db_index = 0;
ArgSlice args;
unsigned key_step = 1;
absl::Span<const LockFp> fps;
};
// Describes key indices.
@ -118,7 +117,7 @@ struct OpArgs {
}
};
// A strong type for a lock tag. Helps to disambiguide between keys and the parts of the
// A strong type for a lock tag. Helps to disambiguate between keys and the parts of the
// keys that are used for locking.
class LockTag {
std::string_view str_;