List:Commits« Previous MessageNext Message »
From:Praveenkumar Hulakund Date:January 18 2012 4:52am
Subject:bzr push into mysql-trunk branch (praveenkumar.hulakund:3744 to 3745)
Bug#11764724
View as plain text  
 3745 Praveenkumar Hulakund	2012-01-18
      BUG#11764724 - 57586: UNKNOWN TABLE WHEN TRYING TO DROP A TABLE AND NO AVAILABLE UNDO 
      SLOTS LEFT
      
      Modified changes made as part of fix for this bug to  fix Perf regression.
      FIX for perf regression:
      -------------------------------
      Current fix had a if condition to check whether return value of function "ha_delete_table"
      is "HA_ERR_TOO_MANY_CONCURRENT_TRXS". If yes then I used to "goto err" and in "err:" check
      whether error is "HA_ERR_TOO_MANY_CONCURRENT_TRXS" and print error message. So there were 
      TWO if conditions added to check whether error is "HA_ERR_TOO_MANY_CONCURRENT_TRXS" or not.
      These conditions were getting evaluated every time, this caused perf regression.
      
      As a fix, removed both the if conditions and added only one if condition in "if (error)" block.
      This condition is added to check whether error is "HA_ERR_TOO_MANY_CONCURRENT_TRXS". If yes 
      then print error and then "goto err". Now, this condition is checked only if there is any error.
      Otherwise it will not be evaluated and so performance should not be affected.
      
      Actual Issue Description:
      -------------------------------
      If you attempt to drop an existing InnoDB table, but you do not have any 
      available undo slots open, then you will receive an "unknown table" error. 
      
      mysql> DROP TABLE test.innodb_table_monitor; 
      ERROR 1051 (42S02): Unknown table 'innodb_table_monitor' 
      
      Actual issue Analysis:
      -------------------------------
      Here, max number of concurrent transactions/connections are started and then the
      next transaction to drop a table is initiated. Since, system has already max number
      of transactions running, next transaction to "drop table" was not started and innodb
      returned error "DB_TOO_MANY_CONCURRENT_TRXS". But this error was not handled properly 
      in sql layer because of which "drop table" operation was throwing wrong error message. 
      
      Fix:
      -------------------------------
      As a fix, I have added check in sql (in function "mysql_rm_table_part2") to handle error 
      code "HA_ERR_TOO_MANY_CONCURRENT_TRXS" and throw proper error message.
      
      Ouput of drop command after fix (with max number of concurrent transaction running)
      
      mysql> drop table test;
      ERROR 177 (HY000): Too many active concurrent transactions

    modified:
      sql/sql_table.cc
 3744 Andrei Elkin	2012-01-18 [merge]
      merging from local branch to mysql-trunk.

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	revid:andrei.elkin@stripped
+++ b/sql/sql_table.cc	revid:praveenkumar.hulakund@stripped
@@ -2451,6 +2451,14 @@ int mysql_rm_table_no_locks(THD *thd, TA
     }
     if (error)
     {
+      if (error == HA_ERR_TOO_MANY_CONCURRENT_TRXS)
+      {
+        my_error(HA_ERR_TOO_MANY_CONCURRENT_TRXS, MYF(0));
+        wrong_tables.free();
+        error= 1;
+        goto err;
+      }
+
       if (wrong_tables.length())
         wrong_tables.append(',');
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (praveenkumar.hulakund:3744 to 3745)Bug#11764724Praveenkumar Hulakund18 Jan