mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
write a test ensuring the index-scheduler is effectively down when the upgrade task fail and try to process it when it restarts. There is a bug when deleting this task
This commit is contained in:
parent
20ac59c946
commit
5458850d21
11 changed files with 550 additions and 17 deletions
|
@ -9,6 +9,9 @@ impl IndexScheduler {
|
|||
pub(super) fn process_upgrade(&self, progress: Progress) -> Result<()> {
|
||||
progress.update_progress(UpgradeDatabaseProgress::EnsuringCorrectnessOfTheSwap);
|
||||
|
||||
#[cfg(test)]
|
||||
self.maybe_fail(crate::test_utils::FailureLocation::ProcessUpgrade)?;
|
||||
|
||||
enum UpgradeIndex {}
|
||||
let indexes = self.index_names()?;
|
||||
|
||||
|
@ -20,9 +23,9 @@ impl IndexScheduler {
|
|||
));
|
||||
let index = self.index(uid)?;
|
||||
let mut wtxn = index.write_txn()?;
|
||||
let regenerate = milli::update::upgrade::upgrade(&mut wtxn, &index, progress.clone())
|
||||
let regen_stats = milli::update::upgrade::upgrade(&mut wtxn, &index, progress.clone())
|
||||
.map_err(|e| Error::from_milli(e, Some(uid.to_string())))?;
|
||||
if regenerate {
|
||||
if regen_stats {
|
||||
let stats = crate::index_mapper::IndexStats::new(&index, &wtxn)
|
||||
.map_err(|e| Error::from_milli(e, Some(uid.to_string())))?;
|
||||
// Release wtxn as soon as possible because it stops us from registering tasks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue