{"action":"closed","issue":{"url":"https://api.github.com/repos/graphite-project/graphite-web/issues/832","labels_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/832/labels{/name}","comments_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/832/comments","events_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/832/events","html_url":"https://github.com/graphite-project/graphite-web/issues/832","id":40223849,"number":832,"title":"Last value in cached query is not always correct.","user":{"login":"obfuscurity","id":494338,"avatar_url":"https://avatars.githubusercontent.com/u/494338?v=3","gravatar_id":"","url":"https://api.github.com/users/obfuscurity","html_url":"https://github.com/obfuscurity","followers_url":"https://api.github.com/users/obfuscurity/followers","following_url":"https://api.github.com/users/obfuscurity/following{/other_user}","gists_url":"https://api.github.com/users/obfuscurity/gists{/gist_id}","starred_url":"https://api.github.com/users/obfuscurity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obfuscurity/subscriptions","organizations_url":"https://api.github.com/users/obfuscurity/orgs","repos_url":"https://api.github.com/users/obfuscurity/repos","events_url":"https://api.github.com/users/obfuscurity/events{/privacy}","received_events_url":"https://api.github.com/users/obfuscurity/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-08-14T05:24:30Z","updated_at":"2015-10-01T12:48:38Z","closed_at":"2015-10-01T12:48:38Z","body":"Per @LukaszStrzelecki in https://github.com/graphite-project/carbon/issues/203 (moving issue to the correct project):\r\n\r\nHi,\r\nQuite recently we started using graphite for our internal monitoring and we are very happy with it so far.\r\nThere is one issue we can't understand/resolve though. Our current graphite version is 0.9.12 but we had the same problem in 0.9.10.\r\nThe problem we are having is that **when we query graphite (regardless of chosen output format) value for last sample is not always correct.**\r\nOur retention policy is quite simple: \r\n```\r\npattern = .*\r\nretentions = 20s:6h, 10m:14d, 1h:42d, 4h:182d, 3d:3y\r\n```\r\nand our aggregation is:\r\n```\r\n[sum]\r\npattern = .*\\.sum[^.]*$\r\nxFilesFactor = 0\r\naggregationMethod = sum\r\n````\r\nWhen we make request for any metrics that falls into 10m:14d bucket quite often last value returned is taken from cache for 20s:6h (by cache I mean value emitted but not yet flushed to disk) rather than from value that already exists on disk (or is in cache but for correct time bucket rather than from better resolution one).\r\n\r\n**Request 1: (invalid last value)**\r\n```\r\nLast 20  sec (uses 20s:6h) : [{\"target\": \"my.namespace.workers.4.sum\", \"datapoints\": [[3227.0, 1389005520]]}]  \r\nLast 381 min (uses 10m:14d): [{\"target\": \"my.namespace.workers.4.sum\", \"datapoints\": [(...), [129046.0, 1389004800], [3227.0, 1389005400]]}]\r\nCorresponding log\r\n06/01/2014 10:52:40 :: [127.0.0.1:36085] cache query for \"my.namespace.workers.4.sum\" returned 1 values\r\n```\r\nLast value for second timerange is 3227.0 (same as for first timerange) even though few request before it was bigger than that. (we use aggregationMethod = sum and do not emit negative values)\r\n\r\n**Request 2: (valid last value)**\r\n```\r\nLast 20  sec: [{\"target\": \"my.namespace.workers.4.sum\", \"datapoints\": [[null, 1389005740]]}] \r\nLast 381 min: [{\"target\": \"my.namespace.workers.4.sum\", \"datapoints\": [(...), [129046.0, 1389004800], [68246.0, 1389005400]]}]\r\nCorresponding log\r\n06/01/2014 10:57:08 :: [127.0.0.1:36089] cache query for \"my.namespace.workers.4.sum\" returned 0 values\r\n```\r\n\r\nFile info from whisper-info.py:\r\n```\r\nmaxRetention: 94608000\r\nxFilesFactor: 0.0\r\naggregationMethod: sum\r\nfileSize: 66808\r\nArchive 0\r\nretention: 21600\r\nsecondsPerPoint: 20\r\npoints: 1080\r\nsize: 12960\r\noffset: 76\r\nArchive 1\r\nretention: 1209600\r\nsecondsPerPoint: 600\r\npoints: 2016\r\nsize: 24192\r\noffset: 13036\r\nArchive 2\r\nretention: 3628800\r\nsecondsPerPoint: 3600\r\npoints: 1008\r\nsize: 12096\r\noffset: 37228\r\nArchive 3\r\nretention: 15724800\r\nsecondsPerPoint: 14400\r\npoints: 1092\r\nsize: 13104\r\noffset: 49324\r\nArchive 4\r\nretention: 94608000\r\nsecondsPerPoint: 259200\r\npoints: 365\r\nsize: 4380\r\noffset: 62428\r\n```\r\nIs there sth wrong with our setup/config? Did anyone else notice such problems?\r\n\r\nThanks"}}