-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Support fetching _tier field value #71379
Conversation
Pinging @elastic/es-search (Team:Search) |
...main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
String tierPreference = getTierPreference(context); | ||
return lookup -> singletonList(tierPreference); |
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.
I just noticed this doesn't handle a missing/ empty setting correctly. I'll push a fix.
Update: while writing tests I noticed we don't handle this correctly and opened #71439. I'll return to this PR once that is merged.
This looks good to me, I'll take another look after #71439 is merged but I assume this PR doesn't change much with it. |
Settings settings = context.getIndexSettings().getSettings(); | ||
String value = DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings); | ||
|
||
if (value == null) { |
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.
I assume this will change after #71439 is in, so keeping this comment here for now just to recheck
@cbuescher thanks for reviewing, it's ready for another look. |
Thanks for the ping, nothing to add from my side, so LGTM (pending CI which looks almost done) |
Now that the
fields
option allows fetching metadata fields, we can supportloading the new
_tier
metadata field.Relates to #63569 and #68135.