Fix panic: runtime error: slice bounds out of range #9117
Merged
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.
This fixes a regression in 1.4 introduced in ca40c1a where a delete with an invalid time range could end up either causing a panic or duplicate data in the blocks. I discovered this trying to reproduce #9116, which I have not been able to reproduce yet. This fix may fix that as well. This does not occur in 1.3.
For both of these, star the server with
INFLUXDB_DATA_CACHE_SNAPSHOT_WRITE_COLD_DURATION=1s influxd
To reproduce the panic:
A delete where the min and max times are backwards causes a panic in
Exclude
.The server crashes with:
To reproduce the duplicate data:
This causes the CPU series to have duplicate data after a compaction:
Required for all non-trivial PRs