opt(server): Execute lua on target shard, if it's 1 (#1639)

* opt(server): Execute lua on target shard, if it's 1

This will save hops by short-circuiting execution of commands.

* Reuse unique shard id from tx
Only switch threads for LOCK_AHEAD

* Signedness
This commit is contained in:
Shahar Mike 2023-08-09 14:18:34 +03:00 committed by GitHub
parent 6d84515e08
commit 734401098c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

View file

@ -946,6 +946,11 @@ string_view Transaction::Name() const {
return cid_->name();
}
ShardId Transaction::GetUniqueShard() const {
DCHECK_EQ(GetUniqueShardCnt(), 1U);
return unique_shard_id_;
}
KeyLockArgs Transaction::GetLockArgs(ShardId sid) const {
KeyLockArgs res;
res.db_index = db_index_;