Repository navigation
Correct calculation of deferred point counts - #8366
Conversation
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
lib/collection/src/collection_manager/segments_searcher.rs (1)
687-700:⚠️ Potential issue | 🟠 MajorDon't let a zero estimate suppress the segment search.
available_point_count_without_deferred_estimated()is only an estimate. If it drops to0here,sampling_limit()returns0and this segment is never searched, which can hide valid visible points. Please fall back to the unsampled path when the estimate is zero/uncertain instead of sampling with a zero-sized segment.One safe fallback
- let segment_points = read_segment.available_point_count_without_deferred_estimated(); + let estimated_segment_points = + read_segment.available_point_count_without_deferred_estimated(); + let disable_sampling_for_segment = + estimated_segment_points == 0 && read_segment.available_point_count() > 0; let segment_config = read_segment.config(); - let top = if use_sampling { + let top = if use_sampling && !disable_sampling_for_segment { let ef_limit = search_params .params .and_then(|p| p.hnsw_ef) .or_else(|| get_hnsw_ef_construct(segment_config, search_params.vector_name)); sampling_limit( search_params.top, ef_limit, - segment_points, + estimated_segment_points, segment_query_context.available_point_count(), ) } else { search_params.top };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/collection/src/collection_manager/segments_searcher.rs` around lines 687 - 700, The estimate from read_segment.available_point_count_without_deferred_estimated() can be zero and should not force sampling to produce top=0; modify the logic in the branch that uses use_sampling so that if segment_points == 0 (or otherwise uncertain) you skip sampling and fall back to the unsampled path: detect segment_points == 0 after calling available_point_count_without_deferred_estimated(), and in that case avoid calling sampling_limit(...) (or set use_sampling=false / compute top from search_params.top and segment_query_context.available_point_count() instead) so the segment is still searched; update the code around use_sampling, sampling_limit(...), and related variables (read_segment, segment_config, search_params, get_hnsw_ef_construct, segment_query_context.available_point_count()) to implement this fallback.docs/redoc/master/openapi.json (1)
12752-12785:⚠️ Potential issue | 🟡 MinorAdd docs for the new public counter.
Line 12752 makes
num_deferred_pointspart of the required API contract, but Lines 12782-12785 still leave it undocumented. Please describe how it relates tonum_points—for example, whethernum_pointsalready excludes deferred points and what invariant clients can rely on. Based on learnings:docs/redoc/master/openapi.jsonis auto-generated from the REST schemas; update the Rust schema/doc comments rather than this JSON directly.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/redoc/master/openapi.json` around lines 12752 - 12785, The OpenAPI JSON added num_deferred_points to the required contract but lacks documentation and invariants; update the Rust REST schema comments (not the generated JSON) for the struct that defines these fields—add a doc comment on the num_deferred_points field explaining what it counts, how it relates to num_points (e.g., whether num_points excludes deferred points or includes them), and any invariants clients can rely on (e.g., num_points = indexed points + num_deferred_points or num_points excludes deferred points and num_vectors represents indexed vectors). Edit the Rust struct field comments for num_deferred_points and, if needed, clarify num_points in the same struct (referencing the fields num_deferred_points and num_points and the schema that references SegmentType) so the OpenAPI generator will emit the descriptive JSON. Ensure comments are precise and update any serialization/serde attributes if they affect the generated docs.
♻️ Duplicate comments (2)
lib/collection/src/shards/local_shard/scroll.rs (1)
372-380:⚠️ Potential issue | 🟠 MajorAvoid zero-weighting segments that already returned random candidates.
This weight is now derived from an estimated non-deferred count. If that estimate hits
0whileread_random_filtered()still produced visible points, the segment gets starved byWeightedIndexand random scroll becomes biased. At minimum, use the returned candidate count as a floor for the weight until an exact non-deferred count exists.Minimal guard against starvation
- ( - read_segment.available_point_count_without_deferred_estimated(), - read_segment.read_random_filtered( - limit, - filter.as_ref(), - &is_stopped, - &hw_counter, - ), - ) + let point_ids = read_segment.read_random_filtered( + limit, + filter.as_ref(), + &is_stopped, + &hw_counter, + ); + let point_count = read_segment + .available_point_count_without_deferred_estimated() + .max(point_ids.len()); + + (point_count, point_ids)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/collection/src/shards/local_shard/scroll.rs` around lines 372 - 380, The segment weight is being set from read_segment.available_point_count_without_deferred_estimated() which can be zero while read_segment.read_random_filtered(...) still returned candidates, causing WeightedIndex starvation; change the logic that constructs the tuple (weight, candidates) to compute weight = max(estimated_non_deferred_count, returned_candidates_count) (i.e., call read_random_filtered first, get the number of returned candidates, then use that count as a floor for the estimated weight) so the returned candidate count from read_random_filtered() prevents zero-weighting until an exact count exists; update any variables or tuple ordering around read_segment.available_point_count_without_deferred_estimated() and read_random_filtered() accordingly.lib/edge/src/scroll.rs (1)
264-272:⚠️ Potential issue | 🟠 MajorKeep segments with returned candidates eligible for random selection.
This uses the same estimated non-deferred count as the random-scroll weight. If the estimate underflows to
0, a segment that already returned visible candidates here can never be picked in the weighted phase. Please floor the weight by the candidate count, or otherwise avoid zero-weighting non-empty candidate lists.Minimal starvation guard
- let point_count = segment.available_point_count_without_deferred_estimated(); let point_ids = segment.read_random_filtered( limit, filter, &AtomicBool::new(false), &hw_counter, ); + let point_count = segment + .available_point_count_without_deferred_estimated() + .max(point_ids.len()); (point_count, point_ids)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/edge/src/scroll.rs` around lines 264 - 272, The segment weight uses available_point_count_without_deferred_estimated() which can underflow to 0 and starve segments that just returned candidates; after calling segment.read_random_filtered(...) capture the actual returned candidate count from point_ids.len() and floor the estimated point_count with that value (e.g. set point_count = max(point_count, point_ids.len() as _)) so non-empty point_ids never produce a zero weight; update references around point_count, point_ids, available_point_count_without_deferred_estimated, and read_random_filtered accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/segment/src/entry/entry_point.rs`:
- Around line 200-201: The new required trait method
available_point_count_without_deferred_estimated breaks external implementors
and the suggested default self.available_point_count() loses deferred-aware
semantics; instead add a new trait method deferred_point_count_estimated(&self)
-> usize with a sensible default (0) and implement
available_point_count_without_deferred_estimated(&self) -> usize as
self.available_point_count().saturating_sub(self.deferred_point_count_estimated()),
so existing implementors keep current behavior and types that track deferred
points (e.g., Segment implementations) can override
deferred_point_count_estimated(), while ProxySegment can either rely on the
default or explicitly override if needed.
In `@lib/segment/src/segment/entry.rs`:
- Around line 510-514: vectors_size_bytes is computed from only visible points
(num_points) but deferred vectors still consume storage; change the calculation
to include deferred points by using both
available_point_count_without_deferred_estimated() and
deferred_point_count_estimated() (e.g., compute total_points = num_points +
num_deferred_points) and multiply total_average_vectors_size_bytes by that total
when setting vectors_size_bytes so deferred vectors are accounted for.
- Around line 943-948: The helper
available_point_count_without_deferred_estimated() is estimate-based but is
being used by exact/reporting call sites (size_info() and filterless
CardinalityEstimation); add a new exact live counter and keep the existing
heuristic for heuristic paths only: introduce a new method (e.g.,
available_point_count_non_deferred_exact()) that computes the exact non-deferred
count by using id_tracker.borrow().available_point_count() and subtracting a
live deferred count (implement deferred_point_count_live() that derives deferred
points from current live mappings, not the estimated boundary), update
size_info() and the filterless CardinalityEstimation fast path to call
available_point_count_non_deferred_exact(), and leave
available_point_count_without_deferred_estimated() for heuristic/estimated
usages only.
In `@lib/shard/src/proxy_segment/segment_entry.rs`:
- Around line 735-738: The method
available_point_count_without_deferred_estimated() currently returns
self.available_point_count(), which ends up including deferred points; change it
to read the wrapped segment's corresponding method instead: obtain the
wrapped_segment guard (wrapped_segment.get().read() or the same guard pattern
used elsewhere) and call
wrapped_segment_guard.available_point_count_without_deferred_estimated() so it
excludes deferred points consistently (see the existing correct usage at the
earlier call site that invokes
wrapped_segment_guard.available_point_count_without_deferred_estimated()).
---
Outside diff comments:
In `@docs/redoc/master/openapi.json`:
- Around line 12752-12785: The OpenAPI JSON added num_deferred_points to the
required contract but lacks documentation and invariants; update the Rust REST
schema comments (not the generated JSON) for the struct that defines these
fields—add a doc comment on the num_deferred_points field explaining what it
counts, how it relates to num_points (e.g., whether num_points excludes deferred
points or includes them), and any invariants clients can rely on (e.g.,
num_points = indexed points + num_deferred_points or num_points excludes
deferred points and num_vectors represents indexed vectors). Edit the Rust
struct field comments for num_deferred_points and, if needed, clarify num_points
in the same struct (referencing the fields num_deferred_points and num_points
and the schema that references SegmentType) so the OpenAPI generator will emit
the descriptive JSON. Ensure comments are precise and update any
serialization/serde attributes if they affect the generated docs.
In `@lib/collection/src/collection_manager/segments_searcher.rs`:
- Around line 687-700: The estimate from
read_segment.available_point_count_without_deferred_estimated() can be zero and
should not force sampling to produce top=0; modify the logic in the branch that
uses use_sampling so that if segment_points == 0 (or otherwise uncertain) you
skip sampling and fall back to the unsampled path: detect segment_points == 0
after calling available_point_count_without_deferred_estimated(), and in that
case avoid calling sampling_limit(...) (or set use_sampling=false / compute top
from search_params.top and segment_query_context.available_point_count()
instead) so the segment is still searched; update the code around use_sampling,
sampling_limit(...), and related variables (read_segment, segment_config,
search_params, get_hnsw_ef_construct,
segment_query_context.available_point_count()) to implement this fallback.
---
Duplicate comments:
In `@lib/collection/src/shards/local_shard/scroll.rs`:
- Around line 372-380: The segment weight is being set from
read_segment.available_point_count_without_deferred_estimated() which can be
zero while read_segment.read_random_filtered(...) still returned candidates,
causing WeightedIndex starvation; change the logic that constructs the tuple
(weight, candidates) to compute weight = max(estimated_non_deferred_count,
returned_candidates_count) (i.e., call read_random_filtered first, get the
number of returned candidates, then use that count as a floor for the estimated
weight) so the returned candidate count from read_random_filtered() prevents
zero-weighting until an exact count exists; update any variables or tuple
ordering around read_segment.available_point_count_without_deferred_estimated()
and read_random_filtered() accordingly.
In `@lib/edge/src/scroll.rs`:
- Around line 264-272: The segment weight uses
available_point_count_without_deferred_estimated() which can underflow to 0 and
starve segments that just returned candidates; after calling
segment.read_random_filtered(...) capture the actual returned candidate count
from point_ids.len() and floor the estimated point_count with that value (e.g.
set point_count = max(point_count, point_ids.len() as _)) so non-empty point_ids
never produce a zero weight; update references around point_count, point_ids,
available_point_count_without_deferred_estimated, and read_random_filtered
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2411d95f-5777-4604-b71c-1e9d9068ac78
📒 Files selected for processing (12)
docs/redoc/master/openapi.jsonlib/collection/src/collection_manager/segments_searcher.rslib/collection/src/shards/local_shard/indexed_only.rslib/collection/src/shards/local_shard/scroll.rslib/edge/src/scroll.rslib/segment/src/data_types/query_context.rslib/segment/src/entry/entry_point.rslib/segment/src/segment/entry.rslib/segment/src/segment/segment_ops.rslib/segment/src/segment/tests.rslib/segment/src/types.rslib/shard/src/proxy_segment/segment_entry.rs
💤 Files with no reviewable changes (1)
- lib/segment/src/segment/segment_ops.rs
5f98348 to
a4181df
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/redoc/master/openapi.json (1)
12782-12786: Add a field description for API clarity.Line 12782 introduces
num_deferred_pointswithout a description; please document what “deferred” means for API consumers in the source REST schema, then regenerate this file.Based on learnings,
docs/redoc/master/openapi.jsonis auto-generated from REST schemas, so field docs should be added inlib/api/src/rest/schema.rs.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/redoc/master/openapi.json` around lines 12782 - 12786, The OpenAPI output lacks a description for the field num_deferred_points; update the REST schema source by adding a descriptive docstring/attribute for the num_deferred_points field in lib/api/src/rest/schema.rs (on the struct or field definition that defines num_deferred_points) explaining what “deferred” means for consumers and any constraints, then rebuild/regenerate the OpenAPI JSON so docs/redoc/master/openapi.json includes the new description.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/shard/src/proxy_segment/segment_entry.rs`:
- Line 447: The subtraction currently uses self.deleted_points.len() (which
includes deferred deletions) against
wrapped_segment_guard.available_point_count_without_deferred_estimated(),
double-counting deferred deletions; change the logic in the estimate_point_count
and num_points code paths to subtract only deleted points that are
visible/non-deferred. Specifically, replace using self.deleted_points.len() with
a computed deleted_visible_count (filtering self.deleted_points to exclude
deferred deletions—e.g., using whatever deferred tracking structure exists—or
otherwise count only deleted IDs that are considered in the “available” set)
before subtracting from
wrapped_segment_guard.available_point_count_without_deferred_estimated(); update
the same logic around lines referencing
wrapped_segment_guard.available_point_count_without_deferred_estimated(),
estimate_point_count, and num_points.
---
Nitpick comments:
In `@docs/redoc/master/openapi.json`:
- Around line 12782-12786: The OpenAPI output lacks a description for the field
num_deferred_points; update the REST schema source by adding a descriptive
docstring/attribute for the num_deferred_points field in
lib/api/src/rest/schema.rs (on the struct or field definition that defines
num_deferred_points) explaining what “deferred” means for consumers and any
constraints, then rebuild/regenerate the OpenAPI JSON so
docs/redoc/master/openapi.json includes the new description.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69f484a6-e71e-45e4-8b2f-392e1861aa8a
📒 Files selected for processing (12)
docs/redoc/master/openapi.jsonlib/collection/src/collection_manager/segments_searcher.rslib/collection/src/shards/local_shard/indexed_only.rslib/collection/src/shards/local_shard/scroll.rslib/edge/src/scroll.rslib/segment/src/data_types/query_context.rslib/segment/src/entry/entry_point.rslib/segment/src/segment/entry.rslib/segment/src/segment/segment_ops.rslib/segment/src/segment/tests.rslib/segment/src/types.rslib/shard/src/proxy_segment/segment_entry.rs
💤 Files with no reviewable changes (1)
- lib/segment/src/segment/segment_ops.rs
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change adds explicit tracking and exclusion of deferred (hidden) points across segments and proxy segments. It introduces two new SegmentInfo fields ( Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
lib/shard/src/proxy_segment/tests.rs (1)
524-599: Please cover the reload path in this regression.The new deferred accounting is also reconstructed during segment creation/loading, but this test only exercises a freshly built segment. A round-trip through
load_segment()after deleting a deferred point would catch restart regressions innum_deferred_pointsandavailable_point_count_without_deferred().🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/shard/src/proxy_segment/tests.rs` around lines 524 - 599, Update the test_proxy_deferred test to exercise the reload path: after deleting the deferred points (the two delete_point calls that reduce num_deferred_points) and the assertions that follow, persist and reload the segment via load_segment() (i.e., create a new Wrapped/LockedSegment by calling the segment load API) and re-create a new ProxySegment::new(LockedSegment::new(...)) and re-assert that size_info().num_deferred_points and available_point_count_without_deferred() still match the expected values and that estimate_point_count(None, &hw_counter) is unchanged; place this round-trip check before you "Touch normal points" (the delete of point 6) so reload covers only the deferred-deletion state.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/segment/src/segment/segment_ops.rs`:
- Around line 694-706: The calculate_deferred_point_count function currently
counts deferred IDs that still have external mappings; change it to count
deleted deferred IDs instead by iterating from deferred_internal_id_if_any() and
counting internal_id entries where id_tracker.external_id(internal_id) is None;
make sure to call deferred_internal_id_if_any(), use id_tracker.borrow() once
(or otherwise avoid double-borrow inside the closure), and return that count so
Segment.deferred_deleted_count is initialized from deleted deferred IDs rather
than live mappings.
In `@lib/shard/src/proxy_segment/segment_entry.rs`:
- Around line 717-720: The deferred-delete counter deleted_deferred_count gets
incremented in SegmentEntry but is never reset when the pending delete queue is
cleared, causing num_deferred_points and
available_point_count_without_deferred() to go out of sync; update the code path
that clears deleted_points (e.g., in ProxySegment::propagate_to_wrapped() or the
method that empties the queue) to also reset self.deleted_deferred_count = 0 so
the counter stays consistent with deleted_points.len(), and keep the existing
increment logic where was_deleted && was_deferred_point is handled.
---
Nitpick comments:
In `@lib/shard/src/proxy_segment/tests.rs`:
- Around line 524-599: Update the test_proxy_deferred test to exercise the
reload path: after deleting the deferred points (the two delete_point calls that
reduce num_deferred_points) and the assertions that follow, persist and reload
the segment via load_segment() (i.e., create a new Wrapped/LockedSegment by
calling the segment load API) and re-create a new
ProxySegment::new(LockedSegment::new(...)) and re-assert that
size_info().num_deferred_points and available_point_count_without_deferred()
still match the expected values and that estimate_point_count(None, &hw_counter)
is unchanged; place this round-trip check before you "Touch normal points" (the
delete of point 6) so reload covers only the deferred-deletion state.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 405f8f9c-29a6-4031-85d8-2efd3a60d76f
📒 Files selected for processing (14)
lib/collection/src/collection_manager/segments_searcher.rslib/collection/src/shards/local_shard/indexed_only.rslib/collection/src/shards/local_shard/scroll.rslib/edge/src/scroll.rslib/segment/src/data_types/query_context.rslib/segment/src/entry/entry_point.rslib/segment/src/segment/entry.rslib/segment/src/segment/mod.rslib/segment/src/segment/segment_ops.rslib/segment/src/segment/tests.rslib/segment/src/segment_constructor/segment_constructor_base.rslib/shard/src/proxy_segment/mod.rslib/shard/src/proxy_segment/segment_entry.rslib/shard/src/proxy_segment/tests.rs
🚧 Files skipped from review as they are similar to previous changes (5)
- lib/edge/src/scroll.rs
- lib/collection/src/shards/local_shard/scroll.rs
- lib/segment/src/data_types/query_context.rs
- lib/collection/src/collection_manager/segments_searcher.rs
- lib/segment/src/segment/tests.rs
e041666 to
9b251e8
Compare
| num_vectors, | ||
| num_indexed_vectors, | ||
| num_points: self.non_deferred_point_count_estimated(), | ||
| num_points: self.available_point_count(), |
There was a problem hiding this comment.
Reverting this change as discussed.
To get the amount of available points without deferred, one can subtract num_deferred_points from num_points. We can also add a field for that later if desired.
85ab971 to
4521b8d
Compare
| return response.json()['result'] | ||
|
|
||
|
|
||
| def get_point_count_excluding_deferred(): |
There was a problem hiding this comment.
Since this PR reverts previous changes to SegmentInfo, we have to use the new fields from telemetry for now.
| pub(crate) deferred_internal_id: Option<PointOffsetType>, | ||
| /// Amount of deleted deferred points. Must kept track of properly to be able | ||
| /// to calculate the amount of available deferred and visible points. | ||
| pub(crate) deferred_deleted_count: Option<usize>, |
There was a problem hiding this comment.
This is the most important change in this PR.
We increase a Segment-level counter for each deletion of a deferred point. This way we can correctly calculate how much of the deleted points are deferred. This then allows us to correctly calculate the amount of non-deleted deferred and visible (non-deferred) points.
For correctness, we iterate over all deferred points once at segment load and count how many deferred points are deleted. With the result of this value we initialize the segments deferred_deleted_count.
There was a problem hiding this comment.
Because Some state is shared between deferred_internal_id and deferred_deleted_count (when one is some, a second one should be also some), I propose to create a struct like
pub struct DeferredPointStatus {
deferred_internal_id: Option<PointOffsetType>,
deferred_deleted_count: Option<usize>,
}
And use in segment:
deferred_points: Option<DeferredPointStatus >
We reduce the number of unnecessary checks/asserts in the PR
# Conflicts: # lib/collection/src/shards/local_shard/scroll.rs
* Properly count amount of deleted deferred points * Prevent double-counting of the same point * Remove hints to estimations * Properly handle counts in ProxySegment * Add tests and fix deleted point count issue
Co-authored-by: Andrey Vasnetsov <[email protected]>
6964a86 to
3df439e
Compare
|
|
||
| let is_point_already_deleted = id_tracker.is_deleted_point(internal_id); | ||
|
|
||
| id_tracker.drop_internal(internal_id)?; |
There was a problem hiding this comment.
We may upgrade drop_internal and return if the ID was deleted. Not for now, maybe in the future
| pub(crate) deferred_internal_id: Option<PointOffsetType>, | ||
| /// Amount of deleted deferred points. Must kept track of properly to be able | ||
| /// to calculate the amount of available deferred and visible points. | ||
| pub(crate) deferred_deleted_count: Option<usize>, |
There was a problem hiding this comment.
Because Some state is shared between deferred_internal_id and deferred_deleted_count (when one is some, a second one should be also some), I propose to create a struct like
pub struct DeferredPointStatus {
deferred_internal_id: Option<PointOffsetType>,
deferred_deleted_count: Option<usize>,
}
And use in segment:
deferred_points: Option<DeferredPointStatus >
We reduce the number of unnecessary checks/asserts in the PR
IvanPleshkov
left a comment
There was a problem hiding this comment.
I didnt found some critical points, all concerns are optional.
I like that this pr covers py tests and proxy segments, great job!
Correct calculation of deferred point counts (qdrant#8366)
* Don't account for deferred points in some places # Conflicts: # lib/collection/src/shards/local_shard/scroll.rs * Add in QueryContext * Cover more places * Coderabbit review remarks * Properly count amount of deleted deferred points (#8386) * Properly count amount of deleted deferred points * Prevent double-counting of the same point * Remove hints to estimations * Properly handle counts in ProxySegment * Add tests and fix deleted point count issue * Adjusts tests + fix issues * Separte fields for deferred points in telemetry (SegmentInfo) * Remove deferred_points_count() * openapi * Fix test by manually calculating visible points * Adjust ProxySegment test to revertion of SegmentInfo * Throw error if collection was not found in telemetry (e2e Test) * Update lib/segment/src/segment/segment_ops.rs Co-authored-by: Andrey Vasnetsov <[email protected]> * Make new fields in API optional * Don't take range if no deferred point exist * Review remarks --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
* Don't account for deferred points in some places # Conflicts: # lib/collection/src/shards/local_shard/scroll.rs * Add in QueryContext * Cover more places * Coderabbit review remarks * Properly count amount of deleted deferred points (#8386) * Properly count amount of deleted deferred points * Prevent double-counting of the same point * Remove hints to estimations * Properly handle counts in ProxySegment * Add tests and fix deleted point count issue * Adjusts tests + fix issues * Separte fields for deferred points in telemetry (SegmentInfo) * Remove deferred_points_count() * openapi * Fix test by manually calculating visible points * Adjust ProxySegment test to revertion of SegmentInfo * Throw error if collection was not found in telemetry (e2e Test) * Update lib/segment/src/segment/segment_ops.rs Co-authored-by: Andrey Vasnetsov <[email protected]> * Make new fields in API optional * Don't take range if no deferred point exist * Review remarks --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
Since we now exclude some points from read operations, we have to adjust the determination of point-counts in some places. Additionally we'd like to differentiate between visible and deferred points in telemetry / SegmentInfo.
This PR implements those changes.
Specifically this PR implements/changes the following:
SegmentInfochanges from previous PRs.CollectionInfoto make them pass after change in 4.