Skip to content

Mark read-only flush and verify #119743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only add verified if not verified (with read-only + write block at th…
…e same time).
  • Loading branch information
henningandersen committed Jan 16, 2025
commit 3b8014546e48b5a5260665f06c4971e80cf86867
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,12 @@ private static Tuple<ClusterState, List<AddBlockResult>> finalizeBlock(

if (block.getBlock().contains(ClusterBlockLevel.WRITE) && markVerified) {
final IndexMetadata indexMetadata = metadata.getSafe(index);
final IndexMetadata.Builder updatedMetadata = IndexMetadata.builder(indexMetadata)
.settings(Settings.builder().put(indexMetadata.getSettings()).put(VERIFIED_READ_ONLY_SETTING.getKey(), true))
.settingsVersion(indexMetadata.getSettingsVersion() + 1);
metadata.put(updatedMetadata);
if (VERIFIED_READ_ONLY_SETTING.get(indexMetadata.getSettings()) == false) {
final IndexMetadata.Builder updatedMetadata = IndexMetadata.builder(indexMetadata)
.settings(Settings.builder().put(indexMetadata.getSettings()).put(VERIFIED_READ_ONLY_SETTING.getKey(), true))
.settingsVersion(indexMetadata.getSettingsVersion() + 1);
metadata.put(updatedMetadata);
}
}
} catch (final IndexNotFoundException e) {
logger.debug("index {} has been deleted since blocking it started, ignoring", index);
Expand Down