-
Notifications
You must be signed in to change notification settings - Fork 25.7k
flushOnIdle use tryWithEngineOrNull #134157
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
flushOnIdle use tryWithEngineOrNull #134157
Conversation
Since it is an optimistic operation, we can let it be skipped if the shard is currently being reset. That way the IndexingMemoryController will not get stuck if a lot of shards are gradually having their engines being reset. Relates ES-12413
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the flushOnIdle method to use tryWithEngineOrNull instead of getEngineOrNull, making it an optimistic operation that can be skipped when the shard's engine is being reset. This prevents the IndexingMemoryController from getting stuck when multiple shards are having their engines reset.
- Changed
flushOnIdleto usetryWithEngineOrNullfor non-blocking engine access - Added trace logging when flush is skipped due to engine being unavailable
- Added comprehensive test to verify the new behavior during concurrent engine reset operations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| IndexShard.java | Modified flushOnIdle to use tryWithEngineOrNull and added trace logging |
| IndexShardTests.java | Added test case to verify flush behavior during engine reset operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3570258 to
b5ea934
Compare
|
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
server/src/main/java/org/elasticsearch/index/shard/IndexShard.java
Outdated
Show resolved
Hide resolved
b5ea934 to
c0ad890
Compare
|
LGTM |
yungene
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@tlrx gentle reminder for reviewing |
tlrx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Since it is an optimistic operation, we can let it be skipped if the shard is currently being reset. That way the IndexingMemoryController will not get stuck if a lot of shards are gradually having their engines being reset. Relates ES-12413
Since it is an optimistic operation, we can let it be skipped if the shard is currently being reset. That way the IndexingMemoryController will not get stuck if a lot of shards are gradually having their engines being reset. Relates ES-12413
Since it is an optimistic operation, we can let it be skipped if the shard is currently being reset. That way the
IndexingMemoryController will not get stuck if a lot of shards are gradually having their engines being reset.
Relates ES-12413