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

Duplicate data for the same timestamp #6946

Closed
maykSVK opened this issue Jul 1, 2016 · 3 comments · Fixed by #7027
Closed

Duplicate data for the same timestamp #6946

maykSVK opened this issue Jul 1, 2016 · 3 comments · Fixed by #7027
Milestone

Comments

@maykSVK
Copy link

maykSVK commented Jul 1, 2016

In some case is somehow possible to have multiple data with the same timestamp. I manage to simulate this behavior.

  1. Create new database
  2. Write this data. (I used curl for writing) data.txt
  3. Write next data.
    data2.txt
  4. Now you can see in second series (select * from "24ZSS1204390000N") that everything is fine.
  5. Drop database
  6. Create new database with the same name.
  7. Write again data.txt
  8. Write again data2.txt
  9. now you can see, that every entry is duplicate in 24ZSS1204390000N series

I suppose that there is some kind of cashing of the data, because when I restart InfluxDb server, everything works fine. Also when I use less data, it works fine.

@gunnaraasen
Copy link
Contributor

@maykSVK Can you test if the latest nightly build shows this behavior?

@maykSVK
Copy link
Author

maykSVK commented Jul 4, 2016

I have tried it in today's nightly build (wget https://dl.influxdata.com/influxdb/nightlies/influxdb_nightly_amd64.deb) and the beahvior was still the same

@jwilder jwilder added this to the 1.0.0 milestone Jul 18, 2016
jwilder added a commit that referenced this issue Jul 18, 2016
There was a race where the same series would get added to the in-memory
index for a measurement more than once.  This would result in the same
series being returned more than once during queries causing duplicate
results.  The issue was that we check for the series under the read
lock, but did not check again under the write lock where there was
a small window where the series could be added by another goroutine.

We now check for the series under the write lock.

Fixes #6946
@jwilder
Copy link
Contributor

jwilder commented Jul 18, 2016

@maykSVK Thanks for the test data and repro steps that made reproducing this easy. I was able to reproduce it and have a fix for it in #7027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants