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 ;
@@ -334,21 +339,37 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
334339 return historyUUIDs .split ("," );
335340 }
336341
337- private static final Set <Setting <?>> WHITE_LISTED_SETTINGS ;
342+ /**
343+ * These are settings that are not replicated to the follower index and
344+ * therefor these settings are not validated whether they have the same
345+ * value between leader and follower index.
346+ *
347+ * These dynamic settings don't affect how documents are indexed (affect index time text analysis) and / or
348+ * are inconvenient if they were replicated (e.g. changing number of replicas).
349+ */
350+ static final Set <Setting <?>> WHITE_LISTED_SETTINGS ;
338351
339352 static {
340353 final Set <Setting <?>> whiteListedSettings = new HashSet <>();
341354 whiteListedSettings .add (IndexMetaData .INDEX_NUMBER_OF_REPLICAS_SETTING );
342355 whiteListedSettings .add (IndexMetaData .INDEX_AUTO_EXPAND_REPLICAS_SETTING );
343-
344356 whiteListedSettings .add (IndexMetaData .INDEX_ROUTING_EXCLUDE_GROUP_SETTING );
345357 whiteListedSettings .add (IndexMetaData .INDEX_ROUTING_INCLUDE_GROUP_SETTING );
346358 whiteListedSettings .add (IndexMetaData .INDEX_ROUTING_REQUIRE_GROUP_SETTING );
359+ whiteListedSettings .add (IndexMetaData .INDEX_READ_ONLY_SETTING );
360+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_READ_SETTING );
361+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_WRITE_SETTING );
362+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_METADATA_SETTING );
363+ whiteListedSettings .add (IndexMetaData .INDEX_BLOCKS_READ_ONLY_ALLOW_DELETE_SETTING );
364+ whiteListedSettings .add (IndexMetaData .INDEX_PRIORITY_SETTING );
365+ whiteListedSettings .add (IndexMetaData .SETTING_WAIT_FOR_ACTIVE_SHARDS );
366+
347367 whiteListedSettings .add (EnableAllocationDecider .INDEX_ROUTING_REBALANCE_ENABLE_SETTING );
348368 whiteListedSettings .add (EnableAllocationDecider .INDEX_ROUTING_ALLOCATION_ENABLE_SETTING );
349369 whiteListedSettings .add (ShardsLimitAllocationDecider .INDEX_TOTAL_SHARDS_PER_NODE_SETTING );
370+ whiteListedSettings .add (MaxRetryAllocationDecider .SETTING_ALLOCATION_MAX_RETRY );
371+ whiteListedSettings .add (UnassignedInfo .INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING );
350372
351- whiteListedSettings .add (IndicesRequestCache .INDEX_CACHE_REQUEST_ENABLED_SETTING );
352373 whiteListedSettings .add (IndexSettings .MAX_RESULT_WINDOW_SETTING );
353374 whiteListedSettings .add (IndexSettings .INDEX_WARMER_ENABLED_SETTING );
354375 whiteListedSettings .add (IndexSettings .INDEX_REFRESH_INTERVAL_SETTING );
@@ -359,6 +380,26 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
359380 whiteListedSettings .add (IndexSettings .QUERY_STRING_ANALYZE_WILDCARD );
360381 whiteListedSettings .add (IndexSettings .QUERY_STRING_ALLOW_LEADING_WILDCARD );
361382 whiteListedSettings .add (IndexSettings .ALLOW_UNMAPPED );
383+ whiteListedSettings .add (IndexSettings .INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING );
384+ whiteListedSettings .add (IndexSettings .MAX_SCRIPT_FIELDS_SETTING );
385+ whiteListedSettings .add (IndexSettings .MAX_REGEX_LENGTH_SETTING );
386+ whiteListedSettings .add (IndexSettings .MAX_TERMS_COUNT_SETTING );
387+ whiteListedSettings .add (IndexSettings .MAX_ANALYZED_OFFSET_SETTING );
388+ whiteListedSettings .add (IndexSettings .MAX_DOCVALUE_FIELDS_SEARCH_SETTING );
389+ whiteListedSettings .add (IndexSettings .MAX_SLICES_PER_SCROLL );
390+ whiteListedSettings .add (IndexSettings .MAX_ADJACENCY_MATRIX_FILTERS_SETTING );
391+ whiteListedSettings .add (IndexSettings .DEFAULT_PIPELINE );
392+ whiteListedSettings .add (IndexSettings .INDEX_SEARCH_THROTTLED );
393+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_RETENTION_AGE_SETTING );
394+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_RETENTION_SIZE_SETTING );
395+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_GENERATION_THRESHOLD_SIZE_SETTING );
396+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING );
397+ whiteListedSettings .add (IndexSettings .INDEX_TRANSLOG_DURABILITY_SETTING );
398+ whiteListedSettings .add (IndexSettings .INDEX_GC_DELETES_SETTING );
399+ whiteListedSettings .add (IndexSettings .INDEX_TTL_DISABLE_PURGE_SETTING );
400+ whiteListedSettings .add (IndexSettings .MAX_REFRESH_LISTENERS_PER_SHARD );
401+
402+ whiteListedSettings .add (IndicesRequestCache .INDEX_CACHE_REQUEST_ENABLED_SETTING );
362403 whiteListedSettings .add (BitsetFilterCache .INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING );
363404
364405 whiteListedSettings .add (SearchSlowLog .INDEX_SEARCH_SLOWLOG_THRESHOLD_FETCH_DEBUG_SETTING );
@@ -378,7 +419,20 @@ static String[] extractLeaderShardHistoryUUIDs(Map<String, String> ccrIndexMetaD
378419 whiteListedSettings .add (IndexingSlowLog .INDEX_INDEXING_SLOWLOG_REFORMAT_SETTING );
379420 whiteListedSettings .add (IndexingSlowLog .INDEX_INDEXING_SLOWLOG_MAX_SOURCE_CHARS_TO_LOG_SETTING );
380421
381- whiteListedSettings .add (IndexSettings .INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING );
422+ whiteListedSettings .add (MergePolicyConfig .INDEX_COMPOUND_FORMAT_SETTING );
423+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING );
424+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING );
425+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_DELETES_PCT_ALLOWED_SETTING );
426+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING );
427+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING );
428+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING );
429+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING );
430+ whiteListedSettings .add (MergePolicyConfig .INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING );
431+
432+ whiteListedSettings .add (MergeSchedulerConfig .AUTO_THROTTLE_SETTING );
433+ whiteListedSettings .add (MergeSchedulerConfig .MAX_MERGE_COUNT_SETTING );
434+ whiteListedSettings .add (MergeSchedulerConfig .MAX_THREAD_COUNT_SETTING );
435+ whiteListedSettings .add (EngineConfig .INDEX_CODEC_SETTING );
382436
383437 WHITE_LISTED_SETTINGS = Collections .unmodifiableSet (whiteListedSettings );
384438 }
0 commit comments