)]}'
{"specs/newton/index-performance-enhancement.rst":[{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"23be825fd66c4d18c28fa0bf5206dac2d319dbb2","unresolved":false,"context_lines":[{"line_number":28,"context_line":" * For each resource type that *does* need to be re-indexed, *searchlight-manage* will call"},{"line_number":29,"context_line":"   the plugin associated with that resource type. The plugin will make API calls to that"},{"line_number":30,"context_line":"   service and re-index the information."},{"line_number":31,"context_line":" * For each resource tyrpe that *does not* need to be re-indexed, *searchlight-manage* will"},{"line_number":32,"context_line":"   call ElasticSearch directly and re-index from the old index into the new index."},{"line_number":33,"context_line":" * Once all re-indexing is complete, the ES aliases are adjusted and *searchlight-manage*"},{"line_number":34,"context_line":"   returns to the user."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_ee661628","line":31,"range":{"start_line":31,"start_character":21,"end_line":31,"end_character":26},"updated":"2016-06-21 07:04:53.000000000","message":"s/tyrpe/type","commit_id":"bdfe20ae647b63460db0d5833f9094b0868780eb"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"23be825fd66c4d18c28fa0bf5206dac2d319dbb2","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"As described in the blueprint, we would like to reduce the time to complete the re-index. Our assumption"},{"line_number":43,"context_line":"is that the mainstream case will be for an admin to kick off a re-index and not wanting to wait for it"},{"line_number":44,"context_line":"to complete. This is especially noticable when the particular resource type may have a lot of data taking"},{"line_number":45,"context_line":"a long time to re-index (e.g. Swift). But we still need to handle the case where the admin wants to know"},{"line_number":46,"context_line":"when the re-index completed and if there were any errors."},{"line_number":47,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_ceab5a1c","line":44,"range":{"start_line":44,"start_character":32,"end_line":44,"end_character":41},"updated":"2016-06-21 07:04:53.000000000","message":"s/noticable/noticeable","commit_id":"bdfe20ae647b63460db0d5833f9094b0868780eb"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"23be825fd66c4d18c28fa0bf5206dac2d319dbb2","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"2. **At what level should we create the indexing threads?**"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"The obvious candidates are the resource group type or the resource group. The main reason that we are"},{"line_number":64,"context_line":"considering these enhancements is due to the large amount of time for a particular resource type group."},{"line_number":65,"context_line":"But not for a particular resource type within the resource type group."},{"line_number":66,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_ae8feeca","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":50},"updated":"2016-06-21 07:04:53.000000000","message":"resource type group","commit_id":"bdfe20ae647b63460db0d5833f9094b0868780eb"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":31,"context_line":" * For each resource type that *does not* need to be re-indexed, *searchlight-manage* will"},{"line_number":32,"context_line":"   call ElasticSearch directly and re-index from the old index into the new index."},{"line_number":33,"context_line":" * Once all re-indexing is complete, the ES aliases are adjusted and *searchlight-manage*"},{"line_number":34,"context_line":"   returns to the user."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"This implies the following:"},{"line_number":37,"context_line":" * The admin must wait for all of the re-indexing to complete before *searchlight-manage*"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_58512362","line":34,"updated":"2016-06-21 23:46:30.000000000","message":"It should mention that these are done serially and so the entire job takes as long the combined length of all of them (or use some of your O notations from the BP).","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"2. **At what level should we create the indexing threads?**"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"The obvious candidates are the resource type group or the resource group. The main reason that"},{"line_number":65,"context_line":"we are considering these enhancements is due to the large amount of time for a particular"},{"line_number":66,"context_line":"resource type group. But not for a particular resource type within the resource type group."},{"line_number":67,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_f849ef8f","line":64,"range":{"start_line":64,"start_character":31,"end_line":64,"end_character":72},"updated":"2016-06-21 23:46:30.000000000","message":"my small reptile-like brain got stuck on these words trying to understand the difference (like there was an OR in them) and the following sentences didn\u0027t help to clarify. I think if you just used the term resource group like we do in our docs and copy the following from our docs into here, it would be simpler to read.\n\nA resource group is a collection of plugins that share an Elasticsearch index. Since each plugin represents a resource type, you can think of a resource group as a collection of resource types.\n\nhttp://docs.openstack.org/developer/searchlight/indexingservice.html","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":62,"context_line":"2. **At what level should we create the indexing threads?**"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"The obvious candidates are the resource type group or the resource group. The main reason that"},{"line_number":65,"context_line":"we are considering these enhancements is due to the large amount of time for a particular"},{"line_number":66,"context_line":"resource type group. But not for a particular resource type within the resource type group."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Internal to *searchlight-manage*, this distinction fades rather quickly. We use the resource"},{"line_number":69,"context_line":"type groups to only determine which resource types need to be re-indexed. We also have an"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_336ef8c9","line":66,"range":{"start_line":65,"start_character":0,"end_line":66,"end_character":19},"updated":"2016-06-21 23:46:30.000000000","message":"We are? Why not for a particular resource type?  The implied thought leading to this seems to be missing.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e485947843947d59d985c03d5c846819994ad7d6","unresolved":false,"context_lines":[{"line_number":62,"context_line":"2. **At what level should we create the indexing threads?**"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"The obvious candidates are the resource type group or the resource group. The main reason that"},{"line_number":65,"context_line":"we are considering these enhancements is due to the large amount of time for a particular"},{"line_number":66,"context_line":"resource type group. But not for a particular resource type within the resource type group."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Internal to *searchlight-manage*, this distinction fades rather quickly. We use the resource"},{"line_number":69,"context_line":"type groups to only determine which resource types need to be re-indexed. We also have an"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_298b7d69","line":66,"range":{"start_line":65,"start_character":0,"end_line":66,"end_character":19},"in_reply_to":"3aaa91ec_336ef8c9","updated":"2016-06-24 17:35:58.000000000","message":"Yeah, not sure about the reasoning here. There\u0027s no reason really to tie the number of threads to anything in particular; it would make sense to have a pool whose job queue is the indexing for each resource type in a resource group, since the error handling at that level is straightforward (if any jobs fail, cancel others and roll it all back).","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":71,"context_line":"only the resource types that were explicitly demanded by the user. All other resource types"},{"line_number":72,"context_line":"are re-indexed directly within ElasticSearch.  We need to keep this enhancement."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Keeping the current design in tact means we will want to thread on the fine resource type level"},{"line_number":75,"context_line":"and not at the gross resource type group level."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"3. **When will we know to switch the ElasticSearch aliases?**"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_33ca78a2","line":74,"range":{"start_line":74,"start_character":27,"end_line":74,"end_character":34},"updated":"2016-06-21 23:46:30.000000000","message":"one word","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":72,"context_line":"are re-indexed directly within ElasticSearch.  We need to keep this enhancement."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Keeping the current design in tact means we will want to thread on the fine resource type level"},{"line_number":75,"context_line":"and not at the gross resource type group level."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"3. **When will we know to switch the ElasticSearch aliases?**"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_f30470c7","line":75,"updated":"2016-06-21 23:46:30.000000000","message":"Parent child relationships would be the finest grain level we could go.  E.g., you can\u0027t parallelize indexing of children separately from their parents.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e485947843947d59d985c03d5c846819994ad7d6","unresolved":false,"context_lines":[{"line_number":72,"context_line":"are re-indexed directly within ElasticSearch.  We need to keep this enhancement."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Keeping the current design in tact means we will want to thread on the fine resource type level"},{"line_number":75,"context_line":"and not at the gross resource type group level."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"3. **When will we know to switch the ElasticSearch aliases?**"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_29e25d2f","line":75,"in_reply_to":"3aaa91ec_f30470c7","updated":"2016-06-24 17:35:58.000000000","message":"You can. There\u0027s no requirement to index them together.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2b62ba23c15d3b4d031b684de85edde336c39a4","unresolved":false,"context_lines":[{"line_number":79,"context_line":"In the serial model of re-indexing, it is trivial to know when to switch the ElasticSearch alias"},{"line_number":80,"context_line":"to the use the new index. It\u0027s when the last index finishes! Switching over to a model of"},{"line_number":81,"context_line":"asynchronous threads running in parallel complicates the alias update. The proposal is that"},{"line_number":82,"context_line":"we keep a reference count of active threads. Each thread will decrement the reference count"},{"line_number":83,"context_line":"upon completion. When the reference count reaches zero, that thread knows it is the sole"},{"line_number":84,"context_line":"survivor of the Searchlight Tontine and collects it\u0027s prize. The prize being this remaining"},{"line_number":85,"context_line":"thread will update the ElasticSearch aliases before it too expires."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_b5814250","line":82,"range":{"start_line":82,"start_character":29,"end_line":82,"end_character":35},"updated":"2016-06-21 17:10:27.000000000","message":"Do you mean threads in the python sense? Or in the sense of totally separate operating system processes?\n\nIf there\u0027s a single python process that spawns worker threads/processes, there exist already mechanisms for waiting until they\u0027re all done. If you\u0027re talking about totally isolated operating system processes it would require some outside coordination, though i think there would be many challenges to solve.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2b62ba23c15d3b4d031b684de85edde336c39a4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"following attributes:"},{"line_number":89,"context_line":"* To be available to all threads."},{"line_number":90,"context_line":"* To be non-volatile so that it can recoverable."},{"line_number":91,"context_line":"* To be able to handle multiple re-indexing jobs happening simultaneously."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"One approach is to place this internal state within a new index in ElasticSearch. This new"},{"line_number":94,"context_line":"index would not be used by any other part of Searchlight. The new index will also be neither"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_35cef283","line":91,"range":{"start_line":91,"start_character":35,"end_line":91,"end_character":43},"updated":"2016-06-21 17:10:27.000000000","message":"This seems like a much larger problem; you\u0027re talking about me running searchlight-manage index sync a load of times myself? What should the behavior be? This starts to get into the territory of a distributed system that would likely be more complicated than everything we have right now.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":88,"context_line":"following attributes:"},{"line_number":89,"context_line":"* To be available to all threads."},{"line_number":90,"context_line":"* To be non-volatile so that it can recoverable."},{"line_number":91,"context_line":"* To be able to handle multiple re-indexing jobs happening simultaneously."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"One approach is to place this internal state within a new index in ElasticSearch. This new"},{"line_number":94,"context_line":"index would not be used by any other part of Searchlight. The new index will also be neither"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_d3e174d2","line":91,"range":{"start_line":91,"start_character":35,"end_line":91,"end_character":43},"in_reply_to":"3aaa91ec_35cef283","updated":"2016-06-21 23:46:30.000000000","message":"Agreed, this broadens the scope beyond what we really support right now.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"One approach is to place this internal state within a new index in ElasticSearch. This new"},{"line_number":94,"context_line":"index would not be used by any other part of Searchlight. The new index will also be neither"},{"line_number":95,"context_line":"available nor visible to any end-users of Searchlight."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"A second approach is to isolate all of the re-indexing into an asynchronous \"master\" thread."},{"line_number":98,"context_line":"This master thread will then start all of the subservient threads, waiting for them to finish."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_d3f2146f","line":95,"updated":"2016-06-21 23:46:30.000000000","message":"Thinking more about the above, we definitely should document that searchlight-manage should only be run one at a time. And we probably should still add using an ES index as a semaphore to prevent more than one searchlight-manage index sync from happening at once. That is troublesome and would require a --force acquire lock option. Do you want to cover that in this BP or as a separate bug?","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2b62ba23c15d3b4d031b684de85edde336c39a4","unresolved":false,"context_lines":[{"line_number":94,"context_line":"index would not be used by any other part of Searchlight. The new index will also be neither"},{"line_number":95,"context_line":"available nor visible to any end-users of Searchlight."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"A second approach is to isolate all of the re-indexing into an asynchronous \"master\" thread."},{"line_number":98,"context_line":"This master thread will then start all of the subservient threads, waiting for them to finish."},{"line_number":99,"context_line":"When all threads have finished, the master thread will switch the alias before terminating."},{"line_number":100,"context_line":"An issue here is communicating the status of the worker threads in controlled by the master"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_b53662b2","line":97,"range":{"start_line":97,"start_character":24,"end_line":97,"end_character":31},"updated":"2016-06-21 17:10:27.000000000","message":"I guess this is sort of an answer to my question above. If there\u0027s intended to be any controlling process that sets up the parallelism i don\u0027t see any reason to complicate things beyond waiting for threads/subprocesses to finish the work they were allocated.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":100,"context_line":"An issue here is communicating the status of the worker threads in controlled by the master"},{"line_number":101,"context_line":"with subsequent runs of *searchlight-manage*. See issues #4 and #5 below for more details on"},{"line_number":102,"context_line":"this usage."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"4. **How do we restore the missing behavior to *searchlight-manage*?**"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"The end-user visible behavior of *searchlight-manage* will change for the sake of these"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_f362b015","line":103,"updated":"2016-06-21 23:46:30.000000000","message":"So, what is your proposal between these two?","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":108,"context_line":"the admin know if there was a failure during the re-index. This can be especially troublesome"},{"line_number":109,"context_line":"if the failure resulted in the re-indexing being aborted."},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"Since we are assuming this is not the mainstream case, we can handle this in two separate ways."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"a. We will add a new command line option to remove the threads running asynchronously to"},{"line_number":114,"context_line":"*searchlight-manage*.  When this option is specified, *searchlight-manage* will still run each"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_537464ce","line":111,"range":{"start_line":111,"start_character":13,"end_line":111,"end_character":21},"updated":"2016-06-21 23:46:30.000000000","message":"my experience points otherwise.... ;)","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2b62ba23c15d3b4d031b684de85edde336c39a4","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    *% searchlight-manage index sync sync*"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"b. We will return a job ID when the threads are running asycnhronously. We will add a new"},{"line_number":122,"context_line":"command to *searchlight-manage* to return the state of a specified job ID. The internal state"},{"line_number":123,"context_line":"will be stored in ElasticSearch in the new index as described in design issue #3 (above)."},{"line_number":124,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_75f23a9c","line":121,"range":{"start_line":121,"start_character":17,"end_line":121,"end_character":18},"updated":"2016-06-21 17:10:27.000000000","message":"I guess i don\u0027t really get why we\u0027d go to the trouble of doing this, versus the admin running the index command in the background or in screen or via any of the traditional unix-y ways of handling long-running processes. Why not \n\n   nohup searchlight-manage blah blah 2\u003eindexing-errors.log \u003eindexing.log \u0026\n   tail -f indexing-errors.log indexing.log\n\nIf i want to stop it, i\u0027ve got the process id right there, and we could add signal traps to abort cleanly (or not; you might want to keep any half-finished reindexing if it\u0027s already run for a long time).","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"0aa6bfdd407e4ba1d8ce71914b6e2f504d35e276","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    *% searchlight-manage index sync sync*"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"b. We will return a job ID when the threads are running asycnhronously. We will add a new"},{"line_number":122,"context_line":"command to *searchlight-manage* to return the state of a specified job ID. The internal state"},{"line_number":123,"context_line":"will be stored in ElasticSearch in the new index as described in design issue #3 (above)."},{"line_number":124,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_732520c1","line":121,"range":{"start_line":121,"start_character":17,"end_line":121,"end_character":18},"in_reply_to":"3aaa91ec_75f23a9c","updated":"2016-06-21 23:46:30.000000000","message":"+1 - I think this would be simpler.","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"e2b62ba23c15d3b4d031b684de85edde336c39a4","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"5. **How do we allow the admin to stop the asynchronous threads?**"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"The end user will need to be able to cleanly stop any currently running re-indexing threads."},{"line_number":139,"context_line":"We will add a new command to *searchlight-manage* to allow all asynchronous threads associated"},{"line_number":140,"context_line":"with a job ID to be killed. This will be considered a catastrophic failure of the re-indexing"},{"line_number":141,"context_line":"effort and will result in the previous index being restored."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3aaa91ec_d587aed5","line":138,"range":{"start_line":138,"start_character":29,"end_line":138,"end_character":33},"updated":"2016-06-21 17:10:27.000000000","message":"Again - why not kill the process?","commit_id":"0278cf55a82443b80f46cc26b9baa6255cecb967"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"80506034d83c944109509350445521db65ab4e02","unresolved":false,"context_lines":[{"line_number":89,"context_line":"multi-thread the plugins. Reviewing the code and functionality of the plugins, they appear to"},{"line_number":90,"context_line":"be separate enough that they are good candidates to be moved into their own threads. The"},{"line_number":91,"context_line":"plugins are isolated from each other and do not depend on any internal structures to handle"},{"line_number":92,"context_line":"the actual indexing."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"**Design Proposal:** The individual plugins can be successfully threaded."},{"line_number":95,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"3aaa91ec_29441db5","line":92,"range":{"start_line":92,"start_character":11,"end_line":92,"end_character":19},"updated":"2016-06-24 17:52:47.000000000","message":"I\u0027d agree with that. If they are intertwined they shouldn\u0027t be.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"702cb10db4de221530f9497e18370f3dccf288ce","unresolved":false,"context_lines":[{"line_number":89,"context_line":"multi-thread the plugins. Reviewing the code and functionality of the plugins, they appear to"},{"line_number":90,"context_line":"be separate enough that they are good candidates to be moved into their own threads. The"},{"line_number":91,"context_line":"plugins are isolated from each other and do not depend on any internal structures to handle"},{"line_number":92,"context_line":"the actual indexing."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"**Design Proposal:** The individual plugins can be successfully threaded."},{"line_number":95,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"1ac06dbe_32039775","line":92,"range":{"start_line":92,"start_character":11,"end_line":92,"end_character":19},"in_reply_to":"3aaa91ec_29441db5","updated":"2016-08-19 17:00:12.000000000","message":"And they are not!","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"80506034d83c944109509350445521db65ab4e02","unresolved":false,"context_lines":[{"line_number":91,"context_line":"plugins are isolated from each other and do not depend on any internal structures to handle"},{"line_number":92,"context_line":"the actual indexing."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"**Design Proposal:** The individual plugins can be successfully threaded."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"2. **At what level should we create the indexing threads?**"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"3aaa91ec_e96b351c","line":94,"range":{"start_line":94,"start_character":36,"end_line":94,"end_character":43},"updated":"2016-06-24 17:52:47.000000000","message":"I would though recommend we don\u0027t do one thread per RT; firing off twenty jobs at once may not be very productive. Thread pools are the accepted way to deal with this.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"702cb10db4de221530f9497e18370f3dccf288ce","unresolved":false,"context_lines":[{"line_number":91,"context_line":"plugins are isolated from each other and do not depend on any internal structures to handle"},{"line_number":92,"context_line":"the actual indexing."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"**Design Proposal:** The individual plugins can be successfully threaded."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"2. **At what level should we create the indexing threads?**"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"1ac06dbe_d2f2039a","line":94,"range":{"start_line":94,"start_character":36,"end_line":94,"end_character":43},"in_reply_to":"3aaa91ec_e96b351c","updated":"2016-08-19 17:00:12.000000000","message":"Noted below.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"80506034d83c944109509350445521db65ab4e02","unresolved":false,"context_lines":[{"line_number":107,"context_line":"are re-indexed directly within ElasticSearch.  We need to keep this enhancement."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"Keeping the current design intact means we will want to thread on the fine resource type level"},{"line_number":110,"context_line":"and not at the gross resource type group level. Based on the parent/child relationship that"},{"line_number":111,"context_line":"exists between some of the resource types, this is the \"fine\" level we will be considering."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"**Design Proposal:** Whenever the indexing code currently calls the plugin API, it will"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3aaa91ec_89e0b1ce","line":110,"range":{"start_line":110,"start_character":54,"end_line":110,"end_character":56},"updated":"2016-06-24 17:52:47.000000000","message":"I don\u0027t know of a technical reason to group parent/child data indexing, presuming that the mapping is created ahead of time.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"80506034d83c944109509350445521db65ab4e02","unresolved":false,"context_lines":[{"line_number":111,"context_line":"exists between some of the resource types, this is the \"fine\" level we will be considering."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"**Design Proposal:** Whenever the indexing code currently calls the plugin API, it will"},{"line_number":114,"context_line":"spin the plugin API into its own thread."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"**Design Proposal:** Whenever the indexing code calls ElasticSearch to re-index an existing"},{"line_number":117,"context_line":"index, it will spin this ElasticSearch work into its own thread."}],"source_content_type":"text/x-rst","patch_set":3,"id":"3aaa91ec_49ad2987","line":114,"range":{"start_line":114,"start_character":29,"end_line":114,"end_character":32},"updated":"2016-06-24 17:52:47.000000000","message":"Probably more accurate to say that this work will become part of the job queue; we likely don\u0027t want to launch a thread per resource type.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"702cb10db4de221530f9497e18370f3dccf288ce","unresolved":false,"context_lines":[{"line_number":111,"context_line":"exists between some of the resource types, this is the \"fine\" level we will be considering."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"**Design Proposal:** Whenever the indexing code currently calls the plugin API, it will"},{"line_number":114,"context_line":"spin the plugin API into its own thread."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"**Design Proposal:** Whenever the indexing code calls ElasticSearch to re-index an existing"},{"line_number":117,"context_line":"index, it will spin this ElasticSearch work into its own thread."}],"source_content_type":"text/x-rst","patch_set":3,"id":"1ac06dbe_726a2f1c","line":114,"range":{"start_line":114,"start_character":29,"end_line":114,"end_character":32},"in_reply_to":"3aaa91ec_49ad2987","updated":"2016-08-19 17:00:12.000000000","message":"We are now more accurate.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"80506034d83c944109509350445521db65ab4e02","unresolved":false,"context_lines":[{"line_number":114,"context_line":"spin the plugin API into its own thread."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"**Design Proposal:** Whenever the indexing code calls ElasticSearch to re-index an existing"},{"line_number":117,"context_line":"index, it will spin this ElasticSearch work into its own thread."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"3. **When will we know to switch the ElasticSearch aliases?**"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"3aaa91ec_898b911e","line":117,"range":{"start_line":117,"start_character":25,"end_line":117,"end_character":38},"updated":"2016-06-24 17:52:47.000000000","message":"Don\u0027t we already do the bulk copying as a single call to the elasticsearch library? I don\u0027t imagine it\u0027ll be any faster to do this in parallel since it\u0027s likely totally I/O bound in Elasticsearch","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"702cb10db4de221530f9497e18370f3dccf288ce","unresolved":false,"context_lines":[{"line_number":114,"context_line":"spin the plugin API into its own thread."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"**Design Proposal:** Whenever the indexing code calls ElasticSearch to re-index an existing"},{"line_number":117,"context_line":"index, it will spin this ElasticSearch work into its own thread."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"3. **When will we know to switch the ElasticSearch aliases?**"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"1ac06dbe_f2645f4a","line":117,"range":{"start_line":117,"start_character":25,"end_line":117,"end_character":38},"in_reply_to":"3aaa91ec_898b911e","updated":"2016-08-19 17:00:12.000000000","message":"Noted.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"80506034d83c944109509350445521db65ab4e02","unresolved":false,"context_lines":[{"line_number":134,"context_line":"This could be done with the Queue library. Once a catastrophic failure has been received, the"},{"line_number":135,"context_line":"indexing code will terminate the remaining threads and clean up."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"**Design Proposal:** Use the python Queue library for thread communication."},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"For those following along with the code (searchlight/cmd/manage.py::sync), here is a rough guide"},{"line_number":140,"context_line":"to the changes. We will reference the sections as mentioned in the large comment blocks:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3aaa91ec_5b4b2c59","line":137,"range":{"start_line":137,"start_character":21,"end_line":137,"end_character":24},"updated":"2016-06-24 17:52:47.000000000","message":"If https://review.openstack.org/#/c/324168/ merges and is released soon, it includes the ThreadPoolExecutor which takes a lot of the legwork out of setting up a pool and feeding it jobs.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"702cb10db4de221530f9497e18370f3dccf288ce","unresolved":false,"context_lines":[{"line_number":134,"context_line":"This could be done with the Queue library. Once a catastrophic failure has been received, the"},{"line_number":135,"context_line":"indexing code will terminate the remaining threads and clean up."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"**Design Proposal:** Use the python Queue library for thread communication."},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"For those following along with the code (searchlight/cmd/manage.py::sync), here is a rough guide"},{"line_number":140,"context_line":"to the changes. We will reference the sections as mentioned in the large comment blocks:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"1ac06dbe_8d7cee21","line":137,"range":{"start_line":137,"start_character":21,"end_line":137,"end_character":24},"in_reply_to":"3aaa91ec_5b4b2c59","updated":"2016-08-19 17:00:12.000000000","message":"The pool has been used.","commit_id":"7195b219d15d9926296aee0143f99c3bed18f952"}]}
