Skip to content

Add TEST MergeWithLowDiskSpaceIT testForceMergeIsBlockedThenUnblocked #130189

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 adds a new IT for when forced merges are blocked (and then unblocked) because of the insufficient disk space situation.

This test was suggested #127613 (review).

@albertzaharovits albertzaharovits self-assigned this Jun 27, 2025
@albertzaharovits albertzaharovits added >test Issues or PRs that are addressing/adding tests :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v9.0.4 v9.2.0 v9.1.1 v8.19.1 labels Jun 27, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Jun 27, 2025
Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I hope we can avoid the thread though.

);
}
// start force merging (which is blocking) on a separate thread
Thread forceMergeThread = new Thread(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we avoid the .get() call and use execute() instead to avoid the thread? Assertions further down could then be about whether the future is done or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, thanks for the suggestion! (I've handled it as part of 3452dce)

long totalMergeCount = indicesStatsResponse.getIndices().get(indexName).getPrimaries().merge.getTotal();
assertThat(totalMergeCount, greaterThan(0L));
// force merge call returned
assertFalse(forceMergeThread.isAlive());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead wait for the force merge to complete first? If we go for a future, we can use future.get() here (or safeGet). If not, we can use forcemergeThread.join. That way I think we can avoid the assertBusy, since all the things here should hopefully be up to date.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion too, thanks! (also handled as part of 3452dce)

@albertzaharovits albertzaharovits added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged labels Jun 29, 2025
@elasticsearchmachine elasticsearchmachine merged commit e9c12e7 into elastic:main Jun 29, 2025
32 checks passed
@albertzaharovits albertzaharovits deleted the IT-blocked-force-merge-when-disk-space-insufficient branch June 29, 2025 06:39
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 29, 2025
…elastic#130189)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
elastic#127613 (review).
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 29, 2025
…elastic#130189)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
elastic#127613 (review).
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0
9.1
8.19

elasticsearchmachine pushed a commit that referenced this pull request Jun 29, 2025
…#130189) (#130288)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
#127613 (review).
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 30, 2025
…elastic#130189)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
elastic#127613 (review).
elasticsearchmachine pushed a commit that referenced this pull request Jun 30, 2025
…blocked (#130189) (#130289)

* Add TEST MergeWithLowDiskSpaceIT testForceMergeIsBlockedThenUnblocked (#130189)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
#127613 (review).

* Add TEST MergeWithLowDiskSpaceIT testForceMergeIsBlockedThenUnblocked (#130189)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
#127613 (review).

* Telemetry metrics don't exist in 8.19
elasticsearchmachine added a commit that referenced this pull request Jun 30, 2025
…locked (#130189) (#130287)

* Add TEST MergeWithLowDiskSpaceIT testForceMergeIsBlockedThenUnblocked (#130189)

This adds a new IT for when forced merges are blocked (and then
unblocked) because of the insufficient disk space situation.

This test was suggested
#127613 (review).

* merge telemetry metrics don't exist in 9.0

* Fix MergeWithLowDiskSpaceIT post telemetry plugin removal

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. Team:Distributed Indexing Meta label for Distributed Indexing team >test Issues or PRs that are addressing/adding tests v8.19.1 v9.0.4 v9.1.1 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants