mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-07 19:36:26 +08:00
While spamming the batches route we could see a processing batch becoming missing and then finished, this commit ensures the batches goes from processing to finished directly
This commit is contained in:
parent
8d33af1dff
commit
a439fa3e1a
@ -1738,11 +1738,8 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.processing_tasks.write().unwrap().stop_processing();
|
|
||||||
// We must re-add the canceled task so they're part of the same batch.
|
// We must re-add the canceled task so they're part of the same batch.
|
||||||
// processed.processing |= canceled;
|
|
||||||
ids |= canceled;
|
ids |= canceled;
|
||||||
|
|
||||||
self.write_batch(&mut wtxn, processing_batch, &ids)?;
|
self.write_batch(&mut wtxn, processing_batch, &ids)?;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -1750,8 +1747,12 @@ impl IndexScheduler {
|
|||||||
|
|
||||||
wtxn.commit().map_err(Error::HeedTransaction)?;
|
wtxn.commit().map_err(Error::HeedTransaction)?;
|
||||||
|
|
||||||
|
// We should stop processing AFTER everything is processed and written to disk otherwise, a batch (which only lives in RAM) may appear in the processing task
|
||||||
|
// and then become « not found » for some time until the commit everything is written and the final commit is made.
|
||||||
|
self.processing_tasks.write().unwrap().stop_processing();
|
||||||
|
|
||||||
// Once the tasks are committed, we should delete all the update files associated ASAP to avoid leaking files in case of a restart
|
// Once the tasks are committed, we should delete all the update files associated ASAP to avoid leaking files in case of a restart
|
||||||
tracing::debug!("Deleting the update files");
|
// tracing::debug!("Deleting the update files");
|
||||||
|
|
||||||
//We take one read transaction **per thread**. Then, every thread is going to pull out new IDs from the roaring bitmap with the help of an atomic shared index into the bitmap
|
//We take one read transaction **per thread**. Then, every thread is going to pull out new IDs from the roaring bitmap with the help of an atomic shared index into the bitmap
|
||||||
let idx = AtomicU32::new(0);
|
let idx = AtomicU32::new(0);
|
||||||
|
@ -224,7 +224,7 @@ async fn list_batches_status_and_type_filtered() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn get_batch_filter_error() {
|
async fn list_batch_filter_error() {
|
||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
|
|
||||||
let (response, code) = server.batches_filter("lol=pied").await;
|
let (response, code) = server.batches_filter("lol=pied").await;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user