Skip to content
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] Unable to restore single backing index for a data stream #13196

Closed
lyradc opened this issue Apr 15, 2024 · 5 comments
Closed

[BUG] Unable to restore single backing index for a data stream #13196

lyradc opened this issue Apr 15, 2024 · 5 comments
Labels
bug Something isn't working :Feature/Datastream Issues related to data streams Storage:Snapshots

Comments

@lyradc
Copy link

lyradc commented Apr 15, 2024

Describe the bug

When attempting to restore a single backing index for a given data stream the resulting index is not added back to the data stream, additionally while the docs count appears correct the newly restored backing index shows a store size of 0, which is not expected.

Related component

Storage:Snapshots

To Reproduce

  1. Create a new data stream
  2. Add data and rollover the new data stream a few times to get a few backing indices
  3. Take a snapshot that includes this newly created data stream
  4. Delete one of the backing indices from the newly created data stream (not the current active index, one of the older ones)
  5. Restore that one backing index that was deleted in step 4
  6. After restore is complete the restored index is not listed as belonging to the original data stream and the restored index will show an expected doc count with 0 size.

Refreshing the index or data stream does not resolve the size issue.

Expected behavior

If the process to restore a single backing index from a data stream differs significantly from the process to restore a single non-datastream index then I would expect that process to be documented.

Otherwise my expectation is that the restored backing index be added back to it's data stream, and that both the doc count and store size reflect the data contained/restored.

Additional Details

Plugins
opensearch-alerting 2.13.0.0
opensearch-anomaly-detection 2.13.0.0
opensearch-asynchronous-search 2.13.0.0
opensearch-cross-cluster-replication 2.13.0.0
opensearch-custom-codecs 2.13.0.0
opensearch-flow-framework 2.13.0.0
opensearch-geospatial 2.13.0.0
opensearch-index-management 2.13.0.0
opensearch-job-scheduler 2.13.0.0
opensearch-knn 2.13.0.0
opensearch-ml 2.13.0.0
opensearch-neural-search 2.13.0.0
opensearch-notifications 2.13.0.0
opensearch-notifications-core 2.13.0.0
opensearch-observability 2.13.0.0
opensearch-performance-analyzer 2.13.0.0
opensearch-reports-scheduler 2.13.0.0
opensearch-security 2.13.0.0
opensearch-security-analytics 2.13.0.0
opensearch-skills 2.13.0.0
opensearch-sql 2.13.0.0
repository-s3 2.13.0

Host/Environment (please complete the following information):

  • OS: CentOS7
  • Version 2.13.0
@lyradc lyradc added bug Something isn't working untriaged labels Apr 15, 2024
@peternied peternied added :Feature/Datastream Issues related to data streams and removed untriaged labels Apr 17, 2024
@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5 6 7]
@lyradc Thanks for creating this issue, we'd welcome a pull request to address this scenario.

@jed326
Copy link
Collaborator

jed326 commented Apr 17, 2024

Hey @lyradc whenever the backing index of a data stream is deleted it gets deleted from the datastream metadata as well. Today there is no functionality in OpenSearch to modify a data stream to add indices to it so there's no way to re-add individual backing indices back to the data stream after snapshot restore. This does seem to be a documentation miss as well. There is an open feature request for this though:

However, I do think it may be difficult for the snapshot restore path to take care of adding a backing index back to a data stream automatically since if we take a snapshot of individual indices it's difficult to automatically determine if they belonged to a datastream originally.

@lyradc
Copy link
Author

lyradc commented Apr 17, 2024

@jed326 I understand, thank you for those details.

Given that, I had restored a backing index to a similar-named non-datastream index. This could still work for my use-case, however the restored index shows a doc count, but index size remains 0. Is this expected?

@jed326
Copy link
Collaborator

jed326 commented Apr 17, 2024

@lyradc That doesn't sound right. I believe it's normal for index size to be 0 for a little bit after the snapshot restore starts but once restore is completed it should not show 0, especially if there is a positive doc count. Are you still able to search against this index? Could you also share the full _cat/indices output for this index (or however you are getting the index size)?

@lyradc
Copy link
Author

lyradc commented Apr 17, 2024

Well thank you again, I just checked again and found the index and it's shards do now show doc counts as well as an expected size.

The restored index is also searchable. I may not have given the cluster enough time following restore...

With the above referenced feature already requested, this issue can be closed.

@lyradc lyradc closed this as completed Apr 17, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Storage Project Board Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working :Feature/Datastream Issues related to data streams Storage:Snapshots
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants