{"action":"created","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/1582","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/1582/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/1582/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/1582/events","html_url":"https://github.com/influxdb/influxdb/issues/1582","id":57401418,"number":1582,"title":"After inserting data with tags, querying that data returns out of order","user":{"login":"mark-rushakoff","id":290647,"avatar_url":"https://avatars.githubusercontent.com/u/290647?v=3","gravatar_id":"","url":"https://api.github.com/users/mark-rushakoff","html_url":"https://github.com/mark-rushakoff","followers_url":"https://api.github.com/users/mark-rushakoff/followers","following_url":"https://api.github.com/users/mark-rushakoff/following{/other_user}","gists_url":"https://api.github.com/users/mark-rushakoff/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-rushakoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-rushakoff/subscriptions","organizations_url":"https://api.github.com/users/mark-rushakoff/orgs","repos_url":"https://api.github.com/users/mark-rushakoff/repos","events_url":"https://api.github.com/users/mark-rushakoff/events{/privacy}","received_events_url":"https://api.github.com/users/mark-rushakoff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/influxdb/influxdb/labels/1%20-%20Ready","name":"1 - Ready","color":"CCCCCC"}],"state":"open","locked":false,"assignee":{"login":"benbjohnson","id":118015,"avatar_url":"https://avatars.githubusercontent.com/u/118015?v=3","gravatar_id":"","url":"https://api.github.com/users/benbjohnson","html_url":"https://github.com/benbjohnson","followers_url":"https://api.github.com/users/benbjohnson/followers","following_url":"https://api.github.com/users/benbjohnson/following{/other_user}","gists_url":"https://api.github.com/users/benbjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/benbjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbjohnson/subscriptions","organizations_url":"https://api.github.com/users/benbjohnson/orgs","repos_url":"https://api.github.com/users/benbjohnson/repos","events_url":"https://api.github.com/users/benbjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/benbjohnson/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-02-12T00:47:42Z","updated_at":"2015-02-13T12:22:26Z","closed_at":null,"body":"[Here's a gist to reproduce the issue](https://gist.github.com/mark-rushakoff/4bee61321d54f4fbd5f6).\r\n\r\nRun `ruby issue.rb | less` and see that the timestamps appear in random order.\r\n\r\nWe reproduced this on InfluxDB built from commit 13c437ab6ccfa6871e58b37d0dcc802991ba4b19. If you comment out the `host: 'server'` line in the script and re-run it, the data comes back in order."},"comment":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/comments/74245875","html_url":"https://github.com/influxdb/influxdb/issues/1582#issuecomment-74245875","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/1582","id":74245875,"user":{"login":"pauldix","id":4331,"avatar_url":"https://avatars.githubusercontent.com/u/4331?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldix","html_url":"https://github.com/pauldix","followers_url":"https://api.github.com/users/pauldix/followers","following_url":"https://api.github.com/users/pauldix/following{/other_user}","gists_url":"https://api.github.com/users/pauldix/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldix/subscriptions","organizations_url":"https://api.github.com/users/pauldix/orgs","repos_url":"https://api.github.com/users/pauldix/repos","events_url":"https://api.github.com/users/pauldix/events{/privacy}","received_events_url":"https://api.github.com/users/pauldix/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T12:22:26Z","updated_at":"2015-02-13T12:22:26Z","body":"I don't think the sleep has anything to do with it. Here's an updated script that will give you more info: https://gist.github.com/pauldix/adc059e066addba3d305\r\n\r\nWhat we're seeing here is multiple issues:\r\n\r\n1.  The writes don't actually complete. The request times out before all the points get written.\r\n2.  The query to return the raw values returns them out of order (this should be an easy fix)\r\n3. The count aggregate query is returning intervals with zero counts when it shouldn't (fill isn't implemented and even then wasn't specified)\r\n4.  The mean aggregate query isn't returning any data\r\n\r\nIf you drastically reduce the number of points being written. Set `earlier = now - (60 * 60)`, then you see that all the writes succeed. Further, the mean query will actually return data.\r\n\r\nSo there may be a problem where a write is getting corrupted, which causes the mean function to not work. And if you're writing a bunch of stuff in a single request, it just fails in the middle and not everything gets written."}}