Skip to content
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

Move DataTier.TIER_PREFERENCE_SETTING registration out of XPackPlugin #78995

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

joegallo
Copy link
Contributor

@joegallo joegallo commented Oct 12, 2021

Follow up to #78668, but also related to #76147

It threw me off that we're still registering this via XPackPlugin, so here's a PR that stops doing that. I wish I'd caught this for #78880, but I didn't.

I'm not entirely sure this is a good idea, perhaps there were complicated reasons why it had to stay where it was.

As a follow up to DataTier having been moved to server/
@joegallo joegallo added :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) v8.0.0 v7.16.0 labels Oct 12, 2021
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Oct 12, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM, and I can't think of a reason why this wouldn't be ok to do. Maybe @henningandersen could take 2 min to confirm that though ? :) Thanks!

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.

I am having second thoughts on excluding tier preference from follower settings.

@@ -444,7 +445,8 @@ private static ShardFollowTask createShardFollowTask(
MergeSchedulerConfig.AUTO_THROTTLE_SETTING,
MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING,
MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING,
EngineConfig.INDEX_CODEC_SETTING);
EngineConfig.INDEX_CODEC_SETTING,
DataTier.TIER_PREFERENCE_SETTING);
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not entirely sure this is right. Or rather, I think this is what we would like it to be, but I wonder if this changes behavior and whether we should consider it breaking. You mentioned that a test would fail without this, can you point me to the test and/or test-failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/TransportResumeFollowActionTests.java#L207-L231 -- TransportResumeFollowActionTests#testDynamicIndexSettingsAreClassified.

My thinking (which could be wrong) is that this isn't actually a change in runtime behavior, it's just that previously the setting was invisible to the test because it was registered elsewhere. But like I said, I could be mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I am mistaken, though, +1 that we don't want to do a change in behavior on this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added a test in #79031 demonstrating that we do replicate this setting today (which is what I suspected). However, these settings are in fact only copied over on the initial bootstrap follow. They are however not updated while following the index. So adding tier preference here is fine.

In fact, it is already covered by IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_SETTING, which also matches _tier_preference due to the common prefix.

henningandersen added a commit to henningandersen/elasticsearch that referenced this pull request Oct 13, 2021
Add a test demonstrating that the follower receives the tier preference
from the leader index.

Relates elastic#78995
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.

@@ -444,7 +445,8 @@ private static ShardFollowTask createShardFollowTask(
MergeSchedulerConfig.AUTO_THROTTLE_SETTING,
MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING,
MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING,
EngineConfig.INDEX_CODEC_SETTING);
EngineConfig.INDEX_CODEC_SETTING,
DataTier.TIER_PREFERENCE_SETTING);
Copy link
Contributor

Choose a reason for hiding this comment

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

I added a test in #79031 demonstrating that we do replicate this setting today (which is what I suspected). However, these settings are in fact only copied over on the initial bootstrap follow. They are however not updated while following the index. So adding tier preference here is fine.

In fact, it is already covered by IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_SETTING, which also matches _tier_preference due to the common prefix.

@joegallo joegallo merged commit 4c618a1 into elastic:master Oct 13, 2021
@joegallo joegallo deleted the move-data-tier-setting-declaration branch October 13, 2021 13:21
henningandersen added a commit that referenced this pull request Oct 15, 2021
Add a test demonstrating that the follower receives the tier preference
from the leader index.

Relates #78995
henningandersen added a commit that referenced this pull request Oct 15, 2021
Add a test demonstrating that the follower receives the tier preference
from the leader index.

Relates #78995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >non-issue Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants