feat(server): refactor allow preempt on journal record (#4393)

* feat server: refactor allow preempt on journal record

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2025-01-02 12:16:21 +02:00 committed by GitHub
parent 7a68528022
commit a3ef239ac7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 152 additions and 122 deletions

View file

@ -1474,15 +1474,15 @@ void Transaction::LogAutoJournalOnShard(EngineShard* shard, RunnableResult resul
}
// Record to journal autojournal commands, here we allow await which anables writing to sync
// the journal change.
LogJournalOnShard(shard, std::move(entry_payload), unique_shard_cnt_, true);
LogJournalOnShard(shard, std::move(entry_payload), unique_shard_cnt_);
}
void Transaction::LogJournalOnShard(EngineShard* shard, journal::Entry::Payload&& payload,
uint32_t shard_cnt, bool allow_await) const {
uint32_t shard_cnt) const {
auto journal = shard->journal();
CHECK(journal);
journal->RecordEntry(txid_, journal::Op::COMMAND, db_index_, shard_cnt,
unique_slot_checker_.GetUniqueSlotId(), std::move(payload), allow_await);
unique_slot_checker_.GetUniqueSlotId(), std::move(payload));
}
void Transaction::ReviveAutoJournal() {