chore(server): pass coordinator thread to a transaction object (#905)

This should help with some of the optimizations we may do in the future.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2023-03-03 14:40:29 +02:00 committed by GitHub
parent c9e9311c8e
commit 8cf8115116
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 11 deletions

View file

@ -41,7 +41,8 @@ IntentLock::Mode Transaction::Mode() const {
* @param ess
* @param cs
*/
Transaction::Transaction(const CommandId* cid) : cid_{cid} {
Transaction::Transaction(const CommandId* cid, uint32_t thread_index)
: cid_{cid}, coordinator_index_(thread_index) {
string_view cmd_name(cid_->name());
if (cmd_name == "EXEC" || cmd_name == "EVAL" || cmd_name == "EVALSHA") {
multi_.reset(new MultiData);