Skip to content

Commit

Permalink
read_only
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrx committed Jan 21, 2025
1 parent 13a0536 commit c335134
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ private static boolean isReadOnlyCompatible(
}

private static boolean hasIndexWritesBlock(IndexMetadata indexMetadata) {
if (IndexMetadata.INDEX_BLOCKS_WRITE_SETTING.get(indexMetadata.getSettings())) {
var indexSettings = indexMetadata.getSettings();
if (IndexMetadata.INDEX_BLOCKS_WRITE_SETTING.get(indexSettings) || IndexMetadata.INDEX_READ_ONLY_SETTING.get(indexSettings)) {
return indexMetadata.isSearchableSnapshot()
|| indexMetadata.getCreationVersion().isLegacyIndexVersion()
|| MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.get(indexMetadata.getSettings());
|| MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.get(indexSettings);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.Build;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener;
Expand Down Expand Up @@ -121,8 +120,7 @@ public class MetadataIndexStateService {
false,
Setting.Property.IndexScope,
Setting.Property.NotCopyableOnResize,
// Allow the setting to be updated in snapshot builds
Build.current().isSnapshot() ? Setting.Property.OperatorDynamic : Setting.Property.PrivateIndex
Setting.Property.PrivateIndex
);

private final ClusterService clusterService;
Expand Down

0 comments on commit c335134

Please sign in to comment.