)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":28618,"name":"Drew Walters","email":"drewwalters@microsoft.com","username":"drewwalters96"},"change_message_id":"3bdab41dffb6d7a07f1f766065d27937c1e7071d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Database backup fix"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch set fixes the calculation of how long a database backup"},{"line_number":10,"context_line":"has be taken."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I5547e923538ddb83f409b1e7df936baf664e717a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_73d83cee","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":13},"updated":"2019-10-11 19:59:17.000000000","message":"This does not have a lot of context. How does this change fix database backup calculation? What was the issue this change addresses?","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":18236,"name":"Sophie Huang","email":"sophieh01@yahoo.com","username":"SophieHuang"},"change_message_id":"d47ecb191b836518f8ad27dfd7a7b19dbf5b66a8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Database backup fix"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch set fixes the calculation of how long a database backup"},{"line_number":10,"context_line":"has be taken."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I5547e923538ddb83f409b1e7df936baf664e717a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_a1e1299e","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":13},"in_reply_to":"3fa7e38b_73d83cee","updated":"2019-10-17 22:32:16.000000000","message":"updated","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"}],"mariadb/templates/bin/_backup_mariadb.sh.tpl":[{"author":{"_account_id":28618,"name":"Drew Walters","email":"drewwalters@microsoft.com","username":"drewwalters96"},"change_message_id":"3bdab41dffb6d7a07f1f766065d27937c1e7071d","unresolved":false,"context_lines":[{"line_number":36,"context_line":"  then"},{"line_number":37,"context_line":"    day_delta\u003d0"},{"line_number":38,"context_line":"  else"},{"line_number":39,"context_line":"    day_delta\u003d$((($date_delta+86399)/86400))"},{"line_number":40,"context_line":"  fi"},{"line_number":41,"context_line":"  echo $day_delta"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_5304204a","line":39,"range":{"start_line":39,"start_character":18,"end_line":39,"end_character":35},"updated":"2019-10-11 19:59:17.000000000","message":"Why is this adjustment necessary? Is the date being passed in correctly? Shouldn\u0027t we aim to fix the incorrect arguments (wherever it originates).","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":28618,"name":"Drew Walters","email":"drewwalters@microsoft.com","username":"drewwalters96"},"change_message_id":"d3455e25995436f2c14facc7f2e76a51e6b42ea4","unresolved":false,"context_lines":[{"line_number":36,"context_line":"  then"},{"line_number":37,"context_line":"    day_delta\u003d0"},{"line_number":38,"context_line":"  else"},{"line_number":39,"context_line":"    day_delta\u003d$((($date_delta+86399)/86400))"},{"line_number":40,"context_line":"  fi"},{"line_number":41,"context_line":"  echo $day_delta"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_230fc188","line":39,"range":{"start_line":39,"start_character":18,"end_line":39,"end_character":35},"in_reply_to":"3fa7e38b_230a611f","updated":"2019-10-14 15:58:19.000000000","message":"\u003e The calculation is an integer division and any time less than a day\n \u003e is rounded to 0.\n\nYou already have a seconds difference, why not just convert the \"MARIADB_DAYS_TO_KEEP\" into seconds? Then it\u0027s just a simple comparison, and you won\u0027t have any rounding errors.","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":18236,"name":"Sophie Huang","email":"sophieh01@yahoo.com","username":"SophieHuang"},"change_message_id":"d47ecb191b836518f8ad27dfd7a7b19dbf5b66a8","unresolved":false,"context_lines":[{"line_number":36,"context_line":"  then"},{"line_number":37,"context_line":"    day_delta\u003d0"},{"line_number":38,"context_line":"  else"},{"line_number":39,"context_line":"    day_delta\u003d$((($date_delta+86399)/86400))"},{"line_number":40,"context_line":"  fi"},{"line_number":41,"context_line":"  echo $day_delta"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_c1dea5d9","line":39,"range":{"start_line":39,"start_character":18,"end_line":39,"end_character":35},"in_reply_to":"3fa7e38b_230fc188","updated":"2019-10-17 22:32:16.000000000","message":"updated","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":18236,"name":"Sophie Huang","email":"sophieh01@yahoo.com","username":"SophieHuang"},"change_message_id":"4b67332ee1543e62cfb8c20c228b995315fe720b","unresolved":false,"context_lines":[{"line_number":36,"context_line":"  then"},{"line_number":37,"context_line":"    day_delta\u003d0"},{"line_number":38,"context_line":"  else"},{"line_number":39,"context_line":"    day_delta\u003d$((($date_delta+86399)/86400))"},{"line_number":40,"context_line":"  fi"},{"line_number":41,"context_line":"  echo $day_delta"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_230a611f","line":39,"range":{"start_line":39,"start_character":18,"end_line":39,"end_character":35},"in_reply_to":"3fa7e38b_5304204a","updated":"2019-10-14 15:29:54.000000000","message":"The calculation is an integer division and any time less than a day is rounded to 0. Here, one second less than 24 hours is added to the time, such that any time more than 3 days will be counted as passed 3 days","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":20466,"name":"Tin Lam","email":"tin@lam.wtf","username":"tinlam"},"change_message_id":"8d94769aeb6563db378188baf5fa908f96b19233","unresolved":false,"context_lines":[{"line_number":102,"context_line":"  then"},{"line_number":103,"context_line":"    if [ \"$MARIADB_BACKUP_DAYS_TO_KEEP\" -gt 0 ]"},{"line_number":104,"context_line":"    then"},{"line_number":105,"context_line":"      echo \"Deleting backups older than $MARIADB_BACKUP_DAYS_TO_KEEP days\""},{"line_number":106,"context_line":"      if [ -d $ARCHIVE_DIR ]"},{"line_number":107,"context_line":"      then"},{"line_number":108,"context_line":"        for archive_file in $(ls -1 $ARCHIVE_DIR/*.gz)"},{"line_number":109,"context_line":"        do"},{"line_number":110,"context_line":"          archive_date\u003d$( echo $archive_file | awk -F/ \u0027{print $NF}\u0027 | cut -d\u0027.\u0027 -f 3)"},{"line_number":111,"context_line":"          if [ \"$(days_difference $archive_date)\" -gt \"$MARIADB_BACKUP_DAYS_TO_KEEP\" ]"},{"line_number":112,"context_line":"          then"},{"line_number":113,"context_line":"            rm -rf $archive_file"},{"line_number":114,"context_line":"          fi"},{"line_number":115,"context_line":"        done"},{"line_number":116,"context_line":"      fi"},{"line_number":117,"context_line":"    fi"},{"line_number":118,"context_line":"fi"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_26234fa9","line":116,"range":{"start_line":105,"start_character":0,"end_line":116,"end_character":8},"updated":"2019-10-14 16:13:41.000000000","message":"Uh. If we want to delete $ARCHIVE_DIR/*.gz older than say 3 days, why can\u0027t we do this:\n\n   find $ARCHIVE_DIR -name \"*.gz\" -type f -mtime +3 -exec rm -f {} \\;\n\nAs is, we have loops, rounding, cut, awk and echo - which makes it kind of hard to read.","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":18236,"name":"Sophie Huang","email":"sophieh01@yahoo.com","username":"SophieHuang"},"change_message_id":"d47ecb191b836518f8ad27dfd7a7b19dbf5b66a8","unresolved":false,"context_lines":[{"line_number":102,"context_line":"  then"},{"line_number":103,"context_line":"    if [ \"$MARIADB_BACKUP_DAYS_TO_KEEP\" -gt 0 ]"},{"line_number":104,"context_line":"    then"},{"line_number":105,"context_line":"      echo \"Deleting backups older than $MARIADB_BACKUP_DAYS_TO_KEEP days\""},{"line_number":106,"context_line":"      if [ -d $ARCHIVE_DIR ]"},{"line_number":107,"context_line":"      then"},{"line_number":108,"context_line":"        for archive_file in $(ls -1 $ARCHIVE_DIR/*.gz)"},{"line_number":109,"context_line":"        do"},{"line_number":110,"context_line":"          archive_date\u003d$( echo $archive_file | awk -F/ \u0027{print $NF}\u0027 | cut -d\u0027.\u0027 -f 3)"},{"line_number":111,"context_line":"          if [ \"$(days_difference $archive_date)\" -gt \"$MARIADB_BACKUP_DAYS_TO_KEEP\" ]"},{"line_number":112,"context_line":"          then"},{"line_number":113,"context_line":"            rm -rf $archive_file"},{"line_number":114,"context_line":"          fi"},{"line_number":115,"context_line":"        done"},{"line_number":116,"context_line":"      fi"},{"line_number":117,"context_line":"    fi"},{"line_number":118,"context_line":"fi"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_e1008138","line":116,"range":{"start_line":105,"start_character":0,"end_line":116,"end_character":8},"in_reply_to":"3fa7e38b_26234fa9","updated":"2019-10-17 22:32:16.000000000","message":"The date in the filename is used to avoid that the last touched time is not the backup time","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":20466,"name":"Tin Lam","email":"tin@lam.wtf","username":"tinlam"},"change_message_id":"8d94769aeb6563db378188baf5fa908f96b19233","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"#Only delete the old archive after a successful archive"},{"line_number":101,"context_line":"if [ $ARCHIVE_RET -eq 0 ]"},{"line_number":102,"context_line":"  then"},{"line_number":103,"context_line":"    if [ \"$MARIADB_BACKUP_DAYS_TO_KEEP\" -gt 0 ]"},{"line_number":104,"context_line":"    then"},{"line_number":105,"context_line":"      echo \"Deleting backups older than $MARIADB_BACKUP_DAYS_TO_KEEP days\""},{"line_number":106,"context_line":"      if [ -d $ARCHIVE_DIR ]"},{"line_number":107,"context_line":"      then"},{"line_number":108,"context_line":"        for archive_file in $(ls -1 $ARCHIVE_DIR/*.gz)"},{"line_number":109,"context_line":"        do"},{"line_number":110,"context_line":"          archive_date\u003d$( echo $archive_file | awk -F/ \u0027{print $NF}\u0027 | cut -d\u0027.\u0027 -f 3)"},{"line_number":111,"context_line":"          if [ \"$(days_difference $archive_date)\" -gt \"$MARIADB_BACKUP_DAYS_TO_KEEP\" ]"},{"line_number":112,"context_line":"          then"},{"line_number":113,"context_line":"            rm -rf $archive_file"},{"line_number":114,"context_line":"          fi"},{"line_number":115,"context_line":"        done"},{"line_number":116,"context_line":"      fi"},{"line_number":117,"context_line":"    fi"},{"line_number":118,"context_line":"fi"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_c326edce","line":117,"range":{"start_line":102,"start_character":0,"end_line":117,"end_character":6},"updated":"2019-10-14 16:13:41.000000000","message":"Hmm.","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"},{"author":{"_account_id":20466,"name":"Tin Lam","email":"tin@lam.wtf","username":"tinlam"},"change_message_id":"5c454f72dee01984c330e1ac5117f908e2f32aaf","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"#Only delete the old archive after a successful archive"},{"line_number":101,"context_line":"if [ $ARCHIVE_RET -eq 0 ]"},{"line_number":102,"context_line":"  then"},{"line_number":103,"context_line":"    if [ \"$MARIADB_BACKUP_DAYS_TO_KEEP\" -gt 0 ]"},{"line_number":104,"context_line":"    then"},{"line_number":105,"context_line":"      echo \"Deleting backups older than $MARIADB_BACKUP_DAYS_TO_KEEP days\""},{"line_number":106,"context_line":"      if [ -d $ARCHIVE_DIR ]"},{"line_number":107,"context_line":"      then"},{"line_number":108,"context_line":"        for archive_file in $(ls -1 $ARCHIVE_DIR/*.gz)"},{"line_number":109,"context_line":"        do"},{"line_number":110,"context_line":"          archive_date\u003d$( echo $archive_file | awk -F/ \u0027{print $NF}\u0027 | cut -d\u0027.\u0027 -f 3)"},{"line_number":111,"context_line":"          if [ \"$(days_difference $archive_date)\" -gt \"$MARIADB_BACKUP_DAYS_TO_KEEP\" ]"},{"line_number":112,"context_line":"          then"},{"line_number":113,"context_line":"            rm -rf $archive_file"},{"line_number":114,"context_line":"          fi"},{"line_number":115,"context_line":"        done"},{"line_number":116,"context_line":"      fi"},{"line_number":117,"context_line":"    fi"},{"line_number":118,"context_line":"fi"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"3fa7e38b_b47bde78","line":117,"range":{"start_line":102,"start_character":0,"end_line":117,"end_character":6},"in_reply_to":"3fa7e38b_c326edce","updated":"2019-10-15 00:54:57.000000000","message":"Apology. This was pasted in by accident.","commit_id":"aaadf633c0112ba11597a7b64109f662a9b4ffab"}]}
