~bisscuitt/percona-monitoring-plugins/lsof_find

« back to all changes in this revision

Viewing changes to cacti/scripts/ss_get_mysql_stats.php

  • Committer: Roman Vynar
  • Date: 2014-07-10 15:09:58 UTC
  • Revision ID: roman.vynar@percona.com-20140710150958-rdgxi7nmftcx9gbi
Fix for bug #1297442 leverage lock-free SHOW SLAVE STATUS in Percona Server

Show diffs side-by-side

added added

removed removed

Lines of Context:
369
369
 
370
370
   # Get SHOW SLAVE STATUS, and add it to the $status array.
371
371
   if ( $chk_options['slave'] ) {
372
 
      $result = run_query("SHOW SLAVE STATUS", $conn);
 
372
      # Leverage lock-free SHOW SLAVE STATUS NOLOCK with Percona Server
 
373
      $result = run_query("SHOW SLAVE STATUS NOLOCK", $conn);
 
374
      if ( !$result ) {
 
375
         $result = run_query("SHOW SLAVE STATUS", $conn);
 
376
      } 
373
377
      $slave_status_rows_gotten = 0;
374
378
      foreach ( $result as $row ) {
375
379
         $slave_status_rows_gotten++;
1233
1237
   global $debug;
1234
1238
   debug($sql);
1235
1239
   $result = @mysqli_query($conn, $sql);
1236
 
   if ( $debug ) {
 
1240
   if ( $debug && $sql != 'SHOW SLAVE STATUS NOLOCK') {
1237
1241
      $error = @mysqli_error($conn);
1238
1242
      if ( $error ) {
1239
1243
         debug(array($sql, $error));