mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-18 17:11:15 +08:00
fix the corruption
This commit is contained in:
parent
234d0c360f
commit
445e5aff02
@ -191,6 +191,11 @@ impl IndexMapper {
|
||||
self.index_base_map_size,
|
||||
)
|
||||
.map_err(|e| Error::from_milli(e, Some(uuid.to_string())))?;
|
||||
let index_rtxn = index.read_txn()?;
|
||||
let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)
|
||||
.map_err(|e| Error::from_milli(e, Some(name.to_string())))?;
|
||||
self.store_stats_of(&mut wtxn, name, &stats)?;
|
||||
drop(index_rtxn);
|
||||
|
||||
wtxn.commit()?;
|
||||
|
||||
|
@ -897,7 +897,25 @@ fn create_and_list_index() {
|
||||
// but the indexUpdate task has not been processed yet
|
||||
handle.advance_till([InsideProcessBatch]);
|
||||
|
||||
index_scheduler.index("kefir").unwrap(); // Crash on corrupted task queue
|
||||
let empty = index_scheduler.get_paginated_indexes_stats(&AuthFilter::default(), 0, 20).unwrap();
|
||||
snapshot!(format!("{empty:?}"), @"");
|
||||
index_scheduler.index("kefir").unwrap();
|
||||
let list = index_scheduler.get_paginated_indexes_stats(&AuthFilter::default(), 0, 20).unwrap();
|
||||
snapshot!(json_string!(list, { "[1][0][1].created_at" => "[date]", "[1][0][1].updated_at" => "[date]" }), @r#"
|
||||
[
|
||||
1,
|
||||
[
|
||||
[
|
||||
"kefir",
|
||||
{
|
||||
"number_of_documents": 0,
|
||||
"database_size": 24576,
|
||||
"used_database_size": 8192,
|
||||
"primary_key": null,
|
||||
"field_distribution": {},
|
||||
"created_at": "[date]",
|
||||
"updated_at": "[date]"
|
||||
}
|
||||
]
|
||||
]
|
||||
]
|
||||
"#);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user