Add API to modify a data stream's backing indices#22487
Conversation
|
❌ Gradle check result for d1bc351: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for e99ab9c: Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #22487 +/- ##
============================================
- Coverage 73.49% 73.45% -0.04%
- Complexity 76446 76462 +16
============================================
Files 6104 6104
Lines 346592 346631 +39
Branches 49881 49889 +8
============================================
- Hits 254713 254609 -104
- Misses 71608 71743 +135
- Partials 20271 20279 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
❌ Gradle check result for 7a2aa7f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 336dee4: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Introduce POST /_data_stream/_modify, a metadata-only API to add or remove backing indices of a data stream, applied atomically in a single cluster-state update without touching shards. Multiple add/remove actions may be batched in one request. The write (highest-generation) backing index cannot be removed, and added indices must follow the .ds-<data_stream>-NNNNNN naming convention; the generation is derived from the backing indices, so it is never set directly. Lets a controller (e.g. cross-cluster replication) or operator re-attach backing indices that exist but are not associated with the stream, such as indices restored from cold storage. Resolves opensearch-project#8271. Signed-off-by: Ankit Jain <jainankitk@apache.org>
|
❌ Gradle check result for 5c85277: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
andrross
left a comment
There was a problem hiding this comment.
Added indices must follow the .ds-<data_stream>-NNNNNN naming convention
Why must indices follow the name convention? Is it not valid to add arbitrary indexes to a data stream? This would allow for use cases where you have implemented a data stream pattern on regular indexes but want to move to data streams.
Signed-off-by: Ankit Jain <jainankitk@apache.org>
I was slightly confused whether those arbitrary indices can be write target as well and how to handle them. But, I guess they would be read-only, and the writes always go through the latest generated data stream index. |
… streams Signed-off-by: Ankit Jain <jainankitk@apache.org>
|
❌ Gradle check result for d3be3b9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Unrelated flaky test failure: Retried gradle check |
|
❌ Gradle check result for d3be3b9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Unrelated test failures again: Retrying gradle check |
|
❌ Gradle check result for d3be3b9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Another flaky test: Retrying gradle check |
@jainankitk I think we need at a minimum to validate there is a |
|
❌ Gradle check result for 9a4da37: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Introduce POST /_data_stream/_modify to add or remove backing indices of a data stream, applied atomically as a metadata-only change. Restoring a ".ds-<stream>-NNNNNN" index also auto-attaches it to a pre-existing stream of the same name, so cross-cluster replication can bring a rolled-over backing index onto a follower without a separate step. Resolves opensearch-project#8271. Signed-off-by: Ankit Jain <jainankitk@apache.org>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit c13fdac.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
Signed-off-by: Ankit Jain <jainankitk@apache.org>
|
Regarding the comments
|
Signed-off-by: Ankit Jain <jainankitk@apache.org>
Description
Adds
POST /_data_stream/_modify, a metadata-only API to add or remove backing indices of a data stream. All actions in a request are applied atomically in a single cluster-state update and never create, delete, restore, open, close, or relocate shards.The request body is a list of actions:
Behavior and guardrails:
.ds-<data_stream>-NNNNNNconvention — arbitrary-named indices are attached as older, non-write backing indices, which supports migrating pre-existing regular indices into a data stream. The convention-following write index is preserved so rollover keeps working.MetadataDataStreamsServiceis injectable, so components such as cross-cluster replication can call it directly instead of routing through the transport action.Related Issues
Resolves #8271
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.