mirror of https://github.com/grafana/loki
deletion: fix issue in processing delete requests with tsdb index (#8665)
**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](pull/8732/head944b488bd2/pkg/storage/stores/tsdb/head_manager.go (L235-L237)) `__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](619c2212f5/pkg/storage/stores/tsdb/builder.go (L67)). 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 https://github.com/grafana/loki/pull/7754 merged since it does some groundwork to run integration tests with both `boltdb-shipper` and `tsdb`. **Checklist** - [x] Tests updated - [x] `CHANGELOG.md` updated
parent
466a32192a
commit
162a2d0057
Loading…
Reference in new issue