-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Bug Fix: System Data Streams Should Be Restorable #124651
base: main
Are you sure you want to change the base?
Bug Fix: System Data Streams Should Be Restorable #124651
Conversation
Hi @JVerwolf, I've created a changelog YAML for you. |
…JVerwolf/elasticsearch into bugfix/datastreams-should-be-restorable
…atastreams-should-be-restorable
@@ -608,6 +711,69 @@ public void testSystemIndexAliasesAreAlwaysRestored() { | |||
|
|||
} | |||
|
|||
// TODO: This test is failing because the assertion `assertTrue(indexExists(systemDataStreamAlias));` trips. | |||
@AwaitsFix(bugUrl = "assertTrue(indexExists(systemDataStreamAlias)); is broken") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is failing because the alias isn't restored. I'm supposing this is a bug, and not expected behaviour for system datastreams?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data stream aliases are similar to index aliases, where they are metadata on the data stream itself. I would expect restoring a data stream (system or otherwise) to also restore the alias for that data stream.
I tested that with a non-system data stream, the alias is restored when the data stream is restored, so I would treat this as a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor initial comments. I suggest someone from data management review.
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDeleteDataStreamService.java
Outdated
Show resolved
Hide resolved
…JVerwolf/elasticsearch into bugfix/datastreams-should-be-restorable
server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of comments from the Data Management side, but nothing major. I agree with Ryan about trying to combine with MetadataDataStreamsService
instead of adding a new service if possible.
@@ -608,6 +711,69 @@ public void testSystemIndexAliasesAreAlwaysRestored() { | |||
|
|||
} | |||
|
|||
// TODO: This test is failing because the assertion `assertTrue(indexExists(systemDataStreamAlias));` trips. | |||
@AwaitsFix(bugUrl = "assertTrue(indexExists(systemDataStreamAlias)); is broken") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data stream aliases are similar to index aliases, where they are metadata on the data stream itself. I would expect restoring a data stream (system or otherwise) to also restore the alias for that data stream.
I tested that with a non-system data stream, the alias is restored when the data stream is restored, so I would treat this as a bug.
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDeleteDataStreamService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDeleteDataStreamService.java
Outdated
Show resolved
Hide resolved
Pinging @elastic/es-core-infra (Team:Core/Infra) |
This is still a work in progress.
This PR adds a new
MetadataDeleteDataStreamService
to delete system data streams prior to arestore
operation.closes #89261