diff --git a/crates/index-scheduler/src/queue/tasks.rs b/crates/index-scheduler/src/queue/tasks.rs index bb6930b4b..c88192e17 100644 --- a/crates/index-scheduler/src/queue/tasks.rs +++ b/crates/index-scheduler/src/queue/tasks.rs @@ -94,6 +94,10 @@ impl TaskQueue { debug_assert!(old_task != *task); debug_assert_eq!(old_task.uid, task.uid); debug_assert!(old_task.batch_uid.is_none() && task.batch_uid.is_some()); + debug_assert!( + old_task.batch_uid.is_none() && task.batch_uid.is_some(), + "\n==> old: {old_task:?}\n==> new: {task:?}" + ); if old_task.status != task.status { self.update_status(wtxn, old_task.status, |bitmap| { diff --git a/crates/index-scheduler/src/scheduler/process_index_operation.rs b/crates/index-scheduler/src/scheduler/process_index_operation.rs index 365f7acd4..eff3740a0 100644 --- a/crates/index-scheduler/src/scheduler/process_index_operation.rs +++ b/crates/index-scheduler/src/scheduler/process_index_operation.rs @@ -78,9 +78,7 @@ impl IndexScheduler { if let DocumentOperation::Add(content_uuid) = operation { let content_file = self.queue.file_store.get_update(*content_uuid)?; let mmap = unsafe { memmap2::Mmap::map(&content_file)? }; - if !mmap.is_empty() { - content_files.push(mmap); - } + content_files.push(mmap); } } diff --git a/crates/meilisearch/tests/documents/add_documents.rs b/crates/meilisearch/tests/documents/add_documents.rs index d164d9a27..6c9222717 100644 --- a/crates/meilisearch/tests/documents/add_documents.rs +++ b/crates/meilisearch/tests/documents/add_documents.rs @@ -1225,7 +1225,25 @@ async fn add_no_documents() { snapshot!(code, @"202 Accepted"); let task = server.wait_task(task.uid()).await; let task = task.succeeded(); - snapshot!(task, @""); + snapshot!(task, @r#" + { + "uid": "[uid]", + "batchUid": "[batch_uid]", + "indexUid": "kefir", + "status": "succeeded", + "type": "documentAdditionOrUpdate", + "canceledBy": null, + "details": { + "receivedDocuments": 0, + "indexedDocuments": 0 + }, + "error": null, + "duration": "[duration]", + "enqueuedAt": "[date]", + "startedAt": "[date]", + "finishedAt": "[date]" + } + "#); } #[actix_rt::test]