-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
#31973 highlights a problem with polling indices being the only mechanism to check whether a forecast has completed: the primary and replica can have different documents searchable, so you can get inconsistent results from two consecutive searches of the same forecast results.
We get around this for non-forecast results by recommending people flush a job before requesting results if they require perfect consistency. However, flushing a job does not currently also flush forecasts.
If you close a job then the request does not return until all results are committed to the results index, including forecast results. So there is a discrepancy here between close and flush. Prior to the introduction of forecasts, flush provided the same consistency guarantee as close, but now it doesn't for the case of forecast results.
To restore this parity between the consistency guarantees of flush and close I propose that a request to flush a job should not return until all forecasts are complete as well as other processing. (If there are some situations where we want to flush everything except forecasts then we could have a ?forecasts=false option on the flush endpoint, but I think the default should be that flush and close cause the same documents to be searchable in indices.)