Treat shrink/split/clone source settings as read-only in normalizer - #1144
Merged
Conversation
jwils
requested review from
BrianSigafoos-SQ,
ayousufi,
bsorbo,
jwondrusch and
myronmarston
as code owners
April 22, 2026 14:55
myronmarston
approved these changes
Apr 22, 2026
myronmarston
left a comment
Collaborator
There was a problem hiding this comment.
LGTM apart from the build failure.
OpenSearch exposes `index.resize.source.name`, `index.resize.source.uuid`, and `index.routing.allocation.initial_recovery._id` when you fetch the settings for an index produced by a shrink, split, or clone, but rejects PUTs that try to write them (`illegal_argument_exception: unknown setting`). The admin update loop diffs current vs desired settings and PUTs null for anything present in current but absent from desired, so running `update_opensearch_config` against a cluster containing such an index fails with a 400. Add these three settings to `READ_ONLY_SETTINGS` so the normalizer drops them from current_settings and the update loop leaves them alone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jwils
force-pushed
the
joshuaw/normalizer-ignore-shrink-source-settings
branch
from
April 22, 2026 15:53
02dd47a to
9ad8ed7
Compare
1 task
jwils
added a commit
that referenced
this pull request
Apr 22, 2026
`index.routing_partition_size` and `index.codec` are both static (non-dynamic) index settings. OpenSearch exposes them on read but rejects PUTs against `_settings` for them on an open index: - `routing_partition_size` is index-creation-only and defaults to `1` when not set, so any PUT for it (including PUTs of null to restore the default) is rejected outright with `Can't update non dynamic settings`. - `index.codec` can only be changed on a closed index, so PUTs against an open index fail the same way (`Can't update non dynamic settings [[index.codec]] for open indices [...]`). The admin update loop diffs current vs desired settings and PUTs null for anything present in current but absent from desired, so running `clusters:configure:perform` against a cluster that surfaces either setting fails with a 400. Add both to `READ_ONLY_SETTINGS` so the normalizer drops them from current_settings and the update loop leaves them alone, matching the pattern established in #1144. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jwils
added a commit
that referenced
this pull request
Apr 22, 2026
`index.routing_partition_size` and `index.codec` are both static (non-dynamic) index settings. OpenSearch exposes them on read but rejects PUTs against `_settings` for them on an open index: - `routing_partition_size` is index-creation-only and defaults to `1` when not set, so any PUT for it (including PUTs of null to restore the default) is rejected outright with `Can't update non dynamic settings`. - `index.codec` can only be changed on a closed index, so PUTs against an open index fail the same way (`Can't update non dynamic settings [[index.codec]] for open indices [...]`). The admin update loop diffs current vs desired settings and PUTs null for anything present in current but absent from desired, so running `clusters:configure:perform` against a cluster that surfaces either setting fails with a 400. Add both to `READ_ONLY_SETTINGS` so the normalizer drops them from current_settings and the update loop leaves them alone, matching the pattern established in #1144.
2 tasks
jwils
added a commit
that referenced
this pull request
Apr 23, 2026
Distills the patterns Myron Marston applies when reviewing merged PRs (naming at the caller's level of abstraction, respond_to? as a code smell, wrapper-class DI pattern, load-bearing tests, RBS/YARD hygiene, etc.) into an edit-first skill. Invoked as /myron-polish, the skill walks the current branch's diff against main and applies fixes directly rather than producing review comments. It loops — re-scan, apply edits, run script/lint --fix / script/spellcheck -w / script/type_check / script/run_gem_specs — until a full iteration makes zero edits and every verification command passes. Capped at 8 iterations. Source material: Myron's review bodies and inline comments on merged PRs #974, #973, #1067, #1066, #1108, #1120, #1131, #1134, #1144, #1107. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenSearch exposes three settings on indices produced by a shrink (or split/clone) that are rejected on write:
index.resize.source.nameindex.resize.source.uuidindex.routing.allocation.initial_recovery._idAdmin::IndexDefinitionConfigurator::ForIndex#settings_updatesdiffs current vs desired settings and PUTsnullfor any setting present in current but absent from desired (to restore its default). When a shrunk index is present, the PUT fails with:…with the other two surfacing as
suppressedexceptions. This causes the admin lambda'supdate_opensearch_configrun to fail hard.This PR adds the three settings to
IndexConfigNormalizer::READ_ONLY_SETTINGSso they are dropped fromcurrent_settingsduring normalization and the update loop leaves them alone — the same pattern already used forindex.creation_date,index.uuid,index.history.uuid, etc.Test plan
index_config_normalizer_spec.rbto cover all three new entries; fullindex_config_normalizer_spec.rbsuite passes (10 examples, 0 failures)🤖 Generated with Claude Code