Repository navigation
Disable deferred point filtering in resharding - #8310
Conversation
| &runtime_handle, | ||
| hw_measurement_acc.clone(), | ||
| None, // no timeout on update path | ||
| // Ignoring deferred points here since they could be part of the update operation. |
There was a problem hiding this comment.
I suggest to ignore deferred points here as well for the commented reason.
Please let me know if this is not preferred!
| &self.search_runtime, | ||
| None, | ||
| hw_measurement_acc.clone(), | ||
| true, |
There was a problem hiding this comment.
This function is only used in resharding. More precisely, when aborting. Therefore it could make sense to include deferred points when cleaning up partial transfers.
There was a problem hiding this comment.
It should include deferred points.
The operation must be able to get rid of all point IDs that don't belong in the shard, including deferred points.
timvisee
left a comment
There was a problem hiding this comment.
In a call we agreed to change the ignore_deferred parameter. It's ambiguous and may have two very different meanings.
I'll do another review pass once it's updated.
fc408e7 to
e0cedd9
Compare
380666e to
08f9187
Compare
13eeb9e to
8bfe14a
Compare
b27dfdd to
5146cdf
Compare
5146cdf to
a5152f9
Compare
a5152f9 to
af2ebee
Compare
985d964 to
4361791
Compare
af2ebee to
6c60488
Compare
4361791 to
8aa0995
Compare
6c60488 to
9c3e181
Compare
timvisee
left a comment
There was a problem hiding this comment.
In some read operations we do two or more internal read operations. I believe it's important to use the same deferred behavior for everything.
Currently a mix is used. This would allow the first stage to respect deferred points, while the second stage still returns point states that are too new (and still deferred). Using the same deferred variant everywhere should resolve that.
I'm quite sure that's important for data consistency.
| search_runtime_handle, | ||
| timeout, | ||
| hw_measurement_acc, | ||
| DeferredBehavior::IncludeAll, // Points are already filtered in `point_ids`. |
There was a problem hiding this comment.
This isn't sound.
Even though we've collected point IDs, including deferred points may still gives us a newer version of the point. That is not desired.
I'd recommend to simply use the same behavior here.
Do you have any specific reason for ignoring the user provided behavior here?
There was a problem hiding this comment.
Do you have any specific reason for ignoring the user provided behavior here?
I was trying to avoid the additional allocation that comes with filtering in retrieve(). I didn't think of the special case where a single segment has a point deferred and non-deferred.
| @@ -1226,6 +1227,7 @@ impl ShardOperation for RemoteShard { | |||
| _search_runtime_handle: &Handle, | |||
| timeout: Option<Duration>, | |||
| hw_measurement_acc: HwMeasurementAcc, | |||
| _deferred_behavior: DeferredBehavior, | |||
| ) -> CollectionResult<CountResult> { | |||
| let processed_timeout = Self::process_read_timeout(timeout, "count")?; | |||
| let count_points = CountPoints { | |||
| @@ -1280,6 +1282,7 @@ impl ShardOperation for RemoteShard { | |||
| _search_runtime_handle: &Handle, | |||
| timeout: Option<Duration>, | |||
| hw_measurement_acc: HwMeasurementAcc, | |||
| _deferred_behavior: DeferredBehavior, | |||
There was a problem hiding this comment.
I see the deferred behavior is simply ignored here. I'm not sure it's good enough, and it's a potential foot gun. At the caller, we might not know what kind of shard we're working with.
Just stating it here, because I don't see an obvious solution right away. I have to think about it for a second.
In case of count in transfers, maybe we've to get the local shard explicitly and call count directly on it so we don't have the expose deferred logic in the shared trait.
There was a problem hiding this comment.
I added a TODO: 3a0ae79
I'll handle it later in a separate PR as discussed.
5d5bd77 to
9dbc133
Compare
| /// | ||
| /// Doesn't filter deferred points. |
There was a problem hiding this comment.
I believe this comment must be updated
Co-authored-by: Tim Visée <[email protected]>
3a0ae79 to
e6961a7
Compare
timvisee
left a comment
There was a problem hiding this comment.
I'm quite confident this is correct. As extra measure I'd like a bit of testing because it's hard to validate all of this in context of resharding with static analysis.
I did do basic testing locally in which did not show any clear problems. But I'd like to see it run on chaos testing for some time to be sure.
* Add ignore_deferred flag for internal scroll API * Ignore deferred points in ProxyShard::update * Use enum instead of bool as type in function parameters * Use consistent parameter name * fmt * Apply suggestions from code review Co-authored-by: Tim Visée <[email protected]> * More explicit naming * Add DeferredBehavior to `count()` and disable filtering in stream_records * Don't filter `retrieve()` everywhere * Use consistent filter behavior in read operations * Add TODO for ignored parameter in remote_shard * Rebase fixes --------- Co-authored-by: timvisee <[email protected]> Co-authored-by: Tim Visée <[email protected]>
* Add ignore_deferred flag for internal scroll API * Ignore deferred points in ProxyShard::update * Use enum instead of bool as type in function parameters * Use consistent parameter name * fmt * Apply suggestions from code review Co-authored-by: Tim Visée <[email protected]> * More explicit naming * Add DeferredBehavior to `count()` and disable filtering in stream_records * Don't filter `retrieve()` everywhere * Use consistent filter behavior in read operations * Add TODO for ignored parameter in remote_shard * Rebase fixes --------- Co-authored-by: timvisee <[email protected]> Co-authored-by: Tim Visée <[email protected]>
This PR adds a flag to internal scroll functions, which allows us to disable filtering deferred points in resharding.