From ce4a9dd6b74457a95b58c935288c1bb4a9a9ac15 Mon Sep 17 00:00:00 2001 From: Pat Whelan Date: Mon, 13 Oct 2025 16:24:00 -0400 Subject: [PATCH 1/2] [Transform] Associate legacy audit index If a user manually creates the legacy audit index, TransformClusterStateListener will automatically add the non-legacy alias to forward messages to it. If the transform feature had never been accessed before (for example after the feature is reset), then the next time the auditor is called, it will associate with the existing legacy index rather than the notifications index. We cannot cleanly block users from manually creating system or hidden indices (yet), but we can associate the legacy index with the transform feature so that a feature reset will delete the legacy index (like it does with the notifications index). The next time the transform feature is used, it will automatically create the notifications index rather than reusing the legacy index. Resolve #121241 --- muted-tests.yml | 3 --- .../java/org/elasticsearch/xpack/transform/Transform.java | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index 256ba3eef305e..1309b0c06e93d 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -317,9 +317,6 @@ tests: issue: https://github.com/elastic/elasticsearch/issues/121117 - class: org.elasticsearch.xpack.ml.integration.PyTorchModelIT issue: https://github.com/elastic/elasticsearch/issues/121165 - - class: org.elasticsearch.xpack.transform.integration.TransformAuditorIT - method: testAuditorWritesAudits - issue: https://github.com/elastic/elasticsearch/issues/121241 - class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT method: test {p0=nodes.stats/11_indices_metrics/indices mappings exact count test for indices level} issue: https://github.com/elastic/elasticsearch/issues/120950 diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java index 7f4b9543698b4..e473c94c91b0e 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java @@ -128,6 +128,7 @@ import static org.elasticsearch.xpack.core.ClientHelper.TRANSFORM_ORIGIN; import static org.elasticsearch.xpack.core.transform.TransformMessages.FAILED_TO_UNSET_RESET_MODE; import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.AUDIT_INDEX_PATTERN; +import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.AUDIT_INDEX_PATTERN_DEPRECATED; import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.TRANSFORM_PREFIX; import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.TRANSFORM_PREFIX_DEPRECATED; @@ -436,7 +437,10 @@ public Collection getSystemIndexDescriptors(Settings sett @Override public Collection getAssociatedIndexDescriptors() { - return List.of(new AssociatedIndexDescriptor(AUDIT_INDEX_PATTERN, "Audit index")); + return List.of( + new AssociatedIndexDescriptor(AUDIT_INDEX_PATTERN, "Audit index"), + new AssociatedIndexDescriptor(AUDIT_INDEX_PATTERN_DEPRECATED, "Legacy audit index") + ); } @Override From 50ac1dda168b1f57da1dd34e5b3f2f0e00323bc4 Mon Sep 17 00:00:00 2001 From: Pat Whelan Date: Mon, 13 Oct 2025 17:28:29 -0400 Subject: [PATCH 2/2] Update docs/changelog/136508.yaml --- docs/changelog/136508.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/changelog/136508.yaml diff --git a/docs/changelog/136508.yaml b/docs/changelog/136508.yaml new file mode 100644 index 0000000000000..6cdad9fa50fdd --- /dev/null +++ b/docs/changelog/136508.yaml @@ -0,0 +1,6 @@ +pr: 136508 +summary: Associate legacy audit index +area: Transform +type: bug +issues: + - 121241