Merge pull request #5229 from meilisearch/improve-unknown-entry-deletion-report

Improve the panic message when deleting an unknown entry
This commit is contained in:
Clément Renault 2025-01-13 14:20:24 +01:00 committed by GitHub
commit aee74f47aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ use std::sync::{OnceLock, RwLock};
use std::thread::{self, Builder}; use std::thread::{self, Builder};
use big_s::S; use big_s::S;
use bstr::ByteSlice as _;
use bumparaw_collections::RawMap; use bumparaw_collections::RawMap;
use document_changes::{extract, DocumentChanges, IndexingContext}; use document_changes::{extract, DocumentChanges, IndexingContext};
pub use document_deletion::DocumentDeletion; pub use document_deletion::DocumentDeletion;
@ -583,7 +584,10 @@ fn write_from_bbqueue(
} }
(key, None) => match database.delete(wtxn, key) { (key, None) => match database.delete(wtxn, key) {
Ok(false) => { Ok(false) => {
unreachable!("We tried to delete an unknown key: {key:?}") unreachable!(
"We tried to delete an unknown key from {database_name}: {:?}",
key.as_bstr()
)
} }
Ok(_) => (), Ok(_) => (),
Err(error) => { Err(error) => {