mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 09:55:45 +02:00
fix: disable inline transactions when db_slice has registered callbacks (#3391)
Inline transactions do not acquire any locks and therefore they should not preempt. This is no longer true when db_slice has registered callbacks. * disable inline transactions when db_slice has registered callbacks --------- Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
parent
a95cf2e857
commit
79d7f57b67
2 changed files with 6 additions and 1 deletions
|
@ -1420,8 +1420,9 @@ void Transaction::CancelBlocking(std::function<OpStatus(ArgSlice)> status_cb) {
|
|||
|
||||
bool Transaction::CanRunInlined() const {
|
||||
auto* ss = ServerState::tlocal();
|
||||
auto* es = EngineShard::tlocal();
|
||||
if (unique_shard_cnt_ == 1 && unique_shard_id_ == ss->thread_index() &&
|
||||
ss->AllowInlineScheduling()) {
|
||||
ss->AllowInlineScheduling() && !GetDbSlice(es->shard_id()).HasRegisteredCallbacks()) {
|
||||
ss->stats.tx_inline_runs++;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue