mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
fix(rdb): Remove transaction from pre/post load search index rebuild (#2419)
This commit is contained in:
parent
de817098a7
commit
1fb3c74933
3 changed files with 3 additions and 24 deletions
|
@ -2495,10 +2495,9 @@ void RdbLoader::PerformPreLoad(Service* service) {
|
|||
if (cmd == nullptr)
|
||||
return; // MacOS
|
||||
|
||||
Transaction::RunOnceAsCommand(cmd, [](auto* trans, auto* es) {
|
||||
shard_set->AwaitRunningOnShardQueue([](EngineShard* es) {
|
||||
for (const auto& name : es->search_indices()->GetIndexNames())
|
||||
es->search_indices()->DropIndex(name);
|
||||
return OpStatus::OK;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2508,9 +2507,8 @@ void RdbLoader::PerformPostLoad(Service* service) {
|
|||
return;
|
||||
|
||||
// Rebuild all search indices as only their definitions are extracted from the snapshot
|
||||
Transaction::RunOnceAsCommand(cmd, [](auto* trans, auto* es) {
|
||||
es->search_indices()->RebuildAllIndices(trans->GetOpArgs(es));
|
||||
return OpStatus::OK;
|
||||
shard_set->AwaitRunningOnShardQueue([](EngineShard* es) {
|
||||
es->search_indices()->RebuildAllIndices(OpArgs{es, nullptr, DbContext{0, GetCurrentTimeMs()}});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue