Skip to content
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

Do not copy index.default_pipeline and index.final_pipeline #96494

Merged
Show file tree
Hide file tree
Changes from 3 commits
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
6 changes: 6 additions & 0 deletions docs/changelog/96494.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 96494
summary: Do not copy `index.default_pipeline` and `index.final_pipeline`
area: Rollup
type: bug
issues:
- 96478
2 changes: 1 addition & 1 deletion x-pack/plugin/rollup/qa/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {

restResources {
restApi {
include '_common', 'bulk', 'cluster', 'indices', 'search'
include '_common', 'bulk', 'cluster', 'indices', 'search', 'ingest.put_pipeline', 'ingest.delete_pipeline'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static org.elasticsearch.index.mapper.TimeSeriesParams.TIME_SERIES_METRIC_PARAM;

Expand All @@ -97,6 +98,12 @@ public class TransportDownsampleAction extends AcknowledgedTransportMasterNodeAc
private final IndexScopedSettings indexScopedSettings;
private final ThreadContext threadContext;

private static final Set<String> FORBIDDEN_SETTINGS = Set.of(
IndexSettings.DEFAULT_PIPELINE.getKey(),
IndexSettings.FINAL_PIPELINE.getKey(),
IndexMetadata.INDEX_BLOCKS_WRITE_SETTING.getKey()
);

/**
* This is the cluster state task executor for cluster state update actions.
*/
Expand Down Expand Up @@ -584,12 +591,16 @@ private IndexMetadata.Builder copyIndexMetadata(IndexMetadata sourceIndexMetadat
// the same rules with resize apply
continue;
}
if (FORBIDDEN_SETTINGS.contains(key)) {
continue;
}
// Do not override settings that have already been set in the rollup index.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe update this comment too?

// Also, we don't want to copy the `index.block.write` setting that we know
// it is set in the source index settings.
if (IndexMetadata.SETTING_BLOCKS_WRITE.equals(key) || targetSettings.keys().contains(key)) {
if (targetSettings.keys().contains(key)) {
continue;
}

targetSettings.copy(key, sourceIndexMetadata.getSettings());
}

Expand Down