mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix(search): Fix replication (#2159)
* fix(search): Support replication Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io> --------- Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
parent
cc064a2582
commit
46292968ad
15 changed files with 178 additions and 68 deletions
|
@ -1409,6 +1409,22 @@ void Transaction::FinishLogJournalOnShard(EngineShard* shard, uint32_t shard_cnt
|
|||
journal->RecordEntry(txid_, journal::Op::EXEC, db_index_, shard_cnt, {}, false);
|
||||
}
|
||||
|
||||
void Transaction::RunOnceAsCommand(const CommandId* cid, RunnableType cb) {
|
||||
if (!ProactorBase::IsProactorThread())
|
||||
return shard_set->pool()->at(0)->Await([cid, cb] { return RunOnceAsCommand(cid, cb); });
|
||||
|
||||
DCHECK(cid);
|
||||
DCHECK(cid->opt_mask() & (CO::GLOBAL_TRANS | CO::NO_KEY_TRANSACTIONAL));
|
||||
DCHECK(ProactorBase::IsProactorThread());
|
||||
|
||||
boost::intrusive_ptr<Transaction> trans{new Transaction{cid}};
|
||||
trans->InitByArgs(0, {});
|
||||
trans->ScheduleSingleHop([cb](auto* trans, auto* es) {
|
||||
cb(trans, es);
|
||||
return OpStatus::OK;
|
||||
});
|
||||
}
|
||||
|
||||
void Transaction::CancelBlocking() {
|
||||
if (coordinator_state_ & COORD_BLOCKED) {
|
||||
coordinator_state_ |= COORD_CANCELLED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue