mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-03-19 06:08:20 +01:00
Add more progress levels to measure merging
This commit is contained in:
parent
2500e3c067
commit
cb16baab18
@ -193,6 +193,16 @@ macro_rules! make_atomic_progress {
|
|||||||
make_atomic_progress!(Document alias AtomicDocumentStep => "document");
|
make_atomic_progress!(Document alias AtomicDocumentStep => "document");
|
||||||
make_atomic_progress!(Payload alias AtomicPayloadStep => "payload");
|
make_atomic_progress!(Payload alias AtomicPayloadStep => "payload");
|
||||||
|
|
||||||
|
make_enum_progress! {
|
||||||
|
pub enum MergingWordCache {
|
||||||
|
WordDocids,
|
||||||
|
WordFieldIdDocids,
|
||||||
|
ExactWordDocids,
|
||||||
|
WordPositionDocids,
|
||||||
|
FieldIdWordCountDocids,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone, ToSchema)]
|
#[derive(Debug, Serialize, Clone, ToSchema)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
#[schema(rename_all = "camelCase")]
|
#[schema(rename_all = "camelCase")]
|
||||||
|
@ -13,6 +13,7 @@ use super::super::thread_local::{FullySend, ThreadLocal};
|
|||||||
use super::super::FacetFieldIdsDelta;
|
use super::super::FacetFieldIdsDelta;
|
||||||
use super::document_changes::{extract, DocumentChanges, IndexingContext};
|
use super::document_changes::{extract, DocumentChanges, IndexingContext};
|
||||||
use crate::index::IndexEmbeddingConfig;
|
use crate::index::IndexEmbeddingConfig;
|
||||||
|
use crate::progress::MergingWordCache;
|
||||||
use crate::proximity::ProximityPrecision;
|
use crate::proximity::ProximityPrecision;
|
||||||
use crate::update::new::extract::EmbeddingExtractor;
|
use crate::update::new::extract::EmbeddingExtractor;
|
||||||
use crate::update::new::merger::merge_and_send_rtree;
|
use crate::update::new::merger::merge_and_send_rtree;
|
||||||
@ -96,6 +97,7 @@ where
|
|||||||
{
|
{
|
||||||
let span = tracing::trace_span!(target: "indexing::documents::merge", parent: &indexer_span, "faceted");
|
let span = tracing::trace_span!(target: "indexing::documents::merge", parent: &indexer_span, "faceted");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(IndexingStep::MergingFacetCaches);
|
||||||
|
|
||||||
facet_field_ids_delta = merge_and_send_facet_docids(
|
facet_field_ids_delta = merge_and_send_facet_docids(
|
||||||
caches,
|
caches,
|
||||||
@ -117,7 +119,6 @@ where
|
|||||||
} = {
|
} = {
|
||||||
let span = tracing::trace_span!(target: "indexing::documents::extract", "word_docids");
|
let span = tracing::trace_span!(target: "indexing::documents::extract", "word_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
|
||||||
WordDocidsExtractors::run_extraction(
|
WordDocidsExtractors::run_extraction(
|
||||||
document_changes,
|
document_changes,
|
||||||
indexing_context,
|
indexing_context,
|
||||||
@ -126,9 +127,13 @@ where
|
|||||||
)?
|
)?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
indexing_context.progress.update_progress(IndexingStep::MergingWordCaches);
|
||||||
|
|
||||||
{
|
{
|
||||||
let span = tracing::trace_span!(target: "indexing::documents::merge", "word_docids");
|
let span = tracing::trace_span!(target: "indexing::documents::merge", "word_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(MergingWordCache::WordDocids);
|
||||||
|
|
||||||
merge_and_send_docids(
|
merge_and_send_docids(
|
||||||
word_docids,
|
word_docids,
|
||||||
index.word_docids.remap_types(),
|
index.word_docids.remap_types(),
|
||||||
@ -142,6 +147,8 @@ where
|
|||||||
let span =
|
let span =
|
||||||
tracing::trace_span!(target: "indexing::documents::merge", "word_fid_docids");
|
tracing::trace_span!(target: "indexing::documents::merge", "word_fid_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(MergingWordCache::WordFieldIdDocids);
|
||||||
|
|
||||||
merge_and_send_docids(
|
merge_and_send_docids(
|
||||||
word_fid_docids,
|
word_fid_docids,
|
||||||
index.word_fid_docids.remap_types(),
|
index.word_fid_docids.remap_types(),
|
||||||
@ -155,6 +162,8 @@ where
|
|||||||
let span =
|
let span =
|
||||||
tracing::trace_span!(target: "indexing::documents::merge", "exact_word_docids");
|
tracing::trace_span!(target: "indexing::documents::merge", "exact_word_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(MergingWordCache::ExactWordDocids);
|
||||||
|
|
||||||
merge_and_send_docids(
|
merge_and_send_docids(
|
||||||
exact_word_docids,
|
exact_word_docids,
|
||||||
index.exact_word_docids.remap_types(),
|
index.exact_word_docids.remap_types(),
|
||||||
@ -168,6 +177,8 @@ where
|
|||||||
let span =
|
let span =
|
||||||
tracing::trace_span!(target: "indexing::documents::merge", "word_position_docids");
|
tracing::trace_span!(target: "indexing::documents::merge", "word_position_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(MergingWordCache::WordPositionDocids);
|
||||||
|
|
||||||
merge_and_send_docids(
|
merge_and_send_docids(
|
||||||
word_position_docids,
|
word_position_docids,
|
||||||
index.word_position_docids.remap_types(),
|
index.word_position_docids.remap_types(),
|
||||||
@ -181,6 +192,8 @@ where
|
|||||||
let span =
|
let span =
|
||||||
tracing::trace_span!(target: "indexing::documents::merge", "fid_word_count_docids");
|
tracing::trace_span!(target: "indexing::documents::merge", "fid_word_count_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(MergingWordCache::FieldIdWordCountDocids);
|
||||||
|
|
||||||
merge_and_send_docids(
|
merge_and_send_docids(
|
||||||
fid_word_count_docids,
|
fid_word_count_docids,
|
||||||
index.field_id_word_count_docids.remap_types(),
|
index.field_id_word_count_docids.remap_types(),
|
||||||
@ -210,6 +223,7 @@ where
|
|||||||
{
|
{
|
||||||
let span = tracing::trace_span!(target: "indexing::documents::merge", "word_pair_proximity_docids");
|
let span = tracing::trace_span!(target: "indexing::documents::merge", "word_pair_proximity_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
|
indexing_context.progress.update_progress(IndexingStep::MergingWordProximity);
|
||||||
|
|
||||||
merge_and_send_docids(
|
merge_and_send_docids(
|
||||||
caches,
|
caches,
|
||||||
|
@ -82,14 +82,8 @@ where
|
|||||||
merge_caches_sorted(frozen, |key, DelAddRoaringBitmap { del, add }| {
|
merge_caches_sorted(frozen, |key, DelAddRoaringBitmap { del, add }| {
|
||||||
let current = database.get(&rtxn, key)?;
|
let current = database.get(&rtxn, key)?;
|
||||||
match merge_cbo_bitmaps(current, del, add)? {
|
match merge_cbo_bitmaps(current, del, add)? {
|
||||||
Operation::Write(bitmap) => {
|
Operation::Write(bitmap) => docids_sender.write(key, &bitmap),
|
||||||
docids_sender.write(key, &bitmap)?;
|
Operation::Delete => docids_sender.delete(key),
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
Operation::Delete => {
|
|
||||||
docids_sender.delete(key)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
Operation::Ignore => Ok(()),
|
Operation::Ignore => Ok(()),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -130,7 +124,6 @@ pub fn merge_and_send_facet_docids<'extractor>(
|
|||||||
Operation::Ignore => Ok(()),
|
Operation::Ignore => Ok(()),
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
Ok(facet_field_ids_delta)
|
Ok(facet_field_ids_delta)
|
||||||
})
|
})
|
||||||
.reduce(
|
.reduce(
|
||||||
|
@ -13,6 +13,9 @@ pub enum IndexingStep {
|
|||||||
ExtractingWords,
|
ExtractingWords,
|
||||||
ExtractingWordProximity,
|
ExtractingWordProximity,
|
||||||
ExtractingEmbeddings,
|
ExtractingEmbeddings,
|
||||||
|
MergingFacetCaches,
|
||||||
|
MergingWordCaches,
|
||||||
|
MergingWordProximity,
|
||||||
WritingGeoPoints,
|
WritingGeoPoints,
|
||||||
WaitingForDatabaseWrites,
|
WaitingForDatabaseWrites,
|
||||||
WaitingForExtractors,
|
WaitingForExtractors,
|
||||||
@ -31,6 +34,9 @@ impl Step for IndexingStep {
|
|||||||
IndexingStep::ExtractingWords => "extracting words",
|
IndexingStep::ExtractingWords => "extracting words",
|
||||||
IndexingStep::ExtractingWordProximity => "extracting word proximity",
|
IndexingStep::ExtractingWordProximity => "extracting word proximity",
|
||||||
IndexingStep::ExtractingEmbeddings => "extracting embeddings",
|
IndexingStep::ExtractingEmbeddings => "extracting embeddings",
|
||||||
|
IndexingStep::MergingFacetCaches => "merging facet caches",
|
||||||
|
IndexingStep::MergingWordCaches => "merging word caches",
|
||||||
|
IndexingStep::MergingWordProximity => "merging word proximity",
|
||||||
IndexingStep::WritingGeoPoints => "writing geo points",
|
IndexingStep::WritingGeoPoints => "writing geo points",
|
||||||
IndexingStep::WaitingForDatabaseWrites => "waiting for database writes",
|
IndexingStep::WaitingForDatabaseWrites => "waiting for database writes",
|
||||||
IndexingStep::WaitingForExtractors => "waiting for extractors",
|
IndexingStep::WaitingForExtractors => "waiting for extractors",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user