)]}'
{"docker/mariadb/extend_start.sh":[{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"1fe6a4b2e5a044f609d2d26835d0679ebd6be85a","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    # NOTE(huikang): the location of mysql\u0027s socket file varies depending on the OS distributions."},{"line_number":7,"context_line":"    # Querying the cluster status has to be executed after the existence of mysql.sock and mariadb.pid."},{"line_number":8,"context_line":"    TIMEOUT\u003d${DB_MAX_TIMEOUT:-60}"},{"line_number":9,"context_line":"    until [[ -S /var/lib/mysql/mysql.sock ]] \u0026\u0026 \\"},{"line_number":10,"context_line":"          [[ -S /var/run/mysqld/mysqld.sock ]] \u0026\u0026 \\"},{"line_number":11,"context_line":"          [[ -f /var/lib/mysql/mariadb.pid ]]; do"},{"line_number":12,"context_line":"        if [[ ${TIMEOUT} -gt 0 ]]; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"5f7c97a3_c21d980f","line":9,"updated":"2018-06-12 16:01:30.000000000","message":"I\u0027ve always disliked while statements with negative conditions and find until much more readable. IIUC the conditions we want are:\n- a sock file at any of the possible location\n- a pid file\n\nSo, with parenthesis for clarity, it should be written like this:\n\n  until (([[ -S /var/lib/mysql/mysql.sock ]] || \\\n          [[ -S /var/run/mysqld/mysqld.sock ]]) \u0026\u0026 \\\n          [[ -f /var/lib/mysql/mariadb.pid ]]); do","commit_id":"301a87dec0fc3e19e9439db3ddf9332b8da400cb"},{"author":{"_account_id":11090,"name":"Sergii Golovatiuk","email":"sgolovat@redhat.com","username":"holser"},"change_message_id":"c4f68459db1e4815b323b00918efc22d35b51632","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    # NOTE(huikang): the location of mysql\u0027s socket file varies depending on the OS distributions."},{"line_number":7,"context_line":"    # Querying the cluster status has to be executed after the existence of mysql.sock and mariadb.pid."},{"line_number":8,"context_line":"    TIMEOUT\u003d${DB_MAX_TIMEOUT:-60}"},{"line_number":9,"context_line":"    until [[ -S /var/lib/mysql/mysql.sock ]] \u0026\u0026 \\"},{"line_number":10,"context_line":"          [[ -S /var/run/mysqld/mysqld.sock ]] \u0026\u0026 \\"},{"line_number":11,"context_line":"          [[ -f /var/lib/mysql/mariadb.pid ]]; do"},{"line_number":12,"context_line":"        if [[ ${TIMEOUT} -gt 0 ]]; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"5f7c97a3_c737d7fd","line":9,"in_reply_to":"5f7c97a3_c21d980f","updated":"2018-06-13 08:59:53.000000000","message":"Correct. I will update the review","commit_id":"301a87dec0fc3e19e9439db3ddf9332b8da400cb"},{"author":{"_account_id":20778,"name":"Damien Ciabrini","email":"dciabrin@redhat.com","username":"dciabrin"},"change_message_id":"d78cefc0638bdb73830e7822ff774347a9f34061","unresolved":false,"context_lines":[{"line_number":7,"context_line":"    # Querying the cluster status has to be executed after the existence of mysql.sock and mariadb.pid."},{"line_number":8,"context_line":"    TIMEOUT\u003d${DB_MAX_TIMEOUT:-60}"},{"line_number":9,"context_line":"    until [[ -S /var/lib/mysql/mysql.sock ]] \u0026\u0026 \\"},{"line_number":10,"context_line":"          [[ -S /var/run/mysqld/mysqld.sock ]] \u0026\u0026 \\"},{"line_number":11,"context_line":"          [[ -f /var/lib/mysql/mariadb.pid ]]; do"},{"line_number":12,"context_line":"        if [[ ${TIMEOUT} -gt 0 ]]; then"},{"line_number":13,"context_line":"            let TIMEOUT-\u003d1"}],"source_content_type":"text/x-sh","patch_set":1,"id":"5f7c97a3_2b002d02","line":10,"updated":"2018-06-08 15:41:09.000000000","message":"hmm now that test would loop until two sock files are present on disk, which would never happen.\n\nSeems like the issue we had was that if a lingering pidfile from an old run is there at the time bootstrap_db is run, we won\u0027t wait until mysqld is properly initialized and creates the sockfile on disk.\n\nWhy not rather remove the pidfile if it exists and contains a dead pid before calling bootstrap_db?","commit_id":"301a87dec0fc3e19e9439db3ddf9332b8da400cb"},{"author":{"_account_id":11090,"name":"Sergii Golovatiuk","email":"sgolovat@redhat.com","username":"holser"},"change_message_id":"638b3c0bdaadd255663b6667ed8a4cf2d9266cf1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"    # Querying the cluster status has to be executed after the existence of mysql.sock and mariadb.pid."},{"line_number":8,"context_line":"    TIMEOUT\u003d${DB_MAX_TIMEOUT:-60}"},{"line_number":9,"context_line":"    until [[ -S /var/lib/mysql/mysql.sock ]] \u0026\u0026 \\"},{"line_number":10,"context_line":"          [[ -S /var/run/mysqld/mysqld.sock ]] \u0026\u0026 \\"},{"line_number":11,"context_line":"          [[ -f /var/lib/mysql/mariadb.pid ]]; do"},{"line_number":12,"context_line":"        if [[ ${TIMEOUT} -gt 0 ]]; then"},{"line_number":13,"context_line":"            let TIMEOUT-\u003d1"}],"source_content_type":"text/x-sh","patch_set":1,"id":"5f7c97a3_c77fd7dc","line":10,"in_reply_to":"5f7c97a3_2b002d02","updated":"2018-06-13 08:34:36.000000000","message":"I agree about mysqld.sock. I will correct in next review.\n\nConcerning issues that might happen.\n\nFirst issue. Initial bootstrap of MariaDB. It\u0027s first start of container. Sock file and pid files were never present. There will be delay between actual start of mariadb and the time when it will be ready to server connections. In most of cases it\u0027s not visible but that may happen. Also, when you have galera, this case will be more visible as galera module will allow MariaDB to serve on not depending on internal logic. For instance it may close sock when galera lost the quorum.\n\nSecond issue (The case you are trying to describe). Second and further runs of MariaDB container. In that case sock file and pid file may present from previous run. MariaDB will make some house keeping . So it will update pid file with actual PID it will recreate sock files. Though it affects the start up script as it relies on those files rather than on data. If you look how we fixed that in OCF, there is a logic to check if PID from pid file is running.\n\nhttps://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql-common.sh#L135-L144","commit_id":"301a87dec0fc3e19e9439db3ddf9332b8da400cb"}]}
