-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Track evacuated IDs since the last shard-local refresh in LiveVersionMap #95331
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
Track evacuated IDs since the last shard-local refresh in LiveVersionMap #95331
Conversation
For now please ignore correctness/concurrency issues. I'm wondering if I could create and pass around |
You can create overridable methods that only I added this PR as a discussion point for the sync tomorrow. I spent some time looking at it, but still thinking through the approach. I think we should all discuss it. |
0ed09aa
to
f421076
Compare
I meant more how to wire-up and pass along an
At the moment this is not urgent but I think if possible, this would cleanup a lot of noise here and move it to the Serverless PR where these things are actually used/needed. |
f421076
to
e04e324
Compare
server/src/main/java/org/elasticsearch/index/engine/LiveVersionMap.java
Outdated
Show resolved
Hide resolved
Pinging @elastic/es-distributed (Team:Distributed) |
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.
Left a few comments after an initial skimming of central pieces.
server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java
Outdated
Show resolved
Hide resolved
233412c
to
83e84d6
Compare
83e84d6
to
638b3db
Compare
server/src/main/java/org/elasticsearch/index/engine/DeleteVersionValue.java
Outdated
Show resolved
Hide resolved
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.
@henningandersen @tlrx This is now ready for review again. I've removed most of the clutter.
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.
This looks much leaner, I am largely on board but have not gone in depth yet. I have some first comments about the structure and interaction between server and stateless (also in the companion PR).
server/src/main/java/org/elasticsearch/index/engine/LiveVersionMap.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/engine/LiveVersionMapArchiver.java
Outdated
Show resolved
Hide resolved
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.
One more comment around safety.
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.
@henningandersen I've addressed the clean ups you suggested. Please take another look.
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.
This looks good to me. I wonder if we can add some minimal testing of the archive interaction in :server: ? Perhaps something like:
- Validate that an override of
createLiveVersionMapArchiver
results in aLiveVersionMap
with the archive in it. - Validate that beforeRefresh does not call it and afterRefresh does call it.
- Validate that an archive with some value in it is found when using the live-version map.
server/src/test/java/org/elasticsearch/index/engine/LiveVersionMapTestUtils.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/engine/LiveVersionMap.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/engine/LiveVersionMapArchiver.java
Outdated
Show resolved
Hide resolved
2b6b21d
to
6e169b2
Compare
@henningandersen I've addressed the changes.
hmm... I find that a bit of an overkill. I looked into that a bit and I think it would probably be a test with a bunch of awkward setups and trivial assertions. If you think that would be crucial for the PR, I can do that. I've tested all of those things in the serverless PR, where I think it actually matters. |
I'd like to have it. I think an important mechanism like this deserves some basic testing here. The effort does not sound enormous to me. I get that there is limited value, but not breaking the contract and knowing that early is beneficial. And I fear that the large separation of test from the code here will cause them to not be updated in concert moving forward. If some of it requires big efforts I am happy to omit it, but can you give it a shot and we can chat about it if you think it is too big? |
@henningandersen I've added the requested tests, please have another look! |
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.
This PR adds adds an interface and noop implementation for
LiveVersionMapArchive
.It receives
old
maps from the LiveVersionMap upon a refresh, and is also informedwhen unpromotable shards have been refreshed (one way of doing this is implemented
in the matching Serverless PR).
relates ES-5728