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

Deprecate setting shared cache on non-frozen nodes #70341

Conversation

jasontedor
Copy link
Member

This commit deprecates the ability to set the shared cache to be positive on non-frozen nodes.

This commit deprecates the ability to set the shared cache to be
positive on non-frozen nodes.
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team (obsolete) label Mar 11, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but I did leave some comments and questions

if (value.getBytes() > 0) {
@SuppressWarnings("unchecked") final List<DiscoveryNodeRole> roles =
(List<DiscoveryNodeRole>) settings.get(NodeRoleSettings.NODE_ROLES_SETTING);
final DiscoveryNode fake = new DiscoveryNode(
Copy link
Member

Choose a reason for hiding this comment

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

Rather than constructing this fake DiscoveryNode, what about making DataTier.isFrozenNode(...) invoke a separate static method that takes a Set<DiscoveryNodeRole> so that method could be used directly? It feels weird to construct a whole fake node just for this purpose.

Copy link
Member Author

Choose a reason for hiding this comment

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

It felt weird to add a whole method just for this purpose. 🤷‍♀️

Especially since it's hard to come up with a good name for the method. isFrozenNode isn't great because it's not testing a node, hasFrozenRole isn't great because it can also include the data role and should return true.

I pushed 892f575.

@Override
public void validate(final ByteSizeValue value, final Map<Setting<?>, Object> settings) {
if (value.getBytes() > 0) {
@SuppressWarnings("unchecked") final List<DiscoveryNodeRole> roles =
Copy link
Member

Choose a reason for hiding this comment

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

I'd feel better if we had an assert that roles was not null so we fail fast, or if we want to be lenient (which we probably don't) do settings.get(NodeRoleSettings.NODE_ROLES_SETTING, Collections.emptyList())

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think roles can be null here. We don't allow explicitly null-valued settings, since that represents unset, and therefore the default value.


@Override
public void validate(final ByteSizeValue value) {

Copy link
Member

Choose a reason for hiding this comment

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

Should we disallow a ByteSizeValue of -1b since that is a valid ByteSizeValue object here?

It feels like the setting should be either 0b or > 0b, but not -1.

Copy link
Member Author

Choose a reason for hiding this comment

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

I pushed 3f02383.

@@ -0,0 +1 @@
preallocate: org.elasticsearch.xpack.searchablesnapshots.preallocate.Preallocate
Copy link
Member

Choose a reason for hiding this comment

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

This seems unrelated to this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's needed to be able to run the relevant unit tests inside of IntelliJ.

jasontedor and others added 3 commits March 11, 2021 17:46
…arch/xpack/searchablesnapshots/cache/FrozenCacheService.java

Co-authored-by: Lee Hinman <[email protected]>
@jasontedor jasontedor requested a review from dakrone March 11, 2021 23:15
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

Still LGTM

jasontedor and others added 2 commits March 11, 2021 18:19
…arch/xpack/searchablesnapshots/cache/FrozenCacheServiceTests.java

Co-authored-by: Lee Hinman <[email protected]>
@jasontedor jasontedor merged commit 3a814a2 into elastic:master Mar 12, 2021
jasontedor added a commit that referenced this pull request Mar 12, 2021
This commit deprecates the ability to set the shared cache to be
positive on non-frozen nodes.
jasontedor added a commit that referenced this pull request Mar 12, 2021
This commit deprecates the ability to set the shared cache to be
positive on non-frozen nodes.
@jasontedor jasontedor deleted the deprecate-shared-cache-on-non-frozen-nodes branch March 12, 2021 01:27
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Mar 23, 2021
…n only

We recently deprecated the ability to set the shared cache outside of the frozen tier, and
eventually will only allow shared_cache searchable snapshots to existing on nodes with the
`data_frozen` role.

This commit changes those searchable snapshots to only be allocated on the
frozen tier, rather than an ordered list of frozen/cold/warm/hot.

Relates to elastic#70341
dakrone added a commit that referenced this pull request Mar 24, 2021
…n only (#70786)

We recently deprecated the ability to set the shared cache outside of the frozen tier, and
eventually will only allow shared_cache searchable snapshots to existing on nodes with the
`data_frozen` role.

This commit changes those searchable snapshots to only be allocated on the
frozen tier, rather than an ordered list of frozen/cold/warm/hot.

Relates to #70341
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Mar 24, 2021
…n only (elastic#70786)

We recently deprecated the ability to set the shared cache outside of the frozen tier, and
eventually will only allow shared_cache searchable snapshots to existing on nodes with the
`data_frozen` role.

This commit changes those searchable snapshots to only be allocated on the
frozen tier, rather than an ordered list of frozen/cold/warm/hot.

Relates to elastic#70341
dakrone added a commit that referenced this pull request Mar 24, 2021
… frozen only (#70786) (#70818)

We recently deprecated the ability to set the shared cache outside of the frozen tier, and
eventually will only allow shared_cache searchable snapshots to existing on nodes with the
`data_frozen` role.

This commit changes those searchable snapshots to only be allocated on the
frozen tier, rather than an ordered list of frozen/cold/warm/hot.

Relates to #70341
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Mar 24, 2021
This commits makes the shared_cache searchable snapshot cache size setting resolve to 0 for nodes
that to do have the `data_frozen` node role.

It turns out there is not a simple way to do this with the existing Settings infrastructure. Given
that setting this on non-frozen nodes is already deprecated (and already outputs a deprecated log
message), After talking to Ryan, we agreed it was better to handle this upon reading the setting
rather than adding anything to the `Settings` code for only this purpose.

I also attempted to make the shared cache setting private (so it actually couldn't be retrieved
outside of the static method), however, it's still needed in the `SearchableSnapshots` plugin
interface, so without moving it there, it has to remain public (I can move it there if we decide
that would be better).

Tangentially related to elastic#70341
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Mar 31, 2021
This commits makes the shared_cache searchable snapshot cache size setting resolve to 0 for nodes
that to do have the data_frozen node role.

Tangentially related to elastic#70341
Supercedes elastic#70846
dakrone added a commit that referenced this pull request Apr 1, 2021
…des (#71134)

* Make searchable snapshot cache size effectively zero on non-frozen nodes

This commits makes the shared_cache searchable snapshot cache size setting resolve to 0 for nodes
that to do have the data_frozen node role.

Tangentially related to #70341
Supercedes #70846

* Update message in HasFrozenCacheAllocationDecider
jrodewig added a commit that referenced this pull request Sep 15, 2021
…he.size` (#77727)

We deprecated the `xpack.searchable.snapshot.shared_cache.size` setting on
non-frozen nodes in 7.12 with PR #70341. However, we didn't add a related item
to the 7.12 deprecation docs. This adds the missing item.

Relates to #71013.
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…he.size` (#77727) (#77762)

We deprecated the `xpack.searchable.snapshot.shared_cache.size` setting on
non-frozen nodes in 7.12 with PR #70341. However, we didn't add a related item
to the 7.12 deprecation docs. This adds the missing item.

Relates to #71013.
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…he.size` (#77727) (#77763)

We deprecated the `xpack.searchable.snapshot.shared_cache.size` setting on
non-frozen nodes in 7.12 with PR #70341. However, we didn't add a related item
to the 7.12 deprecation docs. This adds the missing item.

Relates to #71013.
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…he.size` (#77727) (#77764)

We deprecated the `xpack.searchable.snapshot.shared_cache.size` setting on
non-frozen nodes in 7.12 with PR #70341. However, we didn't add a related item
to the 7.12 deprecation docs. This adds the missing item.

Relates to #71013.
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…he.size` (#77727) (#77765)

We deprecated the `xpack.searchable.snapshot.shared_cache.size` setting on
non-frozen nodes in 7.12 with PR #70341. However, we didn't add a related item
to the 7.12 deprecation docs. This adds the missing item.

Relates to #71013.
# Conflicts:
#	docs/reference/migration/migrate_7_12.asciidoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed Meta label for distributed team (obsolete) v7.12.0 v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants