Skip to content

Commit 6a8be2e

Browse files
authored
[Transform] Associate legacy audit index (#136508) (#136622)
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 44f1173 commit 6a8be2e

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
@@ -540,6 +540,3 @@ tests:
540540
- class: org.elasticsearch.packaging.test.DockerTests
541541
method: test010Install
542542
issue: https://github.com/elastic/elasticsearch/issues/131376
543-
- class: org.elasticsearch.xpack.transform.integration.TransformAuditorIT
544-
method: testAuditorWritesAudits
545-
issue: https://github.com/elastic/elasticsearch/issues/121241

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)