deletion: fix issue in processing delete requests with tsdb index #8665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
When a delete request creates a new chunk from an existing chunk, we index it to the index store.
In TSDB, we drop
__name__
label, which was being added to chunkrefs for historical reasons.However, this was not done while indexing chunks from the deletion code, causing deletion to fail with the error chunk insertion is only allowed on existing streams.
This PR handles the issue by dropping the
__name__
label and adding relevant tests.Special notes for your reviewer:
I will add an integration test for deletion with TSDB once we have PR #7754 merged since it does some groundwork to run integration tests with both
boltdb-shipper
andtsdb
.Checklist
CHANGELOG.md
updated