Skip to content

Commit 98e02b2

Browse files
authored
[Transform] Associate legacy audit index (#136508)
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
1 parent 7f64baf commit 98e02b2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

docs/changelog/136508.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 136508
2+
summary: Associate legacy audit index
3+
area: Transform
4+
type: bug
5+
issues:
6+
- 121241

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ tests:
317317
issue: https://github.com/elastic/elasticsearch/issues/121117
318318
- class: org.elasticsearch.xpack.ml.integration.PyTorchModelIT
319319
issue: https://github.com/elastic/elasticsearch/issues/121165
320-
- class: org.elasticsearch.xpack.transform.integration.TransformAuditorIT
321-
method: testAuditorWritesAudits
322-
issue: https://github.com/elastic/elasticsearch/issues/121241
323320
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
324321
method: test {p0=nodes.stats/11_indices_metrics/indices mappings exact count test for indices level}
325322
issue: https://github.com/elastic/elasticsearch/issues/120950

x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
import static org.elasticsearch.xpack.core.ClientHelper.TRANSFORM_ORIGIN;
129129
import static org.elasticsearch.xpack.core.transform.TransformMessages.FAILED_TO_UNSET_RESET_MODE;
130130
import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.AUDIT_INDEX_PATTERN;
131+
import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.AUDIT_INDEX_PATTERN_DEPRECATED;
131132
import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.TRANSFORM_PREFIX;
132133
import static org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants.TRANSFORM_PREFIX_DEPRECATED;
133134

@@ -436,7 +437,10 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
436437

437438
@Override
438439
public Collection<AssociatedIndexDescriptor> getAssociatedIndexDescriptors() {
439-
return List.of(new AssociatedIndexDescriptor(AUDIT_INDEX_PATTERN, "Audit index"));
440+
return List.of(
441+
new AssociatedIndexDescriptor(AUDIT_INDEX_PATTERN, "Audit index"),
442+
new AssociatedIndexDescriptor(AUDIT_INDEX_PATTERN_DEPRECATED, "Legacy audit index")
443+
);
440444
}
441445

442446
@Override

0 commit comments

Comments
 (0)