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

Fix data deleted outside of time range #8979

Merged
merged 1 commit into from
Oct 18, 2017
Merged

Fix data deleted outside of time range #8979

merged 1 commit into from
Oct 18, 2017

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Oct 18, 2017

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Sign CLA (if not already signed)

This fixes a case where data outside of the time range specified in a delete was deleted incorrectly.

Steps to repro:

> insert cpu value=1 0
> insert cpu value=1 1
> insert cpu value=1 2
> insert cpu value1=1 2
> insert cpu value1=1 3
> insert cpu value1=1 4
> select * from cpu
name: cpu
time value value1
---- ----- ------
0    1
1    1
2    1     1
3          1
4          1
> delete from cpu where time >= 0 and time <= 2
> select * from cpu
>

With this fix, it works correctly now:

> insert cpu value=1 0
> insert cpu value=1 1
> insert cpu value=1 2
> insert cpu value1=1 2
> insert cpu value1=1 3
> insert cpu value1=1 4
> delete from cpu where time >= 0 and time <= 2
> select * from cpu
name: cpu
time value value1
---- ----- ------
3          1
4          1

The issue was that if an earlier series (as seen by DeleteRange) was fully deleted, a faster path delete case was called with all series instead of the one.

Fixes #7706

@jwilder jwilder requested a review from stuartcarnie October 18, 2017 19:48
@ghost ghost assigned jwilder Oct 18, 2017
@ghost ghost added the review label Oct 18, 2017
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@jwilder jwilder merged commit 1bbf913 into master Oct 18, 2017
@jwilder jwilder deleted the jw-delete-time branch October 18, 2017 23:30
@jwilder jwilder mentioned this pull request Oct 19, 2017
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When delete by time range, some points not inside that range gets deleted
2 participants