)]}'
{"container_config_scripts/pacemaker_restart_bundle.sh":[{"author":{"_account_id":20172,"name":"Michele Baldessari","email":"michele@acksyn.org","username":"michele"},"change_message_id":"8719b12e1ba0ebf53f5625fa569d48bb2d5b26b6","unresolved":false,"context_lines":[{"line_number":9,"context_line":"# try to restart only if resource has been created already"},{"line_number":10,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"},{"line_number":11,"context_line":"    if [ x\"${TRIPLEO_MINOR_UPDATE,,}\" !\u003d x\"true\" ]; then"},{"line_number":12,"context_line":"        # During a stack update, this script is called sequentially on"},{"line_number":13,"context_line":"        # every node the resource runs on, after the service\u0027s configs"},{"line_number":14,"context_line":"        # have been updated on all nodes. So we need to run pcs only"},{"line_number":15,"context_line":"        # once (e.g. on the service\u0027s boostrap node)."}],"source_content_type":"text/x-sh","patch_set":2,"id":"7faddb67_03b69add","line":12,"range":{"start_line":12,"start_character":54,"end_line":12,"end_character":70},"updated":"2019-08-29 06:41:50.000000000","message":"nit: not sequentially though, no? in parallel on all nodes (within the step/task that does it)","commit_id":"4def295c6d45ebd891ab83c80ef846a30b9d18cd"},{"author":{"_account_id":20778,"name":"Damien Ciabrini","email":"dciabrin@redhat.com","username":"dciabrin"},"change_message_id":"38a5b608facf93e06d2fc7e155a5d42d5c9a7be3","unresolved":false,"context_lines":[{"line_number":9,"context_line":"# try to restart only if resource has been created already"},{"line_number":10,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"},{"line_number":11,"context_line":"    if [ x\"${TRIPLEO_MINOR_UPDATE,,}\" !\u003d x\"true\" ]; then"},{"line_number":12,"context_line":"        # During a stack update, this script is called sequentially on"},{"line_number":13,"context_line":"        # every node the resource runs on, after the service\u0027s configs"},{"line_number":14,"context_line":"        # have been updated on all nodes. So we need to run pcs only"},{"line_number":15,"context_line":"        # once (e.g. on the service\u0027s boostrap node)."}],"source_content_type":"text/x-sh","patch_set":2,"id":"7faddb67_099f9b65","line":12,"range":{"start_line":12,"start_character":54,"end_line":12,"end_character":70},"in_reply_to":"7faddb67_03b69add","updated":"2019-08-29 09:16:02.000000000","message":"yeah you\u0027re right, i meant \"in parallel on all nodes, for each deploy step\". I\u0027ll reword this","commit_id":"4def295c6d45ebd891ab83c80ef846a30b9d18cd"},{"author":{"_account_id":20172,"name":"Michele Baldessari","email":"michele@acksyn.org","username":"michele"},"change_message_id":"8719b12e1ba0ebf53f5625fa569d48bb2d5b26b6","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        # XPath rationale: as long as there is a bundle running"},{"line_number":27,"context_line":"        # locally and it is managed by pacemaker, no matter the state"},{"line_number":28,"context_line":"        # of any inner pcmk_remote or ocf resource, we should restart"},{"line_number":29,"context_line":"        # it to give it a change to read the new config."},{"line_number":30,"context_line":"        if crm_mon -r --as-xml | xmllint --format --xpath \"//bundle[@id\u003d\u0027${RESOURCE}\u0027]/replica/resource[@managed\u003d\u0027true\u0027 and (not(boolean(@target_role)) or (boolean(@target_role) and @target_role!\u003d\u0027Stopped\u0027))]/node[@name\u003d\u0027${HOST}\u0027]/../..\" - \u0026\u003e/dev/null; then"},{"line_number":31,"context_line":"            echo \"Restarting ${RESOURCE} locally on \u0027${HOST}\u0027\""},{"line_number":32,"context_line":"            /sbin/pcs resource restart --wait\u003d__PCMKTIMEOUT__ $RESOURCE \"${HOST}\""}],"source_content_type":"text/x-sh","patch_set":2,"id":"7faddb67_c3af227b","line":29,"range":{"start_line":29,"start_character":26,"end_line":29,"end_character":33},"updated":"2019-08-29 06:41:50.000000000","message":"BOOO TYPO","commit_id":"4def295c6d45ebd891ab83c80ef846a30b9d18cd"},{"author":{"_account_id":20778,"name":"Damien Ciabrini","email":"dciabrin@redhat.com","username":"dciabrin"},"change_message_id":"38a5b608facf93e06d2fc7e155a5d42d5c9a7be3","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        # XPath rationale: as long as there is a bundle running"},{"line_number":27,"context_line":"        # locally and it is managed by pacemaker, no matter the state"},{"line_number":28,"context_line":"        # of any inner pcmk_remote or ocf resource, we should restart"},{"line_number":29,"context_line":"        # it to give it a change to read the new config."},{"line_number":30,"context_line":"        if crm_mon -r --as-xml | xmllint --format --xpath \"//bundle[@id\u003d\u0027${RESOURCE}\u0027]/replica/resource[@managed\u003d\u0027true\u0027 and (not(boolean(@target_role)) or (boolean(@target_role) and @target_role!\u003d\u0027Stopped\u0027))]/node[@name\u003d\u0027${HOST}\u0027]/../..\" - \u0026\u003e/dev/null; then"},{"line_number":31,"context_line":"            echo \"Restarting ${RESOURCE} locally on \u0027${HOST}\u0027\""},{"line_number":32,"context_line":"            /sbin/pcs resource restart --wait\u003d__PCMKTIMEOUT__ $RESOURCE \"${HOST}\""}],"source_content_type":"text/x-sh","patch_set":2,"id":"7faddb67_09b6bbdd","line":29,"range":{"start_line":29,"start_character":26,"end_line":29,"end_character":33},"in_reply_to":"7faddb67_c3af227b","updated":"2019-08-29 09:16:02.000000000","message":"Thanks, will fix!","commit_id":"4def295c6d45ebd891ab83c80ef846a30b9d18cd"},{"author":{"_account_id":20172,"name":"Michele Baldessari","email":"michele@acksyn.org","username":"michele"},"change_message_id":"8719b12e1ba0ebf53f5625fa569d48bb2d5b26b6","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        # locally and it is managed by pacemaker, no matter the state"},{"line_number":28,"context_line":"        # of any inner pcmk_remote or ocf resource, we should restart"},{"line_number":29,"context_line":"        # it to give it a change to read the new config."},{"line_number":30,"context_line":"        if crm_mon -r --as-xml | xmllint --format --xpath \"//bundle[@id\u003d\u0027${RESOURCE}\u0027]/replica/resource[@managed\u003d\u0027true\u0027 and (not(boolean(@target_role)) or (boolean(@target_role) and @target_role!\u003d\u0027Stopped\u0027))]/node[@name\u003d\u0027${HOST}\u0027]/../..\" - \u0026\u003e/dev/null; then"},{"line_number":31,"context_line":"            echo \"Restarting ${RESOURCE} locally on \u0027${HOST}\u0027\""},{"line_number":32,"context_line":"            /sbin/pcs resource restart --wait\u003d__PCMKTIMEOUT__ $RESOURCE \"${HOST}\""},{"line_number":33,"context_line":"        else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7faddb67_63d3ce02","line":30,"range":{"start_line":30,"start_character":124,"end_line":30,"end_character":177},"updated":"2019-08-29 06:41:50.000000000","message":"I get the rest of the xml (very clever, kudos!). not sure I fully grasp the target_role boolean stuff here. Mind adding a comment so our old selves won\u0027t need to spend too much time retracing the logic?","commit_id":"4def295c6d45ebd891ab83c80ef846a30b9d18cd"},{"author":{"_account_id":20778,"name":"Damien Ciabrini","email":"dciabrin@redhat.com","username":"dciabrin"},"change_message_id":"38a5b608facf93e06d2fc7e155a5d42d5c9a7be3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        # locally and it is managed by pacemaker, no matter the state"},{"line_number":28,"context_line":"        # of any inner pcmk_remote or ocf resource, we should restart"},{"line_number":29,"context_line":"        # it to give it a change to read the new config."},{"line_number":30,"context_line":"        if crm_mon -r --as-xml | xmllint --format --xpath \"//bundle[@id\u003d\u0027${RESOURCE}\u0027]/replica/resource[@managed\u003d\u0027true\u0027 and (not(boolean(@target_role)) or (boolean(@target_role) and @target_role!\u003d\u0027Stopped\u0027))]/node[@name\u003d\u0027${HOST}\u0027]/../..\" - \u0026\u003e/dev/null; then"},{"line_number":31,"context_line":"            echo \"Restarting ${RESOURCE} locally on \u0027${HOST}\u0027\""},{"line_number":32,"context_line":"            /sbin/pcs resource restart --wait\u003d__PCMKTIMEOUT__ $RESOURCE \"${HOST}\""},{"line_number":33,"context_line":"        else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7faddb67_a99be761","line":30,"range":{"start_line":30,"start_character":124,"end_line":30,"end_character":177},"in_reply_to":"7faddb67_63d3ce02","updated":"2019-08-29 09:16:02.000000000","message":"The idea is that resource have a current state and a target state (i.e. the target-role in pcs). Until the resource reached the target state, a transient attribute is present in the crm.\n\nI wanted to prevent restarting the resource if its transient state is \"Stopped\" (i.e. something did a pcs resource disable \u003cresource\u003e), to prevent any unexpected side effect in pacemaker.\n\nSo the XPath reads \"either there\u0027s no transient state, or if there is it has to be something different than Stopped\".","commit_id":"4def295c6d45ebd891ab83c80ef846a30b9d18cd"},{"author":{"_account_id":8297,"name":"Sofer Athlan-Guyot","email":"sathlang@redhat.com","username":"chem"},"change_message_id":"60ff834bbc7e98bd15763e91c682d36010c7d580","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        # XPath rationale 2: if the resource is being stopped, the"},{"line_number":31,"context_line":"        # attribute \"target_role\" will be present in the output of"},{"line_number":32,"context_line":"        # crm_mon. Do not restart the resource if that is the case."},{"line_number":33,"context_line":"        if crm_mon -r --as-xml | xmllint --format --xpath \"//bundle[@id\u003d\u0027${RESOURCE}\u0027]/replica/resource[@managed\u003d\u0027true\u0027 and (not(boolean(@target_role)) or (boolean(@target_role) and @target_role!\u003d\u0027Stopped\u0027))]/node[@name\u003d\u0027${HOST}\u0027]/../..\" - \u0026\u003e/dev/null; then"},{"line_number":34,"context_line":"            echo \"$(date -u): Restarting ${RESOURCE} locally on \u0027${HOST}\u0027\""},{"line_number":35,"context_line":"            /sbin/pcs resource restart --wait\u003d__PCMKTIMEOUT__ $RESOURCE \"${HOST}\""},{"line_number":36,"context_line":"        else"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7faddb67_4d66ad2b","line":33,"updated":"2019-09-04 10:28:43.000000000","message":"really? :)","commit_id":"7f785e87579e0beaaa325e479d8387dc288c08ea"}]}
