Skip to content

Commit 309b186

Browse files
committed
fix(server): Don't inline schedule when in LOADING
1 parent 98519bf commit 309b186

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/server/transaction.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,12 @@ OpStatus Transaction::ScheduleSingleHop(RunnableType cb) {
689689
}
690690
};
691691

692-
if (coordinator_index_ == unique_shard_id_) {
692+
// We can't allow inline scheduling during a full sync, because then journaling transactions
693+
// will be scheduled before RdbLoader::LoadItemsBuffer is finished. We can't use the regular
694+
// locking mechanism because RdbLoader is not using transactions.
695+
if (coordinator_index_ == unique_shard_id_ &&
696+
ServerState::tlocal()->gstate() != GlobalState::LOADING) {
697+
DVLOG(2) << "Inline scheduling a transaction";
693698
schedule_cb();
694699
} else {
695700
shard_set->Add(unique_shard_id_, std::move(schedule_cb)); // serves as a barrier.

0 commit comments

Comments
 (0)