diff --git a/src/storage/v2/durability/durability.cpp b/src/storage/v2/durability/durability.cpp index a3cf0e2bb..decbfd14a 100644 --- a/src/storage/v2/durability/durability.cpp +++ b/src/storage/v2/durability/durability.cpp @@ -397,7 +397,12 @@ std::optional RecoverData(const std::filesystem::path &snapshot_di spdlog::info("All necessary WAL files are loaded successfully."); } - RecoverIndicesAndConstraints(indices_constraints, indices, constraints, vertices); + const auto par_exec_info = + config.durability.allow_parallel_index_creation && !recovery_info.vertex_batches.empty() + ? std::make_optional(std::make_pair(recovery_info.vertex_batches, config.durability.recovery_thread_count)) + : std::nullopt; + + RecoverIndicesAndConstraints(indices_constraints, indices, constraints, vertices, par_exec_info); memgraph::metrics::Measure(memgraph::metrics::SnapshotRecoveryLatency_us, std::chrono::duration_cast(timer.Elapsed()).count());