1515import org .elasticsearch .cluster .block .ClusterBlockException ;
1616import org .elasticsearch .cluster .block .ClusterBlockLevel ;
1717import org .elasticsearch .cluster .metadata .IndexMetaData ;
18+ import org .elasticsearch .cluster .routing .UnassignedInfo ;
1819import org .elasticsearch .cluster .metadata .IndexNameExpressionResolver ;
1920import org .elasticsearch .cluster .routing .allocation .decider .EnableAllocationDecider ;
21+ import org .elasticsearch .cluster .routing .allocation .decider .MaxRetryAllocationDecider ;
2022import org .elasticsearch .cluster .routing .allocation .decider .ShardsLimitAllocationDecider ;
2123import org .elasticsearch .cluster .service .ClusterService ;
2224import org .elasticsearch .common .inject .Inject ;
2830import org .elasticsearch .index .IndexNotFoundException ;
2931import org .elasticsearch .index .IndexSettings ;
3032import org .elasticsearch .index .IndexingSlowLog ;
33+ import org .elasticsearch .index .MergePolicyConfig ;
34+ import org .elasticsearch .index .MergeSchedulerConfig ;
3135import org .elasticsearch .index .SearchSlowLog ;
3236import org .elasticsearch .index .cache .bitset .BitsetFilterCache ;
37+ import org .elasticsearch .index .engine .EngineConfig ;
3338import org .elasticsearch .index .mapper .MapperService ;
3439import org .elasticsearch .index .shard .ShardId ;
3540import org .elasticsearch .indices .IndicesRequestCache ;
@@ -335,21 +340,37 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
335340 return historyUUIDs .split ("," );
336341 }
337342
338- private static final Set <Setting <?>> WHITE_LISTED_SETTINGS ;
343+ /**
344+ * These are settings that are not replicated to the follower index and
345+ * therefor these settings are not validated whether they have the same
346+ * value between leader and follower index.
347+ *
348+ * These dynamic settings don't affect how documents are indexed (affect index time text analysis) and / or
349+ * are inconvenient if they were replicated (e.g. changing number of replicas).
350+ */
351+ static final Set <Setting <?>> WHITE_LISTED_SETTINGS ;
339352
340353 static {
341354 final Set <Setting <?>> whiteListedSettings = new HashSet <>();
342355 whiteListedSettings .add (IndexMetaData .INDEX_NUMBER_OF_REPLICAS_SETTING );
343356 whiteListedSettings .add (IndexMetaData .INDEX_AUTO_EXPAND_REPLICAS_SETTING );
344-
345357 whiteListedSettings .add (IndexMetaData .INDEX_ROUTING_EXCLUDE_GROUP_SETTING );
346358 whiteListedSettings .add (IndexMetaData .INDEX_ROUTING_INCLUDE_GROUP_SETTING );
347359 whiteListedSettings .add (IndexMetaData .INDEX_ROUTING_REQUIRE_GROUP_SETTING );
360+ whiteListedSettings .add (IndexMetaData .INDEX_READ_ONLY_SETTING );
361+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_READ_SETTING );
362+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_WRITE_SETTING );
363+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_METADATA_SETTING );
364+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_READ_ONLY_ALLOW_DELETE_SETTING );
365+ whiteListedSettings .add (IndexMetaData .INDEX_PRIORITY_SETTING );
366+ whiteListedSettings .add (IndexMetaData .SETTING_WAIT_FOR_ACTIVE_SHARDS );
367+
348368 whiteListedSettings .add (EnableAllocationDecider .INDEX_ROUTING_REBALANCE_ENABLE_SETTING );
349369 whiteListedSettings .add (EnableAllocationDecider .INDEX_ROUTING_ALLOCATION_ENABLE_SETTING );
350370 whiteListedSettings .add (ShardsLimitAllocationDecider .INDEX_TOTAL_SHARDS_PER_NODE_SETTING );
371+ whiteListedSettings .add (MaxRetryAllocationDecider .SETTING_ALLOCATION_MAX_RETRY );
372+ whiteListedSettings .add (UnassignedInfo .INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING );
351373
352- whiteListedSettings .add (IndicesRequestCache .INDEX_CACHE_REQUEST_ENABLED_SETTING );
353374 whiteListedSettings .add (IndexSettings .MAX_RESULT_WINDOW_SETTING );
354375 whiteListedSettings .add (IndexSettings .INDEX_WARMER_ENABLED_SETTING );
355376 whiteListedSettings .add (IndexSettings .INDEX_REFRESH_INTERVAL_SETTING );
@@ -361,6 +382,26 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
361382 whiteListedSettings .add (IndexSettings .QUERY_STRING_ALLOW_LEADING_WILDCARD );
362383 whiteListedSettings .add (IndexSettings .ALLOW_UNMAPPED );
363384 whiteListedSettings .add (IndexSettings .INDEX_SEARCH_IDLE_AFTER );
385+ whiteListedSettings .add (IndexSettings .INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING );
386+ whiteListedSettings .add (IndexSettings .MAX_SCRIPT_FIELDS_SETTING );
387+ whiteListedSettings .add (IndexSettings .MAX_REGEX_LENGTH_SETTING );
388+ whiteListedSettings .add (IndexSettings .MAX_TERMS_COUNT_SETTING );
389+ whiteListedSettings .add (IndexSettings .MAX_ANALYZED_OFFSET_SETTING );
390+ whiteListedSettings .add (IndexSettings .MAX_DOCVALUE_FIELDS_SEARCH_SETTING );
391+ whiteListedSettings .add (IndexSettings .MAX_TOKEN_COUNT_SETTING );
392+ whiteListedSettings .add (IndexSettings .MAX_SLICES_PER_SCROLL );
393+ whiteListedSettings .add (IndexSettings .MAX_ADJACENCY_MATRIX_FILTERS_SETTING );
394+ whiteListedSettings .add (IndexSettings .DEFAULT_PIPELINE );
395+ whiteListedSettings .add (IndexSettings .INDEX_SEARCH_THROTTLED );
396+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_RETENTION_AGE_SETTING );
397+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_RETENTION_SIZE_SETTING );
398+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_GENERATION_THRESHOLD_SIZE_SETTING );
399+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING );
400+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_DURABILITY_SETTING );
401+ whiteListedSettings .add (IndexSettings .INDEX_GC_DELETES_SETTING );
402+ whiteListedSettings .add (IndexSettings .MAX_REFRESH_LISTENERS_PER_SHARD );
403+
404+ whiteListedSettings .add (IndicesRequestCache .INDEX_CACHE_REQUEST_ENABLED_SETTING );
364405 whiteListedSettings .add (BitsetFilterCache .INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING );
365406
366407 whiteListedSettings .add (SearchSlowLog .INDEX_SEARCH_SLOWLOG_THRESHOLD_FETCH_DEBUG_SETTING );
@@ -380,7 +421,20 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
380421 whiteListedSettings .add (IndexingSlowLog .INDEX_INDEXING_SLOWLOG_REFORMAT_SETTING );
381422 whiteListedSettings .add (IndexingSlowLog .INDEX_INDEXING_SLOWLOG_MAX_SOURCE_CHARS_TO_LOG_SETTING );
382423
383- whiteListedSettings .add (IndexSettings .INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING );
424+ whiteListedSettings .add (MergePolicyConfig .INDEX_COMPOUND_FORMAT_SETTING );
425+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING );
426+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING );
427+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_DELETES_PCT_ALLOWED_SETTING );
428+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING );
429+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING );
430+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING );
431+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING );
432+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING );
433+
434+ whiteListedSettings .add (MergeSchedulerConfig .AUTO_THROTTLE_SETTING );
435+ whiteListedSettings .add (MergeSchedulerConfig .MAX_MERGE_COUNT_SETTING );
436+ whiteListedSettings .add (MergeSchedulerConfig .MAX_THREAD_COUNT_SETTING );
437+ whiteListedSettings .add (EngineConfig .INDEX_CODEC_SETTING );
384438
385439 WHITE_LISTED_SETTINGS = Collections .unmodifiableSet (whiteListedSettings );
386440 }
0 commit comments