Skip to content

[9.0] Threadpool merge executor does not block aborted merges (#129613) #129727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

albertzaharovits
Copy link
Contributor

This PR addresses a bug where aborted merges are blocked if there's insufficient disk space.

Previously, the merge disk space estimation did not consider if the operation has been aborted when/while it was enqueued for execution. Consequently, aborted merges, for e.g. when closing a shard, were blocked if their disk space estimation was exceeding the available disk space threshold. In this case, the shard close operation would itself block.

This fix estimates a disk space budget of 0 for aborted merges, and it periodically checks if any enqueued merge tasks have been aborted (more generally, it checks if the budget estimate for any merge tasks has changed, and reorders the queue if so). This way aborted merges are prioritized and are never blocked.

Closes #129335
Backport of #129613

This PR addresses a bug where aborted merges are blocked if there's
insufficient disk space.

Previously, the merge disk space estimation did not consider if the
operation has been aborted when/while it was enqueued for execution.
Consequently, aborted merges, for e.g. when closing a shard, were
blocked if their disk space estimation was exceeding the available disk
space threshold. In this case, the shard close operation would itself
block.

This fix estimates a disk space budget of `0` for aborted merges, and it
periodically checks if any enqueued merge tasks have been aborted (more
generally, it checks if the budget estimate for any merge tasks has
changed, and reorders the queue if so). This way aborted merges are
prioritized and are never blocked.

Closes elastic#129335
@albertzaharovits albertzaharovits self-assigned this Jun 19, 2025
@albertzaharovits albertzaharovits added >non-issue :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. backport v9.0.4 auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jun 19, 2025
@elasticsearchmachine elasticsearchmachine merged commit f339e44 into elastic:9.0 Jun 20, 2025
17 checks passed
@albertzaharovits albertzaharovits deleted the backport-90-consider-aborting-merges-while-enqueued branch June 20, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue v9.0.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants