Deprecate setting shared cache on non-frozen nodes#70341
Deprecate setting shared cache on non-frozen nodes#70341jasontedor merged 7 commits intoelastic:masterfrom
Conversation
This commit deprecates the ability to set the shared cache to be positive on non-frozen nodes.
|
Pinging @elastic/es-distributed (Team:Distributed) |
dakrone
left a comment
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
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())
There was a problem hiding this comment.
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) { | ||
|
|
There was a problem hiding this comment.
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.
| @@ -0,0 +1 @@ | |||
| preallocate: org.elasticsearch.xpack.searchablesnapshots.preallocate.Preallocate | |||
There was a problem hiding this comment.
This seems unrelated to this change?
There was a problem hiding this comment.
It's needed to be able to run the relevant unit tests inside of IntelliJ.
...hots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/FrozenCacheService.java
Outdated
Show resolved
Hide resolved
…arch/xpack/searchablesnapshots/cache/FrozenCacheService.java Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
...src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/FrozenCacheServiceTests.java
Outdated
Show resolved
Hide resolved
…arch/xpack/searchablesnapshots/cache/FrozenCacheServiceTests.java Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
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.
…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
…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
…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
… 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
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
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
…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
…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
This commit deprecates the ability to set the shared cache to be positive on non-frozen nodes.