)]}'
{"specs/mitaka/es-delete-journal.rst":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"07f2b07f78ddab761b173680ffb0bd73e86aaf82","unresolved":false,"context_lines":[{"line_number":41,"context_line":"we barbarically engage in Damnatio Memoriae and the ElasticSearch document is"},{"line_number":42,"context_line":"permanently removed from the index. In most cases this is not an issue and the"},{"line_number":43,"context_line":"document is not missed. But computer science is fraught with corner cases."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"There are cases where the existence of a deleted document needs to be"},{"line_number":46,"context_line":"remembered. The main case is concerned with the asynchronous nature of"},{"line_number":47,"context_line":"receiving SearchLight commands. As an example, consider the case where"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_c2e448e1","line":44,"updated":"2016-01-23 00:41:20.000000000","message":"As FYI to you, this Bug and associated review also falls under this category and *could* be referenced. \nhttps://bugs.launchpad.net/searchlight/+bug/1522271","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a9fc727d93b11c4b650c1e5f4bab6960370abfa8","unresolved":false,"context_lines":[{"line_number":50,"context_line":"executed first, followed by the create document command. This ordering will"},{"line_number":51,"context_line":"have the final result of the document being created. Now when queried by an"},{"line_number":52,"context_line":"inquisitive user, SearchLight will embarrassingly return the phantom document"},{"line_number":53,"context_line":"as if it corporeally exists. Folie a deux! Not good for anyone involved."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"We will need to make the SearchLight document CRUD commands order independent."},{"line_number":56,"context_line":"This implies a way to track the state of deleted documents. A deletion with"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_597de26c","line":53,"updated":"2016-01-22 04:53:00.000000000","message":"I don\u0027t understand how this example illustrates the point you\u0027re making, viz., that there are cases where the existence of a deleted document needs to be remembered.  Your example has the delete arriving before the create.  Prior to this spec, what would happen is that the delete will result in a 404 and the create will result in the creation of the document.  After the change you propose here, the delete will still result in a 404, and the create will result in the creation of a document with the field \"deleted: false\" and the TTL not set (since the document hasn\u0027t been deleted yet).  I don\u0027t see how the scheme you propose in this spec will fix this situation.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a9fc727d93b11c4b650c1e5f4bab6960370abfa8","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"We will need to make the SearchLight document CRUD commands order independent."},{"line_number":56,"context_line":"This implies a way to track the state of deleted documents. A deletion with"},{"line_number":57,"context_line":"a deletion!"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"A lesser case for keeping track of deleted documents is that this will allow"},{"line_number":60,"context_line":"Searchight to more easily provide a \"delta\" functionality if so desired in the"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_393cae2e","line":57,"updated":"2016-01-22 04:53:00.000000000","message":"I need help here again.\n\nUnder your scheme, suppose R, U, D come in before C.  They all get 404s, and then you get a doc that\u0027s both not deleted and missing an update, same as you do now.\n\nSuppose C happens, then D is sent but doesn\u0027t arrive until after a later R occurs.  The doc will be served out, same as it is now.\n\nSuppose that U, U, D arrive out of order so that D happens first.  Right now, the D would happen and the Us would 404, which is fine: since the doc is gone, there\u0027s no record of it hanging around with incorrect data due to the non-updates.  On your scheme, would the updates still happen to a document with \"deleted: true\"?  If not, I don\u0027t see what it buys us, because now we have a \"deleted\" document in the index that isn\u0027t accurate.\n\nI\u0027m not trying to be a jerk (though I may be succeeding!). I just don\u0027t understand how the events-out-of-order problem is addressed by your proposal.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a9fc727d93b11c4b650c1e5f4bab6960370abfa8","unresolved":false,"context_lines":[{"line_number":61,"context_line":"future."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"ElasticSearch provides functionality to enable the tracking of deleted"},{"line_number":64,"context_line":"documents. Instead of rashly removing a document, we can avail ourselves of the"},{"line_number":65,"context_line":"TTL (Time To Live) field for that document. This will allow the document to"},{"line_number":66,"context_line":"exist until all ordering issues are resolved. Once ElasticSearch is"},{"line_number":67,"context_line":"asynchronously satisfied, the document will fade away into the distant recesses"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_39510e63","line":64,"updated":"2016-01-22 04:53:00.000000000","message":"This isn\u0027t quite true.  The TTL functionality isn\u0027t implemented in ES to enable tracking of deleted docs, it\u0027s there to provide auto-deletion of docs with a known expiration date.  You are proposing to leverage the TTL functionality in a particular way.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a9fc727d93b11c4b650c1e5f4bab6960370abfa8","unresolved":false,"context_lines":[{"line_number":64,"context_line":"documents. Instead of rashly removing a document, we can avail ourselves of the"},{"line_number":65,"context_line":"TTL (Time To Live) field for that document. This will allow the document to"},{"line_number":66,"context_line":"exist until all ordering issues are resolved. Once ElasticSearch is"},{"line_number":67,"context_line":"asynchronously satisfied, the document will fade away into the distant recesses"},{"line_number":68,"context_line":"of SearchLight\u0027s collective memory."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"The concept and use of the TTL field is described in the ElasticSearch"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_59e9627f","line":67,"updated":"2016-01-22 04:53:00.000000000","message":"I am definitely sounding like a jerk.  A key ordering problem is C-after-D, and I don\u0027t understand how your scheme solves that.  The D happening too early doesn\u0027t bother me very much, because the thing is gone, so who cares whether it disappeared too soon, or whether at the time it was deleted, it said an object had property P when actually the object had property Q?  The really big problem is reads of data that should have been updated already but haven\u0027t, and I don\u0027t see how your scheme addresses that situation.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7adce91e817e4d4dd3971fff0ce589aa359fbff8","unresolved":false,"context_lines":[{"line_number":112,"context_line":"(2) The metadata field would be named \"deleted\" and would always be defined."},{"line_number":113,"context_line":"    When the document is created/modified the field would be set to \"False\"."},{"line_number":114,"context_line":"    When the document is deleted the field would be set to \"True\". This adds a"},{"line_number":115,"context_line":"    little bit of work to the create/modify but simplifies the query command."},{"line_number":116,"context_line":"(3) The metadata field would be named \"state\" and would always be defined. The"},{"line_number":117,"context_line":"    value of \"state\" would be the current state of the document: \"Created\","},{"line_number":118,"context_line":"    \"Modified\" or \"Deleted\". This will allow for \"delta\" functionality to be"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_87e2679e","line":115,"range":{"start_line":115,"start_character":63,"end_line":115,"end_character":68},"updated":"2016-01-20 20:34:11.000000000","message":"1 and 2 seem the same in terms of query complexity; in both cases we have to provide a filter (either to check the non-existence or value of this field). Since we already apply filters to all queries, neither of these are a big deal.\n\nWith the change to store documents per role (https://review.openstack.org/#/c/257516/) we\u0027ll also always be applying a transform to documents as we index them, so it wouldn\u0027t be an issue adding a default \u0027deleted:false\u0027 value at that time.\n\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-transform.html also allows fields to be applied at index-time","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"91e3a821f2224bba1b08d538ca8a9187e2de939d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"(2) The metadata field would be named \"deleted\" and would always be defined."},{"line_number":113,"context_line":"    When the document is created/modified the field would be set to \"False\"."},{"line_number":114,"context_line":"    When the document is deleted the field would be set to \"True\". This adds a"},{"line_number":115,"context_line":"    little bit of work to the create/modify but simplifies the query command."},{"line_number":116,"context_line":"(3) The metadata field would be named \"state\" and would always be defined. The"},{"line_number":117,"context_line":"    value of \"state\" would be the current state of the document: \"Created\","},{"line_number":118,"context_line":"    \"Modified\" or \"Deleted\". This will allow for \"delta\" functionality to be"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_4f60fc35","line":115,"range":{"start_line":115,"start_character":63,"end_line":115,"end_character":68},"in_reply_to":"9a68dd71_87e2679e","updated":"2016-01-21 00:18:27.000000000","message":"See below.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7adce91e817e4d4dd3971fff0ce589aa359fbff8","unresolved":false,"context_lines":[{"line_number":116,"context_line":"(3) The metadata field would be named \"state\" and would always be defined. The"},{"line_number":117,"context_line":"    value of \"state\" would be the current state of the document: \"Created\","},{"line_number":118,"context_line":"    \"Modified\" or \"Deleted\". This will allow for \"delta\" functionality to be"},{"line_number":119,"context_line":"    added to SearchLight in the future. This work is the same as option (2)."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"SearchLight Delete Functionality Modification"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_c7861fb9","line":119,"range":{"start_line":119,"start_character":28,"end_line":119,"end_character":31},"updated":"2016-01-20 20:34:11.000000000","message":"I would imagine the vast majority of resources would end up \u0027modified\u0027 quite quickly, so unless there\u0027s a compelling reason to do this i\u0027d be inclined to keep it simple and treat this as a boolean field.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"91e3a821f2224bba1b08d538ca8a9187e2de939d","unresolved":false,"context_lines":[{"line_number":116,"context_line":"(3) The metadata field would be named \"state\" and would always be defined. The"},{"line_number":117,"context_line":"    value of \"state\" would be the current state of the document: \"Created\","},{"line_number":118,"context_line":"    \"Modified\" or \"Deleted\". This will allow for \"delta\" functionality to be"},{"line_number":119,"context_line":"    added to SearchLight in the future. This work is the same as option (2)."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"SearchLight Delete Functionality Modification"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_aff9784f","line":119,"range":{"start_line":119,"start_character":28,"end_line":119,"end_character":31},"in_reply_to":"9a68dd71_c7861fb9","updated":"2016-01-21 00:18:27.000000000","message":"I was listing all options for the sake of being complete. I prefer option (2). The functionality is explicit and less error prone. Since having a \"delta\" functionality is not on the horizon, there is no need to add the complexities for a non-binary field.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7adce91e817e4d4dd3971fff0ce589aa359fbff8","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    \"Modified\" or \"Deleted\". This will allow for \"delta\" functionality to be"},{"line_number":119,"context_line":"    added to SearchLight in the future. This work is the same as option (2)."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"SearchLight Delete Functionality Modification"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"When a document is deleted, we will need to set both the TTL field and the"},{"line_number":124,"context_line":"metadata field. This is considered a modification to the original document."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_a7776bd3","line":121,"range":{"start_line":121,"start_character":11,"end_line":121,"end_character":12},"updated":"2016-01-20 20:34:11.000000000","message":"Nit - make these headers if possible (i\u0027m not sure if the template prevents that)","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7adce91e817e4d4dd3971fff0ce589aa359fbff8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"SearchLight Delete Functionality Modification"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"When a document is deleted, we will need to set both the TTL field and the"},{"line_number":124,"context_line":"metadata field. This is considered a modification to the original document."},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"SearchLight Query Functionality Modification"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_27185b84","line":124,"range":{"start_line":124,"start_character":9,"end_line":124,"end_character":14},"updated":"2016-01-20 20:34:11.000000000","message":"Clarify that this will either be an explicit reindexing or a scripted update (which is the same except without the roundtrip).","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"91e3a821f2224bba1b08d538ca8a9187e2de939d","unresolved":false,"context_lines":[{"line_number":121,"context_line":"SearchLight Delete Functionality Modification"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"When a document is deleted, we will need to set both the TTL field and the"},{"line_number":124,"context_line":"metadata field. This is considered a modification to the original document."},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"SearchLight Query Functionality Modification"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_0f3be4ec","line":124,"range":{"start_line":124,"start_character":9,"end_line":124,"end_character":14},"in_reply_to":"9a68dd71_27185b84","updated":"2016-01-21 00:18:27.000000000","message":"Since we have had issues with ElasticSearch modify actions in the past, this will be a read/modify/write. Is this what you meant by scripted updated?","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7adce91e817e4d4dd3971fff0ce589aa359fbff8","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"If we choose to implement either metadata option (2) or (3) we will need to"},{"line_number":135,"context_line":"set the value of the metadata field appropriately for a create or a modify"},{"line_number":136,"context_line":"command."},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"Configuration Changes:"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_c35ff20c","line":136,"range":{"start_line":136,"start_character":7,"end_line":136,"end_character":8},"updated":"2016-01-20 20:34:11.000000000","message":"There\u0027s an additional requirement to modify the listener to not apply a change if the document\u0027s been deleted; I think https://review.openstack.org/#/c/255751/ covers this (in that the version will be later than the new document\u0027s).","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"91e3a821f2224bba1b08d538ca8a9187e2de939d","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"If we choose to implement either metadata option (2) or (3) we will need to"},{"line_number":135,"context_line":"set the value of the metadata field appropriately for a create or a modify"},{"line_number":136,"context_line":"command."},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"Configuration Changes:"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_0f444472","line":136,"range":{"start_line":136,"start_character":7,"end_line":136,"end_character":8},"in_reply_to":"9a68dd71_c35ff20c","updated":"2016-01-21 00:18:27.000000000","message":"The versioning in https://review.openstack.org/#/c/255751/ should cover this. I\u0027ll double check.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a9fc727d93b11c4b650c1e5f4bab6960370abfa8","unresolved":false,"context_lines":[{"line_number":146,"context_line":"documents and delete those with expired TTL values. The default is to run the"},{"line_number":147,"context_line":"purge process every 60 seconds. This default value can be overriden by a"},{"line_number":148,"context_line":"configuration value."},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"Alternatives"},{"line_number":151,"context_line":"------------"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_bd35e9da","line":149,"updated":"2016-01-22 04:53:00.000000000","message":"I can\u0027t tell if you\u0027re joking about the 7-day TTL, but if you\u0027re serious, then there\u0027s no reason to run this purge more than once a day.  Plus, since you have the \"deleted\" field, there\u0027s no way a deleted doc that isn\u0027t purged is somehow going to show up in search results anyway.  The 60 sec biz is for the autodeletion-of-docs-with-expiration-dates case.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a9fc727d93b11c4b650c1e5f4bab6960370abfa8","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"Alternatives"},{"line_number":151,"context_line":"------------"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"References"},{"line_number":154,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9a68dd71_fd6921bf","line":152,"updated":"2016-01-22 04:53:00.000000000","message":"An alternative is to do nothing.  If you couldn\u0027t tell, I\u0027m a bit skeptical of a deleted document that says \"hey, I\u0027m deleted\".  The best way to delete a document is actually to delete it.","commit_id":"6960ccd5cc33ab681336c8cf9965320a7447c460"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"d784d7ffe06e68e811aaec98866ad13dd658e9ce","unresolved":false,"context_lines":[{"line_number":45,"context_line":"index updates\":"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"https://bugs.launchpad.net/searchlight/+bug/1522271"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"There are cases where the existence of a deleted document needs to be"},{"line_number":50,"context_line":"remembered. The main case is concerned with the asynchronous nature of"},{"line_number":51,"context_line":"receiving Searchlight commands. We will need to make the Searchlight"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_0cd9e056","line":48,"updated":"2016-01-26 01:08:04.000000000","message":"Here\u0027s where I believe the original concern came.  The services that are sending notifications can be distributed for HA or scalability reasons and we were concerned that glance or nova or swift could send updates in a non-determinate order.\n\nI should further note that some of my initial concern came from the fact that if we experience errors with handling a notification eventually we must choose to either drop them and continue or we must just forever stay blocked. I think the external versioning bug mentioned above handles this case though.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"6d608c1b0090cf82778d3aa5c14e2df4c932d965","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"There are cases where the existence of a deleted document needs to be"},{"line_number":50,"context_line":"remembered. The main case is concerned with the asynchronous nature of"},{"line_number":51,"context_line":"receiving Searchlight commands. We will need to make the Searchlight"},{"line_number":52,"context_line":"document CRUD commands order independent. This implies a way to track"},{"line_number":53,"context_line":"the state of deleted documents. See below for more concrete examples of"},{"line_number":54,"context_line":"the issues we are resolving with this blueprint."}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_c7072816","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":30},"updated":"2016-01-25 23:00:51.000000000","message":"\u0027receiving service notifications\u0027","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"d784d7ffe06e68e811aaec98866ad13dd658e9ce","unresolved":false,"context_lines":[{"line_number":51,"context_line":"receiving Searchlight commands. We will need to make the Searchlight"},{"line_number":52,"context_line":"document CRUD commands order independent. This implies a way to track"},{"line_number":53,"context_line":"the state of deleted documents. See below for more concrete examples of"},{"line_number":54,"context_line":"the issues we are resolving with this blueprint."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"A lesser case for keeping track of deleted documents is that this will allow"},{"line_number":57,"context_line":"Searchlight to more easily provide a \"delta\" functionality if so desired in the"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_eca32cb0","line":54,"updated":"2016-01-26 01:08:04.000000000","message":"So, if I remember right, this blueprint came up primarily due to the syncing zero downtime resyncing process and not all of these.\n\nThe concern was simply that I will be pointing a listener at an index in the process of being re-sync\u0027d. Meaning that the sync job may actually be trying to do things on documents that we received competing notifications and vice versa.\n\nI\u0027m kind of wondering if the point Brian made before about document handling and the bug fix above will handle all of this.  I\u0027ve got to be honest that I will need more time to think about this one again.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"667665143983d6e3fa20ff6c9242b33584b4700f","unresolved":false,"context_lines":[{"line_number":51,"context_line":"receiving Searchlight commands. We will need to make the Searchlight"},{"line_number":52,"context_line":"document CRUD commands order independent. This implies a way to track"},{"line_number":53,"context_line":"the state of deleted documents. See below for more concrete examples of"},{"line_number":54,"context_line":"the issues we are resolving with this blueprint."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"A lesser case for keeping track of deleted documents is that this will allow"},{"line_number":57,"context_line":"Searchlight to more easily provide a \"delta\" functionality if so desired in the"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_c67157aa","line":54,"in_reply_to":"9a68dd71_8c52b065","updated":"2016-01-26 11:44:39.000000000","message":"It\u0027s a little confusing, hope I get it right. The external version patch can only ensure correctness of a series of update operations, it doesn\u0027t do checks on delete action. For plugins checking APIs before updating, it will be fine. But as Travis said, for plugins solely use notifications, combination of wrong order update/delete operations will cause some trouble. Maybe should illustrate the context.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"9d24512a391e9f642ac7157a98a9b73d9abb0363","unresolved":false,"context_lines":[{"line_number":51,"context_line":"receiving Searchlight commands. We will need to make the Searchlight"},{"line_number":52,"context_line":"document CRUD commands order independent. This implies a way to track"},{"line_number":53,"context_line":"the state of deleted documents. See below for more concrete examples of"},{"line_number":54,"context_line":"the issues we are resolving with this blueprint."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"A lesser case for keeping track of deleted documents is that this will allow"},{"line_number":57,"context_line":"Searchlight to more easily provide a \"delta\" functionality if so desired in the"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_18100d4e","line":54,"in_reply_to":"9a68dd71_c67157aa","updated":"2016-01-26 18:08:06.000000000","message":"This proposal would cause deletion to be a special case of update.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"32431008272d96ca62dd503a0317a18d8d73be67","unresolved":false,"context_lines":[{"line_number":51,"context_line":"receiving Searchlight commands. We will need to make the Searchlight"},{"line_number":52,"context_line":"document CRUD commands order independent. This implies a way to track"},{"line_number":53,"context_line":"the state of deleted documents. See below for more concrete examples of"},{"line_number":54,"context_line":"the issues we are resolving with this blueprint."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"A lesser case for keeping track of deleted documents is that this will allow"},{"line_number":57,"context_line":"Searchlight to more easily provide a \"delta\" functionality if so desired in the"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_8c52b065","line":54,"in_reply_to":"9a68dd71_eca32cb0","updated":"2016-01-26 01:18:41.000000000","message":"Ok, it just hit me the case we talked about before.  Maybe this could be called out earlier.\n\nWe are running the sync job at the same time that we are receiving notifications.\n\nWe may receive a notification for delete on a document that we haven\u0027t even loaded into the database, however our sync job is in the middle of doing Create / Updates from the current docs it received in an API query.  The notification see delete, but that it isn\u0027t already loaded, so it just drops it.  The sync job (perhaps milliseconds apart) is loading in the API results and it has the document in its list.  It blindly does a create on the document and the fact that the document was deleted after retrieving an API query is lost.  The document is loaded into the index even though it was actually deleted.\n\nAt the moment, for APIs that we do callback for notification processing makes this unlikely to happen, but we are actively trying to make the notifications include all data so we don\u0027t have to do an API callback. This is already the case for designate.  So, this blueprint is important.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"6d608c1b0090cf82778d3aa5c14e2df4c932d965","unresolved":false,"context_lines":[{"line_number":87,"context_line":"Consider the following Nova operations: \"Create Obj1\", \"Modify Obj1\", \"Modify Obj1\","},{"line_number":88,"context_line":"\"Modify Obj1\" and \"Delete Obj1\". Since we are not able to guarantee the order of"},{"line_number":89,"context_line":"these operations, we will further consider what happens when the last modify"},{"line_number":90,"context_line":"command arrives after the delete operation. ElasticSearch wil see the following"},{"line_number":91,"context_line":"operations (in this order): ::"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    PUT /searchlight/obj1        # Create Obj1"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_475498c8","line":90,"range":{"start_line":90,"start_character":33,"end_line":90,"end_character":42},"updated":"2016-01-25 23:00:51.000000000","message":"I would clarify that it\u0027s not so much that the update notification *arrives* after the delete notification (though I would use the word \u0027notification\u0027 rather than \u0027command\u0027 or \u0027operation\u0027), since the messaging framework guarantees that messages are delivered in order (and thus for a single listener this is never a problem). Instead, the problem occurs if it happens that the operations that modify the elasticsearch index are not performed in the same order, perhaps because a listener process is starved of resources or i/o long enough for a later notification to get dealt with first.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5ef77563f130df9422dfad4245b5ae9426a13caf","unresolved":false,"context_lines":[{"line_number":90,"context_line":"command arrives after the delete operation. ElasticSearch wil see the following"},{"line_number":91,"context_line":"operations (in this order): ::"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    PUT /searchlight/obj1        # Create Obj1"},{"line_number":94,"context_line":"    PUT /searchlight/obj1        # Modify Obj1"},{"line_number":95,"context_line":"    PUT /searchlight/obj1        # Modify Obj1"},{"line_number":96,"context_line":"    DELETE /searchlight/obj1     # Delete Obj1"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_e8ae9d97","line":93,"updated":"2016-01-26 13:54:38.000000000","message":"Shouldn\u0027t the create be a POST?","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"4308c3af0acbddd55e51e006090b906030b345d5","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    When the document is created/modified the field would be set to \"False\"."},{"line_number":167,"context_line":"    When the document is deleted the field would be set to \"True\". This adds a"},{"line_number":168,"context_line":"    little bit of work to the create/modify but simplifies the query command."},{"line_number":169,"context_line":"(3) The metadata field would be named \"state\" and would always be defined. The"},{"line_number":170,"context_line":"    value of \"state\" would be the current state of the document: \"Created\","},{"line_number":171,"context_line":"    \"Modified\" or \"Deleted\". This will allow for \"delta\" functionality to be"},{"line_number":172,"context_line":"    added to Searchlight in the future. This work is the same as option (2)."}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_c68ce081","line":169,"updated":"2016-01-26 16:28:14.000000000","message":"If create comes in after update, the create state would never get stored because we only are planning to update the document if the incoming notification is newer than what is stored (the bug mentioned at the beginning of this).  So, I don\u0027t see value in this.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"667665143983d6e3fa20ff6c9242b33584b4700f","unresolved":false,"context_lines":[{"line_number":198,"context_line":"field and enable TTL functionality. The \"deleted\" field will need to be set"},{"line_number":199,"context_line":"appropriately. If the \"deleted\" field is set to true we will not modify"},{"line_number":200,"context_line":"the document. These modifications depend on the version functionality being"},{"line_number":201,"context_line":"in place [3]."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Configuration Changes"},{"line_number":204,"context_line":"----------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_da2364a6","line":201,"updated":"2016-01-26 11:44:39.000000000","message":"Steve McLellan\nJan 21 4:34 AM\nThere\u0027s an additional requirement to modify the listener to not apply a change if the document\u0027s been deleted; I think https://review.openstack.org/#/c/255751/ covers this (in that the version will be later than the new document\u0027s).\n\nExternal version cannot guarantee not applying a change if the document\u0027s been deleted. It\u0027s done by some plugins checking OpenStack APIs I think. So maybe the functionality modification is checking APIs or \"deleted\" field to see if the document is removed before updating them.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"611044695b4226e522c95d0dd0780eec53f0a596","unresolved":false,"context_lines":[{"line_number":198,"context_line":"field and enable TTL functionality. The \"deleted\" field will need to be set"},{"line_number":199,"context_line":"appropriately. If the \"deleted\" field is set to true we will not modify"},{"line_number":200,"context_line":"the document. These modifications depend on the version functionality being"},{"line_number":201,"context_line":"in place [3]."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Configuration Changes"},{"line_number":204,"context_line":"----------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_de4ed395","line":201,"in_reply_to":"9a68dd71_98039d0d","updated":"2016-01-27 00:00:44.000000000","message":"OK, so when \u0027delete\u0027 operations come, we can use messaging timestamp and update time in the index to form a \u0027version\u0027, then marked the document as deleted and update the version.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"9d24512a391e9f642ac7157a98a9b73d9abb0363","unresolved":false,"context_lines":[{"line_number":198,"context_line":"field and enable TTL functionality. The \"deleted\" field will need to be set"},{"line_number":199,"context_line":"appropriately. If the \"deleted\" field is set to true we will not modify"},{"line_number":200,"context_line":"the document. These modifications depend on the version functionality being"},{"line_number":201,"context_line":"in place [3]."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Configuration Changes"},{"line_number":204,"context_line":"----------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_98039d0d","line":201,"in_reply_to":"9a68dd71_da2364a6","updated":"2016-01-26 18:08:06.000000000","message":"As long as \u0027delete\u0027 operations also have a \u0027version\u0027 (i.e. we get enough timestamp data to do it) it should work. If not.. this won\u0027t. For instance, on a delete, we need to mark the document as deleted and update the version as though it were any other update","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"6d608c1b0090cf82778d3aa5c14e2df4c932d965","unresolved":false,"context_lines":[{"line_number":204,"context_line":"----------------------"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"We need to define the TTL value to determine how long a deleted document"},{"line_number":207,"context_line":"endures. Seven days is the standard amount of time to be sitting shiva,"},{"line_number":208,"context_line":"but for Searchlight we will use a TTL value on the order of minutes. This"},{"line_number":209,"context_line":"default value can be overridden by a configuration value."},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_c7dba84d","line":207,"range":{"start_line":207,"start_character":9,"end_line":207,"end_character":70},"updated":"2016-01-25 23:00:51.000000000","message":"Remove; it\u0027s confusing to mention an unrelated time period.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"55a7cf111f449f69dc2cbca51d202d6e016b500f","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"Alternatives"},{"line_number":218,"context_line":"------------"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"References"},{"line_number":221,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a68dd71_00bc41b9","line":219,"updated":"2016-01-26 04:07:14.000000000","message":"ES also does garbage collection, and I think you can set the gc interval.  It might be good to say why using the TTL is better for Searchlight than changing the gc interval.","commit_id":"8d0f14e7261ad6c6a28b0e9ccd52d89b3154fcbe"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"34dbb96d44435abe7145ca3f1708a8cf81594573","unresolved":false,"context_lines":[{"line_number":46,"context_line":"deleted documents."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"With the addition of the Zero Downtime Re-indexing, Searchlight will be"},{"line_number":49,"context_line":"receiving notifications (from both re-syncing and new document creation) from"},{"line_number":50,"context_line":"the services in a distributed environment. These notifications will result"},{"line_number":51,"context_line":"in an asynchronous sequence of ElasticSearch operations. Searchlight needs to"},{"line_number":52,"context_line":"make sure that the state of the eco-system is always correctly reflected in"}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a5de9d1_1ce8df0f","line":49,"updated":"2016-01-28 15:47:11.000000000","message":"notifications aren\u0027t received from re-syncing. This sentence would be more accurate:\n\n...Searchlight will be performing CRUD operations on documents simultaneously from both re-syncing (which uses API queries) and notifications emitted from the services...","commit_id":"8fc23b9a6f70b83f3124e45b429ad3d994758130"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"34dbb96d44435abe7145ca3f1708a8cf81594573","unresolved":false,"context_lines":[{"line_number":91,"context_line":"Example #1 (Fusillade)"},{"line_number":92,"context_line":"----------------------"},{"line_number":93,"context_line":"Consider the following Nova notifications \"Create Obj1\", \"Modify Obj1\", \"Modify Obj1\","},{"line_number":94,"context_line":"\"Modify Obj1\" and \"Delete Obj1\". Due to the asynchronous nature of the eco-system."},{"line_number":95,"context_line":"the order the notifications are sent by the listener may not be the same order"},{"line_number":96,"context_line":"the operations are received by ElasticSearch. In some cases, the last ElasticSearch"},{"line_number":97,"context_line":"modify operation will arrive after the ElasticSearch delete operation. ElasticSearch"}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a5de9d1_7c6eb397","line":94,"updated":"2016-01-28 15:47:11.000000000","message":"Non blocking nit:  \n\nDue to the distributed and asynchronous...","commit_id":"8fc23b9a6f70b83f3124e45b429ad3d994758130"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"34dbb96d44435abe7145ca3f1708a8cf81594573","unresolved":false,"context_lines":[{"line_number":111,"context_line":"Example #2 (Nostradamus)"},{"line_number":112,"context_line":"------------------------"},{"line_number":113,"context_line":"We will also need to handle the simplistic case of Nova creating a document"},{"line_number":114,"context_line":"followed by Nova deleting the document. This case could be rather common"},{"line_number":115,"context_line":"in the Zero Downtime Re-indexing work [1]. This sequence results in the"},{"line_number":116,"context_line":"Nova notifications \"Create Obj2\" and \"Delete Obj2\". If the ElasticSearch"},{"line_number":117,"context_line":"create operation arrives after the ElasticSearch delete operation,"}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a5de9d1_1c777f3b","line":114,"updated":"2016-01-28 15:47:11.000000000","message":"Still not sure if this is actually possible to be delivered out of order...  Not 100% sure if nova itself will always guarantee to emit them in perfect order no matter the deployment architecture, but if it does, then messaging will deliver in order... but let\u0027s just move on.","commit_id":"8fc23b9a6f70b83f3124e45b429ad3d994758130"}]}
