add cancellation check in FetchPhase for Agg reductions#18673
add cancellation check in FetchPhase for Agg reductions#18673kaushalmahi12 wants to merge 4 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
|
Follow up PR to #18426 and covering the FetchPhase Tagging @jainankitk , @jed326 and @sgup432 for review |
|
❌ Gradle check result for 4093508: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Looking into test failures |
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18673 +/- ##
============================================
+ Coverage 72.72% 72.74% +0.02%
- Complexity 68409 68439 +30
============================================
Files 5566 5568 +2
Lines 314292 314369 +77
Branches 45579 45586 +7
============================================
+ Hits 228554 228691 +137
+ Misses 67153 67105 -48
+ Partials 18585 18573 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sgup432
left a comment
There was a problem hiding this comment.
I see we are changing all the desired method signatures to pass the cancellation checks. Doesn't look a nice way to do it.
Instead, I was thinking whether we can create a generic framework(or maybe reuse existing) where we can pass this isTaskCancelled in a more efficient way without change method signatures?
Like maybe storing this info in ThreadLocal(or reusing ThreadContext) where every thread has this info and which can also be propagated along? And we can directly call a static method and fetch that info.
This way we could use this framework for later usecases as well to extend the soft cancellation checks.
|
Thanks @sgup432 ! It is a valid suggestion and I agree that the propagation of task cancellation is not very clean but even to pass the I feel maybe we need to give it more thought to refactor the query lifecycle in such a way that it is less intrusive to access the request state. |
|
This PR is stalled because it has been open for 30 days with no activity. |
jainankitk
left a comment
There was a problem hiding this comment.
Thanks @kaushalmahi12 for raising this PR. While the functionality itself of being able to effectively cancel the long running search tasks is really useful, we should look into better ways of achieving the same to also ensure the backward compatibility across versions.
|
@kaushalmahi12 - Can we move this PR into draft state until we resume active work on it? |
|
This PR is stalled because it has been open for 30 days with no activity. |
|
This PR is stalled because it has been open for 30 days with no activity. |
Description
This change introduces cancellation checks for early termination in FetchPhase during shard level reduce and co-ordinator level reduce.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.