From 65e0502d3ba7a333af915a56db481978e7b00ec5 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Wed, 3 Nov 2021 10:52:35 +0100 Subject: [PATCH] Rename shared cache static constant settings (#79999) (#80255) The FrozenCacheService contains various settings whose Java static constants have a different prefix: FROZEN_CACHE_*, SNAPSHOT_CACHE_* or SHARED_CACHE_*. This commit renames the constants so that they all start with SHARED_CACHE_ prefix. --- ...bstractFrozenAutoscalingIntegTestCase.java | 2 +- ...rozenSearchableSnapshotsIntegTestCase.java | 2 +- .../BaseSearchableSnapshotsIntegTestCase.java | 6 +- ...pshotsCanMatchOnCoordinatorIntegTests.java | 2 +- ...ableSnapshotsBlobStoreCacheIntegTests.java | 6 +- .../shared/NodesCachesStatsIntegTests.java | 2 +- ...tiallyCachedShardAllocationIntegTests.java | 12 ++-- .../SearchableSnapshots.java | 14 ++-- .../cache/FrozenCacheInfoNodeAction.java | 4 +- .../HasFrozenCacheAllocationDecider.java | 6 +- .../cache/shared/FrozenCacheService.java | 48 ++++++------- .../AbstractSearchableSnapshotsTestCase.java | 11 +-- .../cache/shared/FrozenCacheServiceTests.java | 71 +++++++++---------- .../store/input/FrozenIndexInputTests.java | 6 +- 14 files changed, 93 insertions(+), 99 deletions(-) diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java index 8495d6528c465..11af239b1f113 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java @@ -85,7 +85,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { .put(super.nodeSettings(nodeOrdinal, otherSettings)) .put(SELF_GENERATED_LICENSE_TYPE.getKey(), "trial"); if (DiscoveryNode.hasRole(otherSettings, DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE)) { - builder.put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(10, ByteSizeUnit.MB)); + builder.put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(10, ByteSizeUnit.MB)); } return builder.build(); } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseFrozenSearchableSnapshotsIntegTestCase.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseFrozenSearchableSnapshotsIntegTestCase.java index 2332c38dca26e..641a03f471707 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseFrozenSearchableSnapshotsIntegTestCase.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseFrozenSearchableSnapshotsIntegTestCase.java @@ -25,7 +25,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings)); if (DiscoveryNode.canContainData(otherSettings)) { builder.put( - FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), + FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), rarely() ? randomBoolean() ? new ByteSizeValue(randomIntBetween(1, 10), ByteSizeUnit.KB).getStringRep() diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java index a43324b4f99ab..eb8e384c3059c 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java @@ -93,10 +93,10 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { ); } if (randomBoolean()) { - builder.put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ZERO.getStringRep()); + builder.put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ZERO.getStringRep()); } builder.put( - FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), + FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), rarely() ? pageAligned(new ByteSizeValue(randomIntBetween(4, 1024), ByteSizeUnit.KB)) : pageAligned(new ByteSizeValue(randomIntBetween(1, 10), ByteSizeUnit.MB)) @@ -111,7 +111,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { } if (randomBoolean()) { builder.put( - FrozenCacheService.FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), + FrozenCacheService.SHARED_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), rarely() ? pageAligned(new ByteSizeValue(randomIntBetween(4, 1024), ByteSizeUnit.KB)) : pageAligned(new ByteSizeValue(randomIntBetween(1, 10), ByteSizeUnit.MB)) diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java index 30f28a1a1043a..eaee93f710606 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java @@ -65,7 +65,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings nodeSettings) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal, nodeSettings)) // Have a shared cache of reasonable size available on each node because tests randomize over frozen and cold allocation - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ofMb(randomLongBetween(1, 10))) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ofMb(randomLongBetween(1, 10))) .build(); } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java index b2c10812a9caf..96887780492fd 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java @@ -86,11 +86,11 @@ public static void setUpCacheSettings() { builder.put(CacheService.SNAPSHOT_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), blobCacheMaxLength); // Frozen (shared cache) cache should be large enough to not cause direct reads - builder.put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ofMb(128)); + builder.put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ofMb(128)); // Align ranges to match the blob cache max length - builder.put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), blobCacheMaxLength); + builder.put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), blobCacheMaxLength); builder.put(FrozenCacheService.SHARED_CACHE_RANGE_SIZE_SETTING.getKey(), blobCacheMaxLength); - builder.put(FrozenCacheService.FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), blobCacheMaxLength); + builder.put(FrozenCacheService.SHARED_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), blobCacheMaxLength); cacheSettings = builder.build(); } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/NodesCachesStatsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/NodesCachesStatsIntegTests.java index 52caa962a3e2e..541b32c2273d7 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/NodesCachesStatsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/NodesCachesStatsIntegTests.java @@ -96,7 +96,7 @@ public void testNodesCachesStats() throws Exception { final long cacheSize = FrozenCacheService.calculateCacheSize(clusterService.getSettings(), totalFsSize); assertThat(nodeCachesStats.getSize(), equalTo(cacheSize)); - final long regionSize = FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.get(clusterService.getSettings()).getBytes(); + final long regionSize = FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.get(clusterService.getSettings()).getBytes(); assertThat(nodeCachesStats.getRegionSize(), equalTo(regionSize)); assertThat(nodeCachesStats.getNumRegions(), equalTo(Math.toIntExact(cacheSize / regionSize))); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java index d95f840d916e7..bc1edfe1e20ac 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java @@ -54,7 +54,7 @@ import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING; import static org.elasticsearch.test.NodeRoles.onlyRole; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; -import static org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING; +import static org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.SHARED_CACHE_SIZE_SETTING; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; @@ -65,7 +65,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal, otherSettings)) // default to no cache: the tests create nodes with a cache configured as needed - .put(SNAPSHOT_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ZERO) + .put(SHARED_CACHE_SIZE_SETTING.getKey(), ByteSizeValue.ZERO) .build(); } @@ -123,7 +123,7 @@ public void testPartialSearchableSnapshotNotAllocatedToNodesWithoutCache() throw .getDecisions() .stream() .anyMatch( - d -> d.getExplanation().contains(SNAPSHOT_CACHE_SIZE_SETTING.getKey()) + d -> d.getExplanation().contains(SHARED_CACHE_SIZE_SETTING.getKey()) && d.getExplanation().contains("frozen searchable snapshot shards cannot be allocated to this node") ) ); @@ -136,7 +136,7 @@ public void testPartialSearchableSnapshotAllocatedToNodesWithCache() throws Exce final List newNodeNames = internalCluster().startDataOnlyNodes( between(1, 3), Settings.builder() - .put(SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(randomLongBetween(1, ByteSizeValue.ofMb(10).getBytes()))) + .put(SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(randomLongBetween(1, ByteSizeValue.ofMb(10).getBytes()))) .build() ); @@ -158,7 +158,7 @@ public void testOnlyPartialSearchableSnapshotAllocatedToDedicatedFrozenNodes() t final List newNodeNames = internalCluster().startNodes( between(1, 3), Settings.builder() - .put(SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(randomLongBetween(1, ByteSizeValue.ofMb(10).getBytes()))) + .put(SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(randomLongBetween(1, ByteSizeValue.ofMb(10).getBytes()))) .put(onlyRole(DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE)) .build() ); @@ -244,7 +244,7 @@ public void onFailure(Exception e) { final List newNodes = internalCluster().startDataOnlyNodes( 2, Settings.builder() - .put(SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(randomLongBetween(1, ByteSizeValue.ofMb(10).getBytes()))) + .put(SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(randomLongBetween(1, ByteSizeValue.ofMb(10).getBytes()))) .build() ); final ActionFuture responseFuture = client().execute(MountSearchableSnapshotAction.INSTANCE, req); diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index c58e579150283..c3b44782f0d6d 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -296,14 +296,14 @@ public List> getSettings() { CacheService.SNAPSHOT_CACHE_MAX_FILES_TO_SYNC_AT_ONCE_SETTING, CacheService.SNAPSHOT_CACHE_SYNC_SHUTDOWN_TIMEOUT, SearchableSnapshotEnableAllocationDecider.SEARCHABLE_SNAPSHOTS_ALLOCATE_ON_ROLLING_RESTART, - FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING, - FrozenCacheService.SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING, - FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING, + FrozenCacheService.SHARED_CACHE_SIZE_SETTING, + FrozenCacheService.SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING, + FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING, FrozenCacheService.SHARED_CACHE_RANGE_SIZE_SETTING, - FrozenCacheService.FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING, - FrozenCacheService.SNAPSHOT_CACHE_MAX_FREQ_SETTING, - FrozenCacheService.SNAPSHOT_CACHE_DECAY_INTERVAL_SETTING, - FrozenCacheService.SNAPSHOT_CACHE_MIN_TIME_DELTA_SETTING, + FrozenCacheService.SHARED_CACHE_RECOVERY_RANGE_SIZE_SETTING, + FrozenCacheService.SHARED_CACHE_MAX_FREQ_SETTING, + FrozenCacheService.SHARED_CACHE_DECAY_INTERVAL_SETTING, + FrozenCacheService.SHARED_CACHE_MIN_TIME_DELTA_SETTING, BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING, BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_KEEP_ALIVE_SETTING, BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_BATCH_SIZE_SETTING, diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/FrozenCacheInfoNodeAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/FrozenCacheInfoNodeAction.java index 55b544072b044..3cbb60de13389 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/FrozenCacheInfoNodeAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/FrozenCacheInfoNodeAction.java @@ -21,7 +21,7 @@ import java.io.IOException; -import static org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING; +import static org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.SHARED_CACHE_SIZE_SETTING; public class FrozenCacheInfoNodeAction extends ActionType { @@ -53,7 +53,7 @@ public static class TransportAction extends HandledTransportAction SHARED_CACHE_RANGE_SIZE_SETTING = new Setting<>( @@ -81,7 +77,7 @@ public class FrozenCacheService implements Releasable { Setting.Property.NodeScope ); - public static final Setting FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING = new Setting<>( + public static final Setting SHARED_CACHE_RECOVERY_RANGE_SIZE_SETTING = new Setting<>( SHARED_CACHE_SETTINGS_PREFIX + "recovery_range_size", ByteSizeValue.ofKb(128L).getStringRep(), s -> ByteSizeValue.parseBytesSizeValue(s, SHARED_CACHE_SETTINGS_PREFIX + "recovery_range_size"), @@ -89,7 +85,7 @@ public class FrozenCacheService implements Releasable { Setting.Property.NodeScope ); - public static final Setting SNAPSHOT_CACHE_REGION_SIZE_SETTING = new Setting<>( + public static final Setting SHARED_CACHE_REGION_SIZE_SETTING = new Setting<>( SHARED_CACHE_SETTINGS_PREFIX + "region_size", SHARED_CACHE_RANGE_SIZE_SETTING, s -> ByteSizeValue.parseBytesSizeValue(s, SHARED_CACHE_SETTINGS_PREFIX + "region_size"), @@ -117,7 +113,7 @@ private static Setting.Validator getPositivePageSizeAlignedByteSi }; } - public static final Setting SNAPSHOT_CACHE_SIZE_SETTING = new Setting( + public static final Setting SHARED_CACHE_SIZE_SETTING = new Setting( new Setting.SimpleKey(SHARED_CACHE_SETTINGS_PREFIX + "size"), (settings) -> { if (DiscoveryNode.isDedicatedFrozenNode(settings)) { @@ -158,7 +154,7 @@ public void validate(final RelativeByteSizeValue value, final Map, Ob if (dataPaths.size() > 1) { throw new SettingsException( "setting [{}={}] is not permitted on nodes with multiple data paths [{}]", - SNAPSHOT_CACHE_SIZE_SETTING.getKey(), + SHARED_CACHE_SIZE_SETTING.getKey(), value.getStringRep(), String.join(",", dataPaths) ); @@ -188,10 +184,10 @@ public RelativeByteSizeValue get(final Settings settings) { } }; - public static final Setting SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING = new Setting<>( + public static final Setting SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING = new Setting( new Setting.SimpleKey(SHARED_CACHE_SETTINGS_PREFIX + "size.max_headroom"), (settings) -> { - if (SNAPSHOT_CACHE_SIZE_SETTING.exists(settings) == false && DiscoveryNode.isDedicatedFrozenNode(settings)) { + if (SHARED_CACHE_SIZE_SETTING.exists(settings) == false && DiscoveryNode.isDedicatedFrozenNode(settings)) { return "100GB"; } @@ -199,7 +195,7 @@ public RelativeByteSizeValue get(final Settings settings) { }, (s) -> ByteSizeValue.parseBytesSizeValue(s, SHARED_CACHE_SETTINGS_PREFIX + "size.max_headroom"), new Setting.Validator() { - private final Collection> dependencies = Collections.singletonList(SNAPSHOT_CACHE_SIZE_SETTING); + private final Collection> dependencies = Collections.singletonList(SHARED_CACHE_SIZE_SETTING); @Override public Iterator> settings() { @@ -214,12 +210,12 @@ public void validate(ByteSizeValue value) { @Override public void validate(ByteSizeValue value, Map, Object> settings, boolean isPresent) { if (isPresent && value.getBytes() != -1) { - RelativeByteSizeValue sizeValue = (RelativeByteSizeValue) settings.get(SNAPSHOT_CACHE_SIZE_SETTING); + RelativeByteSizeValue sizeValue = (RelativeByteSizeValue) settings.get(SHARED_CACHE_SIZE_SETTING); if (sizeValue.isAbsolute()) { throw new SettingsException( "setting [{}] cannot be specified for absolute [{}={}]", - SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.getKey(), - SNAPSHOT_CACHE_SIZE_SETTING.getKey(), + SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.getKey(), + SHARED_CACHE_SIZE_SETTING.getKey(), sizeValue.getStringRep() ); } @@ -229,23 +225,23 @@ public void validate(ByteSizeValue value, Map, Object> settings, bool Setting.Property.NodeScope ); - public static final TimeValue MIN_SNAPSHOT_CACHE_DECAY_INTERVAL = TimeValue.timeValueSeconds(1L); - public static final Setting SNAPSHOT_CACHE_DECAY_INTERVAL_SETTING = Setting.timeSetting( + public static final TimeValue MIN_SHARED_CACHE_DECAY_INTERVAL = TimeValue.timeValueSeconds(1L); + public static final Setting SHARED_CACHE_DECAY_INTERVAL_SETTING = Setting.timeSetting( SHARED_CACHE_SETTINGS_PREFIX + "decay.interval", TimeValue.timeValueSeconds(60L), // default - MIN_SNAPSHOT_CACHE_DECAY_INTERVAL, // min + MIN_SHARED_CACHE_DECAY_INTERVAL, // min Setting.Property.NodeScope, Setting.Property.Dynamic ); - public static final Setting SNAPSHOT_CACHE_MAX_FREQ_SETTING = Setting.intSetting( + public static final Setting SHARED_CACHE_MAX_FREQ_SETTING = Setting.intSetting( SHARED_CACHE_SETTINGS_PREFIX + "max_freq", 100, // default 1, // min Setting.Property.NodeScope ); - public static final Setting SNAPSHOT_CACHE_MIN_TIME_DELTA_SETTING = Setting.timeSetting( + public static final Setting SHARED_CACHE_MIN_TIME_DELTA_SETTING = Setting.timeSetting( SHARED_CACHE_SETTINGS_PREFIX + "min_time_delta", TimeValue.timeValueSeconds(60L), // default TimeValue.timeValueSeconds(0L), // min @@ -295,7 +291,7 @@ public FrozenCacheService(NodeEnvironment environment, Settings settings, Thread throw new IllegalStateException("unable to probe size of filesystem [" + environment.nodeDataPaths()[0] + "]"); } this.cacheSize = calculateCacheSize(settings, totalFsSize); - final long regionSize = SNAPSHOT_CACHE_REGION_SIZE_SETTING.get(settings).getBytes(); + final long regionSize = SHARED_CACHE_REGION_SIZE_SETTING.get(settings).getBytes(); this.numRegions = Math.toIntExact(cacheSize / regionSize); keyMapping = new ConcurrentHashMap<>(); if (Assertions.ENABLED) { @@ -311,23 +307,23 @@ public FrozenCacheService(NodeEnvironment environment, Settings settings, Thread } this.regionSize = regionSize; assert regionSize > 0L; - this.maxFreq = SNAPSHOT_CACHE_MAX_FREQ_SETTING.get(settings); - this.minTimeDelta = SNAPSHOT_CACHE_MIN_TIME_DELTA_SETTING.get(settings).millis(); + this.maxFreq = SHARED_CACHE_MAX_FREQ_SETTING.get(settings); + this.minTimeDelta = SHARED_CACHE_MIN_TIME_DELTA_SETTING.get(settings).millis(); freqs = new Entry[maxFreq]; try { sharedBytes = new SharedBytes(numRegions, regionSize, environment, writeBytes::add, readBytes::add); } catch (IOException e) { throw new UncheckedIOException(e); } - decayTask = new CacheDecayTask(threadPool, SNAPSHOT_CACHE_DECAY_INTERVAL_SETTING.get(settings)); + decayTask = new CacheDecayTask(threadPool, SHARED_CACHE_DECAY_INTERVAL_SETTING.get(settings)); decayTask.rescheduleIfNecessary(); this.rangeSize = SHARED_CACHE_RANGE_SIZE_SETTING.get(settings); - this.recoveryRangeSize = FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING.get(settings); + this.recoveryRangeSize = SHARED_CACHE_RECOVERY_RANGE_SIZE_SETTING.get(settings); } static long calculateCacheSize(Settings settings, long totalFsSize) { - return SNAPSHOT_CACHE_SIZE_SETTING.get(settings) - .calculateValue(ByteSizeValue.ofBytes(totalFsSize), SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings)) + return SHARED_CACHE_SIZE_SETTING.get(settings) + .calculateValue(ByteSizeValue.ofBytes(totalFsSize), SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings)) .getBytes(); } diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsTestCase.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsTestCase.java index 48ab2260f421b..71578dafd6ece 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsTestCase.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsTestCase.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.lucene.store.ESIndexInputTestCase; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.core.Set; @@ -152,16 +153,16 @@ protected FrozenCacheService defaultFrozenCacheService() { protected FrozenCacheService randomFrozenCacheService() { final Settings.Builder cacheSettings = Settings.builder(); if (randomBoolean()) { - cacheSettings.put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), randomFrozenCacheSize()); + cacheSettings.put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), randomFrozenCacheSize()); } if (randomBoolean()) { - cacheSettings.put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), pageAligned(randomFrozenCacheSize())); + cacheSettings.put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), pageAligned(randomFrozenCacheSize())); } if (randomBoolean()) { cacheSettings.put(FrozenCacheService.SHARED_CACHE_RANGE_SIZE_SETTING.getKey(), randomFrozenCacheRangeSize()); } if (randomBoolean()) { - cacheSettings.put(FrozenCacheService.FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), randomFrozenCacheRangeSize()); + cacheSettings.put(FrozenCacheService.SHARED_CACHE_RECOVERY_RANGE_SIZE_SETTING.getKey(), randomFrozenCacheRangeSize()); } return new FrozenCacheService(singlePathNodeEnvironment, cacheSettings.build(), threadPool); } @@ -182,7 +183,7 @@ protected FrozenCacheService createFrozenCacheService(final ByteSizeValue cacheS return new FrozenCacheService( singlePathNodeEnvironment, Settings.builder() - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), cacheSize) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), cacheSize) .put(FrozenCacheService.SHARED_CACHE_RANGE_SIZE_SETTING.getKey(), cacheRangeSize) .build(), threadPool @@ -216,7 +217,7 @@ protected static ByteSizeValue randomCacheRangeSize() { } protected static ByteSizeValue randomFrozenCacheRangeSize() { - return pageAlignedBetween(FrozenCacheService.MIN_SNAPSHOT_CACHE_RANGE_SIZE, FrozenCacheService.MAX_SNAPSHOT_CACHE_RANGE_SIZE); + return pageAlignedBetween(new ByteSizeValue(4, ByteSizeUnit.KB), new ByteSizeValue(Integer.MAX_VALUE, ByteSizeUnit.BYTES)); } private static ByteSizeValue pageAlignedBetween(ByteSizeValue min, ByteSizeValue max) { diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheServiceTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheServiceTests.java index 325475485eafe..969f3fad859b3 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheServiceTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheServiceTests.java @@ -49,8 +49,8 @@ private static long size(long numPages) { public void testBasicEviction() throws IOException { Settings settings = Settings.builder() .put(NODE_NAME_SETTING.getKey(), "node") - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .put("path.home", createTempDir()) .build(); final DeterministicTaskQueue taskQueue = new DeterministicTaskQueue(); @@ -94,8 +94,8 @@ public void testBasicEviction() throws IOException { public void testAutoEviction() throws IOException { Settings settings = Settings.builder() .put(NODE_NAME_SETTING.getKey(), "node") - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(200)).getStringRep()) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(200)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .put("path.home", createTempDir()) .build(); final DeterministicTaskQueue taskQueue = new DeterministicTaskQueue(); @@ -130,8 +130,8 @@ public void testAutoEviction() throws IOException { public void testForceEviction() throws IOException { Settings settings = Settings.builder() .put(NODE_NAME_SETTING.getKey(), "node") - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .put("path.home", createTempDir()) .build(); final DeterministicTaskQueue taskQueue = new DeterministicTaskQueue(); @@ -158,8 +158,8 @@ public void testForceEviction() throws IOException { public void testDecay() throws IOException { Settings settings = Settings.builder() .put(NODE_NAME_SETTING.getKey(), "node") - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .put("path.home", createTempDir()) .build(); final DeterministicTaskQueue taskQueue = new DeterministicTaskQueue(); @@ -212,14 +212,14 @@ public void testDecay() throws IOException { public void testCacheSizeDeprecatedOnNonFrozenNodes() { String cacheSize = randomBoolean() ? new ByteSizeValue(size(500)).getStringRep() : new RatioValue(between(1, 100)).toString(); final Settings settings = Settings.builder() - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), cacheSize) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), cacheSize) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .putList(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), DiscoveryNodeRole.DATA_HOT_NODE_ROLE.roleName()) .build(); - FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.get(settings); + FrozenCacheService.SHARED_CACHE_SIZE_SETTING.get(settings); assertWarnings( "setting [" - + FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey() + + FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey() + "] to be positive [" + cacheSize + "] on node without the data_frozen role is deprecated, roles are [data_hot]" @@ -228,15 +228,15 @@ public void testCacheSizeDeprecatedOnNonFrozenNodes() { public void testCacheSizeReturnsZeroOnNonFrozenNodes() { final Settings settings = Settings.builder() - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .putList(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), DiscoveryNodeRole.DATA_HOT_NODE_ROLE.roleName()) .build(); - final RelativeByteSizeValue value = FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.get(settings); + final RelativeByteSizeValue value = FrozenCacheService.SHARED_CACHE_SIZE_SETTING.get(settings); assertThat(value.isNonZeroSize(), is(false)); assertWarnings( "setting [" - + FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey() + + FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey() + "] to be positive [" + new ByteSizeValue(size(500)).getStringRep() + "] on node without the data_frozen role is deprecated, roles are [data_hot]" @@ -245,13 +245,13 @@ public void testCacheSizeReturnsZeroOnNonFrozenNodes() { public void testMultipleDataPathsRejectedOnFrozenNodes() { final Settings settings = Settings.builder() - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(500)).getStringRep()) .putList(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE.roleName()) .putList(Environment.PATH_DATA_SETTING.getKey(), List.of("a", "b")) .build(); final IllegalArgumentException e = expectThrows( IllegalArgumentException.class, - () -> FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.get(settings) + () -> FrozenCacheService.SHARED_CACHE_SIZE_SETTING.get(settings) ); assertThat(e.getCause(), notNullValue()); assertThat(e.getCause(), instanceOf(SettingsException.class)); @@ -259,7 +259,7 @@ public void testMultipleDataPathsRejectedOnFrozenNodes() { e.getCause().getMessage(), is( "setting [" - + FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey() + + FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey() + "=" + new ByteSizeValue(size(500)).getStringRep() + "] is not permitted on nodes with multiple data paths [a,b]" @@ -272,11 +272,11 @@ public void testDedicateFrozenCacheSizeDefaults() { .putList(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE.roleName()) .build(); - RelativeByteSizeValue relativeCacheSize = FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.get(settings); + RelativeByteSizeValue relativeCacheSize = FrozenCacheService.SHARED_CACHE_SIZE_SETTING.get(settings); assertThat(relativeCacheSize.isAbsolute(), is(false)); assertThat(relativeCacheSize.isNonZeroSize(), is(true)); assertThat(relativeCacheSize.calculateValue(ByteSizeValue.ofBytes(10000), null), equalTo(ByteSizeValue.ofBytes(9000))); - assertThat(FrozenCacheService.SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings), equalTo(ByteSizeValue.ofGb(100))); + assertThat(FrozenCacheService.SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings), equalTo(ByteSizeValue.ofGb(100))); } public void testNotDedicatedFrozenCacheSizeDefaults() { @@ -304,23 +304,23 @@ public void testNotDedicatedFrozenCacheSizeDefaults() { ) .build(); - RelativeByteSizeValue relativeCacheSize = FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.get(settings); + RelativeByteSizeValue relativeCacheSize = FrozenCacheService.SHARED_CACHE_SIZE_SETTING.get(settings); assertThat(relativeCacheSize.isNonZeroSize(), is(false)); assertThat(relativeCacheSize.isAbsolute(), is(true)); assertThat(relativeCacheSize.getAbsolute(), equalTo(ByteSizeValue.ZERO)); - assertThat(FrozenCacheService.SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings), equalTo(ByteSizeValue.ofBytes(-1))); + assertThat(FrozenCacheService.SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings), equalTo(ByteSizeValue.ofBytes(-1))); } public void testMaxHeadroomRejectedForAbsoluteCacheSize() { String cacheSize = new ByteSizeValue(size(500)).getStringRep(); final Settings settings = Settings.builder() - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), cacheSize) - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), cacheSize) + .put(FrozenCacheService.SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .putList(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE.roleName()) .build(); final IllegalArgumentException e = expectThrows( IllegalArgumentException.class, - () -> FrozenCacheService.SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings) + () -> FrozenCacheService.SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.get(settings) ); assertThat(e.getCause(), notNullValue()); assertThat(e.getCause(), instanceOf(SettingsException.class)); @@ -328,9 +328,9 @@ public void testMaxHeadroomRejectedForAbsoluteCacheSize() { e.getCause().getMessage(), is( "setting [" - + FrozenCacheService.SNAPSHOT_CACHE_SIZE_MAX_HEADROOM_SETTING.getKey() + + FrozenCacheService.SHARED_CACHE_SIZE_MAX_HEADROOM_SETTING.getKey() + "] cannot be specified for absolute [" - + FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey() + + FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey() + "=" + cacheSize + "]" @@ -362,8 +362,8 @@ public void testCacheSizeChanges() throws IOException { ByteSizeValue val1 = new ByteSizeValue(randomIntBetween(1, 5), ByteSizeUnit.MB); Settings settings = Settings.builder() .put(NODE_NAME_SETTING.getKey(), "node") - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), val1.getStringRep()) - .put(FrozenCacheService.SNAPSHOT_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), val1.getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .put("path.home", createTempDir()) .build(); final DeterministicTaskQueue taskQueue = new DeterministicTaskQueue(); @@ -375,10 +375,7 @@ public void testCacheSizeChanges() throws IOException { } ByteSizeValue val2 = new ByteSizeValue(randomIntBetween(1, 5), ByteSizeUnit.MB); - settings = Settings.builder() - .put(settings) - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), val2.getStringRep()) - .build(); + settings = Settings.builder().put(settings).put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), val2.getStringRep()).build(); try ( NodeEnvironment environment = new NodeEnvironment(settings, TestEnvironment.newEnvironment(settings)); FrozenCacheService cacheService = new FrozenCacheService(environment, settings, taskQueue.getThreadPool()) @@ -390,7 +387,7 @@ public void testCacheSizeChanges() throws IOException { private void assertThatNonPositiveRecoveryRangeSizeRejected(Setting setting) { final String value = randomFrom(ByteSizeValue.MINUS_ONE, ByteSizeValue.ZERO).getStringRep(); final Settings settings = Settings.builder() - .put(FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) + .put(FrozenCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), new ByteSizeValue(size(100)).getStringRep()) .putList(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE.roleName()) .put(setting.getKey(), value) .build(); @@ -401,7 +398,7 @@ private void assertThatNonPositiveRecoveryRangeSizeRejected(Setting