Add settings assertion in internal index reindexer
When performing an internal reindex, we add a setting marking the source as read-only. We also check that this index is not already read-only. This means that when we add the read-only setting, we expect that it is already not there. This commit adds an assertion before we increment the settings version validating that this is indeed the case.
This commit is contained in:
parent
05911fb499
commit
145bafea88
|
@ -151,9 +151,8 @@ public class InternalIndexReindexer<T> {
|
|||
.put(IndexMetaData.INDEX_READ_ONLY_SETTING.getKey(), true)
|
||||
.build();
|
||||
final IndexMetaData.Builder builder = IndexMetaData.builder(indexMetaData).settings(indexSettingsBuilder);
|
||||
if (same(indexMetaData.getSettings(), indexSettingsBuilder) == false) {
|
||||
assert same(indexMetaData.getSettings(), indexSettingsBuilder) == false;
|
||||
builder.settingsVersion(1 + builder.settingsVersion());
|
||||
}
|
||||
|
||||
MetaData.Builder metaDataBuilder = MetaData.builder(currentState.metaData()).put(builder);
|
||||
|
||||
|
|
Loading…
Reference in New Issue