Skip to content

Commit

Permalink
fix: merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dranikpg committed Mar 7, 2024
1 parent 9867c35 commit 7a77db2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/server/main_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2103,10 +2103,8 @@ void Service::Exec(CmdArgList args, ConnectionContext* cntx) {
}
}

if (scheduled) {
VLOG(1) << "Exec unlocking " << exec_info.body.size() << " commands";
if (is_transactional)
cntx->transaction->UnlockMulti();
}

cntx->cid = exec_cid_;
VLOG(1) << "Exec completed";
Expand Down
13 changes: 4 additions & 9 deletions src/server/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Transaction::Transaction(const CommandId* cid) : cid_{cid} {
}
}

Transaction::Transaction(const Transaction* parent, ShardId shard_id)
Transaction::Transaction(const Transaction* parent, ShardId shard_id, std::optional<SlotId> slot_id)
: multi_{make_unique<MultiData>()},
txid_{parent->txid()},
unique_shard_cnt_{1},
Expand All @@ -194,9 +194,9 @@ Transaction::Transaction(const Transaction* parent, ShardId shard_id)
multi_->shard_journal_write.resize(1);

MultiUpdateWithParent(parent);
if (slot_id.has_value()) {
unique_slot_checker_.Add(*slot_id);
}
// if (slot_id.has_value()) {
// unique_slot_checker_.Add(*slot_id);
// }
}

Transaction::~Transaction() {
Expand Down Expand Up @@ -447,10 +447,6 @@ void Transaction::PrepareSquashedMultiHop(const CommandId* cid,
DCHECK(cid->IsMultiTransactional());

MultiSwitchCmd(cid);
<<<<<<< HEAD

=======
>>>>>>> 3228c044 (feat(treansaction): Use single hop in squashing when possible)
InitBase(db_index_, {});

// Because squashing already determines active shards by partitioning commands,
Expand Down Expand Up @@ -928,7 +924,6 @@ void Transaction::Schedule() {

if ((coordinator_state_ & COORD_SCHED) == 0)
ScheduleInternal();
}
}

// Runs in coordinator thread.
Expand Down
5 changes: 1 addition & 4 deletions src/server/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class Transaction {
explicit Transaction(const CommandId* cid);

// Initialize transaction for squashing placed on a specific shard with a given parent tx
explicit Transaction(const Transaction* parent, ShardId shard_id);
explicit Transaction(const Transaction* parent, ShardId shard_id, std::optional<SlotId> slot = std::nullopt);

// Initialize from command (args) on specific db.
OpStatus InitByArgs(DbIndex index, CmdArgList args);
Expand Down Expand Up @@ -339,9 +339,6 @@ class Transaction {
// to it must not block.
void PrepareMultiForScheduleSingleHop(ShardId sid, DbIndex db, CmdArgList args);

// Mark as squasher. Transaction must be already properly initialized.
void MultiBecomeSquasher();

// Write a journal entry to a shard journal with the given payload. When logging a non-automatic
// journal command, multiple journal entries may be necessary. In this case, call with set
// multi_commands to true and call the FinishLogJournalOnShard function after logging the final
Expand Down

0 comments on commit 7a77db2

Please sign in to comment.