)]}'
{"id":"openstack%2Fplacement~669995","triplet_id":"openstack%2Fplacement~master~I43ce16a2ea7ba375aa9747a212c1b75dadc097b7","project":"openstack/placement","branch":"master","topic":"nested-magic","hashtags":[],"change_id":"I43ce16a2ea7ba375aa9747a212c1b75dadc097b7","subject":"Cache result of _get_ancestors_by_one_uuid()","status":"ABANDONED","created":"2019-07-10 07:19:24.000000000","updated":"2019-07-16 07:37:57.000000000","total_comment_count":3,"unresolved_comment_count":0,"has_review_started":true,"meta_rev_id":"49452c2611f68ea21c2a8f7e51dc18937fd0c778","_number":669995,"virtual_id_number":669995,"owner":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"actions":{},"labels":{"Verified":{"recommended":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"date":"2019-07-12 02:25:10.000000000","_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"date":"2019-07-11 08:52:10.000000000","_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":1,"date":"2019-07-11 08:38:47.000000000","permitted_voting_range":{"min":-2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","value":1,"default_value":0,"optional":true},"Code-Review":{"all":[{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"rejected":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"all":[{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":-1,"date":"2019-07-11 06:53:41.000000000","permitted_voting_range":{"min":-1,"max":1},"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"all":[{"value":0,"permitted_voting_range":{"min":0,"max":2},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"permitted_voting_range":{"min":0,"max":2},"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"value":0,"permitted_voting_range":{"min":0,"max":2},"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"permitted_voting_range":{"min":0,"max":1},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{" 0":"Default Priority","+1":"Contributor Review Promise","+2":"Core Review Promise"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2019-07-11 08:38:47.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2019-07-11 08:52:10.000000000","updated_by":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"reviewer":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"state":"REVIEWER"},{"updated":"2019-07-12 02:25:10.000000000","updated_by":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"reviewer":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"state":"REVIEWER"}],"messages":[{"id":"c0efe385e47b60f794aa5ce38b824e55bb6cceb1","author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"date":"2019-07-10 07:19:24.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"13ed8eb07d46b5381c2d373d3fdf472a951e8fcf","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-10 08:57:45.000000000","message":"Patch Set 1: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 http://logs.openstack.org/95/669995/1/check/grenade-py3/3fc75a9/ : SUCCESS in 1h 03m 19s\n- tempest-full-py3 http://logs.openstack.org/95/669995/1/check/tempest-full-py3/010a83f/ : SUCCESS in 1h 33m 10s\n- openstack-tox-docs http://logs.openstack.org/95/669995/1/check/openstack-tox-docs/d12a275/html/ : SUCCESS in 4m 37s\n- openstack-tox-cover http://logs.openstack.org/95/669995/1/check/openstack-tox-cover/496ebbd/cover/ : SUCCESS in 5m 53s\n- openstack-tox-lower-constraints http://logs.openstack.org/95/669995/1/check/openstack-tox-lower-constraints/c09640c/ : SUCCESS in 5m 04s\n- openstack-tox-pep8 http://logs.openstack.org/95/669995/1/check/openstack-tox-pep8/701c380/ : SUCCESS in 4m 43s\n- openstack-tox-py27 http://logs.openstack.org/95/669995/1/check/openstack-tox-py27/3ab18e5/ : SUCCESS in 4m 20s\n- openstack-tox-py36 http://logs.openstack.org/95/669995/1/check/openstack-tox-py36/f390cdf/ : SUCCESS in 6m 03s\n- openstack-tox-py37 http://logs.openstack.org/95/669995/1/check/openstack-tox-py37/6539143/ : SUCCESS in 4m 36s\n- openstack-tox-functional http://logs.openstack.org/95/669995/1/check/openstack-tox-functional/e8d1a45/ : SUCCESS in 4m 29s\n- openstack-tox-functional-py36 http://logs.openstack.org/95/669995/1/check/openstack-tox-functional-py36/52b361f/ : SUCCESS in 4m 39s\n- placement-nova-tox-functional-py36 http://logs.openstack.org/95/669995/1/check/placement-nova-tox-functional-py36/0904a7d/ : SUCCESS in 11m 24s\n- placement-nested-perfload http://logs.openstack.org/95/669995/1/check/placement-nested-perfload/5abd524/ : SUCCESS in 18m 43s (non-voting)\n- placement-perfload http://logs.openstack.org/95/669995/1/check/placement-perfload/eafa807/ : SUCCESS in 9m 01s (non-voting)","accounts_in_message":[],"_revision_number":1},{"id":"74b58e29311bb5cc5e694cfe8dd6d7d75e53e1b3","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-10 09:10:58.000000000","message":"Patch Set 1: Code-Review-1\n\n(2 comments)\n\nI think something like this is a good idea, but I\u0027m not sure the cache is safe.\n\nHowever, I may be missing something because I\u0027m tired and not had enough coffee.\n\nEven if it is correct, the memoize name needs to change, so the -1 is to signify that","accounts_in_message":[],"_revision_number":1},{"id":"2a23ff9fbf8d4a6a965f83beed4b6393de274cd2","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-10 21:36:24.000000000","message":"Patch Set 1: Code-Review-1\n\n(1 comment)\n\nI made my glib remark about this caching without really thinking it through. If we\u0027re going to do this, it\u0027s going to be a nontrivial undertaking. So I\u0027m fine if we want to forget about it (for now at least).\n\nAs it stands, Chris is right about the un-safety.","accounts_in_message":[],"_revision_number":1},{"id":"45513db73def88c272d2610fd57694fe89c6fe99","author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"date":"2019-07-11 06:51:05.000000000","message":"Uploaded patch set 2.","accounts_in_message":[],"_revision_number":2},{"id":"e92b5eacb180cbcda42e0e035cdf66389bc504cd","author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"date":"2019-07-11 06:53:41.000000000","message":"Patch Set 2: Workflow-1\n\nI\u0027ve made the cache available only during one GET /a_c request. Not sure this is worth doing. I will have a performance test for this and then come back here to see if this is worth doing.","accounts_in_message":[],"_revision_number":2},{"id":"78510984f4ff909f4d13385f5c237cd7dece5396","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-11 08:38:47.000000000","message":"Patch Set 2: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 http://logs.openstack.org/95/669995/2/check/grenade-py3/d84ebea/ : SUCCESS in 59m 03s\n- tempest-full-py3 http://logs.openstack.org/95/669995/2/check/tempest-full-py3/c618409/ : SUCCESS in 1h 37m 32s\n- openstack-tox-docs http://logs.openstack.org/95/669995/2/check/openstack-tox-docs/7d35a55/html/ : SUCCESS in 3m 46s\n- openstack-tox-cover http://logs.openstack.org/95/669995/2/check/openstack-tox-cover/61f0ee7/cover/ : SUCCESS in 6m 42s\n- openstack-tox-lower-constraints http://logs.openstack.org/95/669995/2/check/openstack-tox-lower-constraints/64d4cd2/ : SUCCESS in 5m 00s\n- openstack-tox-pep8 http://logs.openstack.org/95/669995/2/check/openstack-tox-pep8/2722b8e/ : SUCCESS in 5m 33s\n- openstack-tox-py27 http://logs.openstack.org/95/669995/2/check/openstack-tox-py27/18d122a/ : SUCCESS in 4m 05s\n- openstack-tox-py36 http://logs.openstack.org/95/669995/2/check/openstack-tox-py36/92cad0e/ : SUCCESS in 4m 27s\n- openstack-tox-py37 http://logs.openstack.org/95/669995/2/check/openstack-tox-py37/e7f5d58/ : SUCCESS in 5m 48s\n- openstack-tox-functional http://logs.openstack.org/95/669995/2/check/openstack-tox-functional/9999edb/ : SUCCESS in 7m 26s\n- openstack-tox-functional-py36 http://logs.openstack.org/95/669995/2/check/openstack-tox-functional-py36/6cef4e2/ : SUCCESS in 6m 21s\n- placement-nova-tox-functional-py36 http://logs.openstack.org/95/669995/2/check/placement-nova-tox-functional-py36/bd05c15/ : SUCCESS in 11m 29s\n- placement-nested-perfload http://logs.openstack.org/95/669995/2/check/placement-nested-perfload/2790bb2/ : SUCCESS in 16m 12s (non-voting)\n- placement-perfload http://logs.openstack.org/95/669995/2/check/placement-perfload/3e1c06d/ : SUCCESS in 7m 38s (non-voting)","accounts_in_message":[],"_revision_number":2},{"id":"5a1bad716de6d1edaa5e5fd235cbacc6b583f485","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-11 08:52:10.000000000","message":"Patch Set 2:\n\nI did some rudimentary print-based investigation to see how often the cache was hit and it\u0027s quite a bit with the data used in the tests.\n\nHowever, I think there\u0027s probably still a safety issue here: Although we don\u0027t use threads directly in the placement code it is common for the placement server to run in a threaded wsgi-server environment. I\u0027m guessing this means we could clear a cache out from under another thread and, though it would be very rare, we could also see the re-parenting situation I described before go into a reset/re-filled cache.\n\nPresumably one could get potentially around this by using a threading.local, but I\u0027ve not tested that.\n\n(Note, also, that given that the app now spends quite a lot of time in CPU rather than waiting on IO with the database, using threads for scaling is not always going to be the best option, but that\u0027s not really germane to this discussion: Since we know that people can (and will) set up in threaded wsgi servers we need to be safe or that.)","accounts_in_message":[],"_revision_number":2},{"id":"1bbc9478449c682aac8d82a146c9856cb79b3423","author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"date":"2019-07-12 01:57:41.000000000","message":"Patch Set 2:\n\nOkay, so if we move _get_ancestors_by_one_uuid along with _satisfies_group_policy, _satisfies_same_subtree_policy, _merge_candidates into RequestWideSearchContext, we could have a local cache in RequestWideSearchContext instance, I guess. Is that better than leave it as it is now?","accounts_in_message":[],"_revision_number":2},{"id":"eab9c4eac4217ea8e990e6524754c1f727714339","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-12 02:25:10.000000000","message":"Patch Set 2:\n\nWell, I like the idea of doing those refractors anyway, and they would be in a separate change(s) regardless. Whether the cache is worthwhile... unless we can get numbers in going to say skip it.","accounts_in_message":[],"_revision_number":2},{"id":"ea3e8b54dde3bee50b3cb54830e3a50f3ec66492","author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"date":"2019-07-16 07:37:57.000000000","message":"Abandoned","accounts_in_message":[],"_revision_number":2}],"current_revision_number":2,"current_revision":"63be637067d8ddb72bcd57609beaaea8ee4d82d5","revisions":{"ea777c772540ab0827c2807bd4042c4e5768e6d8":{"kind":"REWORK","_number":1,"created":"2019-07-10 07:19:24.000000000","uploader":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"ref":"refs/changes/95/669995/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/95/669995/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/95/669995/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/95/669995/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/95/669995/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/95/669995/1"}}},"commit":{"parents":[{"commit":"34c1dd88b34bfe6cdbfc8e6d2596686500c2b8e6","subject":"Merge \"Support `same_subtree` queryparam\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/34c1dd88b34bfe6cdbfc8e6d2596686500c2b8e6"}]}],"author":{"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","date":"2019-07-09 14:51:56.000000000","tz":0},"committer":{"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","date":"2019-07-09 14:51:56.000000000","tz":0},"subject":"Cache result of _get_ancestors_by_one_uuid()","message":"Cache result of _get_ancestors_by_one_uuid()\n\nIn 8395e3f099022d8506ed5e6624582ec03e46c3b9, we have added a function,\n_get_ancestors_by_one_uuid(), to get all the ancestors of a resource\nprovider, but it was expected to be called multiple times with same\nparameters, which is not efficient.\n\nThis patch adds a decorator function, memoize(), to cache the result\nfor the optimization.\n\nChange-Id: I43ce16a2ea7ba375aa9747a212c1b75dadc097b7\nStory: 2005575\nTask: 30784\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/ea777c772540ab0827c2807bd4042c4e5768e6d8"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/ea777c772540ab0827c2807bd4042c4e5768e6d8"}]},"branch":"refs/heads/master"},"63be637067d8ddb72bcd57609beaaea8ee4d82d5":{"kind":"REWORK","_number":2,"created":"2019-07-11 06:51:05.000000000","uploader":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"ref":"refs/changes/95/669995/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/95/669995/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/95/669995/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/95/669995/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/95/669995/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/95/669995/2"}}},"commit":{"parents":[{"commit":"83facc19475c7cab10a41efcb9ab0146fc406265","subject":"Merge \"Add a test for granular member_of not flowing down\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/83facc19475c7cab10a41efcb9ab0146fc406265"}]}],"author":{"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","date":"2019-07-09 14:51:56.000000000","tz":0},"committer":{"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","date":"2019-07-11 06:17:33.000000000","tz":0},"subject":"Cache result of _get_ancestors_by_one_uuid()","message":"Cache result of _get_ancestors_by_one_uuid()\n\nIn 8395e3f099022d8506ed5e6624582ec03e46c3b9, we have added a function,\n_get_ancestors_by_one_uuid(), to get all the ancestors of a resource\nprovider, but it was expected to be called multiple times with same\nparameters, which is not efficient.\n\nThis patch adds a decorator function, memoize(), to cache the result\nfor the optimization.\n\nChange-Id: I43ce16a2ea7ba375aa9747a212c1b75dadc097b7\nStory: 2005575\nTask: 30784\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/63be637067d8ddb72bcd57609beaaea8ee4d82d5"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/63be637067d8ddb72bcd57609beaaea8ee4d82d5"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
