{"action":"closed","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/18792","repository_url":"https://api.github.com/repos/elastic/elasticsearch","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/18792/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/18792/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/18792/events","html_url":"https://github.com/elastic/elasticsearch/issues/18792","id":159296281,"number":18792,"title":"Version conflict engine exception sometimes returns non-existing version number","user":{"login":"zzzFelix","id":19827840,"avatar_url":"https://avatars.githubusercontent.com/u/19827840?v=3","gravatar_id":"","url":"https://api.github.com/users/zzzFelix","html_url":"https://github.com/zzzFelix","followers_url":"https://api.github.com/users/zzzFelix/followers","following_url":"https://api.github.com/users/zzzFelix/following{/other_user}","gists_url":"https://api.github.com/users/zzzFelix/gists{/gist_id}","starred_url":"https://api.github.com/users/zzzFelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzzFelix/subscriptions","organizations_url":"https://api.github.com/users/zzzFelix/orgs","repos_url":"https://api.github.com/users/zzzFelix/repos","events_url":"https://api.github.com/users/zzzFelix/events{/privacy}","received_events_url":"https://api.github.com/users/zzzFelix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-08T23:04:45Z","updated_at":"2016-06-09T02:17:47Z","closed_at":"2016-06-09T02:17:47Z","body":"**Elasticsearch version**: 2.3.1\r\n\r\n**JVM version**: 1.8.0_65\r\n\r\n**OS version**: OS X 0.11.5 (15F34)\r\n\r\nWhen trying to delete an object with a specified version number and the requested object does not exist, Elasticsearch throws a version conflict engine exception stating that the object is out of date since the current version is -1 (non-existent). However, if the object did still exist just moments ago the exception gives an actual version number (latest version + 1). I assume this is due to the object being only marked as deleted before it's actually thrown out. This state lasts about one minute and can't be avoided by a forced refresh. I get that it may be better performance-wise to mark objects as deleted until some sort of garbage collector comes by. With that exception though, it's not possible to tell whether the object was deleted or updated. Is it possible to set the version number of objects marked as deleted to -1?\r\n\r\n**Steps to reproduce**:\r\n 1. Index an object.\r\n 2. Delete that object.\r\n 3. Try to delete it again while specifying the version number (1 in this case).\r\n4. Get a version conflict engine exception stating that the current version number is 2.\r\n5. Wait about one minute and try to delete the object again: You'll get a version conflict engine exception stating that the current version number is -1."}}
{"actor":{"display_login":"jasontedor"}}