File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,24 @@ public static Predicate<Index> getReindexRequiredPredicate(Metadata metadata) {
3333 }
3434
3535 public static boolean reindexRequired (IndexMetadata indexMetadata ) {
36- return creationVersionBeforeMinimumWritableVersion (indexMetadata ) && isNotSearchableSnapshot (indexMetadata );
36+ return creationVersionBeforeMinimumWritableVersion (indexMetadata )
37+ && isNotSearchableSnapshot (indexMetadata )
38+ && isNotIgnored (indexMetadata );
39+ }
40+
41+ private static boolean creationVersionBeforeMinimumWritableVersion (IndexMetadata metadata ) {
42+ return metadata .getCreationVersion ().before (MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE );
3743 }
3844
3945 private static boolean isNotSearchableSnapshot (IndexMetadata indexMetadata ) {
4046 return indexMetadata .isSearchableSnapshot () == false ;
4147 }
4248
43- private static boolean creationVersionBeforeMinimumWritableVersion (IndexMetadata metadata ) {
44- return metadata .getCreationVersion ().before (MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE );
49+ private static boolean isNotIgnored (IndexMetadata indexMetadata ) {
50+ IndexVersion ignoreVersion = indexMetadata .getSettings ()
51+ .getAsVersionId (IndexMetadata .INDEX_IGNORE_DEPRECATION_WARNING_FOR_VERSION_KEY , IndexVersion ::fromId );
52+
53+ return ignoreVersion == null || ignoreVersion .before (MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE );
4554 }
4655
4756}
You can’t perform that action at this time.
0 commit comments