mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
feat: introduce 'debug tx' command and periodic overload logs (#2333)
This command shows the current state of transaction queues, specifically how many armed (ready to run) transactions there, how loaded these queue are and how many locks there are in each shard. In addition, if a tx queue becomes too long, we will output warning logs about the state of the queue, in order to be able to identify the bottlenecks post-factum. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
a360b308c9
commit
ce7497071c
6 changed files with 146 additions and 52 deletions
|
@ -922,12 +922,12 @@ bool DbSlice::Acquire(IntentLock::Mode mode, const KeyLockArgs& lock_args) {
|
|||
if (lock_args.args.size() == 1) {
|
||||
string_view key = KeyLockArgs::GetLockKey(lock_args.args.front());
|
||||
lock_acquired = lt[key].Acquire(mode);
|
||||
uniq_keys_ = {key};
|
||||
uniq_keys_ = {key}; // needed only for tests.
|
||||
} else {
|
||||
uniq_keys_.clear();
|
||||
|
||||
for (size_t i = 0; i < lock_args.args.size(); i += lock_args.key_step) {
|
||||
auto s = KeyLockArgs::GetLockKey(lock_args.args[i]);
|
||||
string_view s = KeyLockArgs::GetLockKey(lock_args.args[i]);
|
||||
if (uniq_keys_.insert(s).second) {
|
||||
bool res = lt[s].Acquire(mode);
|
||||
lock_acquired &= res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue