mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 14:05:27 +00:00
In case the local agg sorter queue gets full and no limit has been provided, the local sorter will now erroneously call the failure callback for every single row in the original rowset that's left over the local queue limit (instead for just the first one). The failure response is dispatched in any case, so this is relatively harmless. The sorter continues iterating on the original response fetching subsequent pages. In case of correct Elasticsearch behaviour, this is also harmless, it'll just trigger a number of internal exceptions. However, in case of a pagination defect in Elasticsearch (like GH#65685, where the same search_after is returned), this will result in an effective spin loop, potentially rendering eventually the node unresponsive. This PR simply breaks both the inner loop iterating over the current unsorted rowset, as well as the outer one, iterating over the left pages. It also fixes an outdated documentation limitation. (cherry picked from commit 638402c387faf79bba38fcc95f371a73146efc0b)