[Rt-commit] rt branch, 4.2/warn-mysql-5.6-innodb, created. rt-4.2.10-149-ga828ba6

Alex Vandiver alexmv at bestpractical.com
Fri Mar 6 13:08:21 EST 2015


The branch, 4.2/warn-mysql-5.6-innodb has been created
        at  a828ba6d34c5098b7d339645efd30338f0aa0680 (commit)

- Log -----------------------------------------------------------------
commit 83532bba4ca3cc9c5a847628ca310bf25f6c1fb9
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Mar 5 20:20:21 2015 -0500

    Warn if innodb_log_file_size would limit uploads to < 5M
    
    On MySQL 5.6.20 and above, the largest allowed BLOB is 10% of the redo
    log size, aka innodb_log_file_size:
    
        http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html
    
    Attempts to insert larger data will fail.
    
    Warn during server startup if the innodb_log_file_size is set
    sufficiently small that 5M attachments are not supported.

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 083c93d..7b1f128 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -299,10 +299,24 @@ sub CheckCompatibility {
             }
         }
 
-        my $max_packet = ($dbh->selectrow_array("show variables like 'max_allowed_packet'"))[1];
-        if ($state =~ /^(create|post)$/ and $max_packet <= (1024 * 1024)) {
-            my $max_packet = sprintf("%.1fM", $max_packet/1024/1024);
-            warn "max_allowed_packet is set to $max_packet, which limits the maximum attachment or email size that RT can process.  Consider adjusting MySQL's max_allowed_packet setting.\n";
+        if ($state =~ /^(create|post)$/) {
+            my $max_packet = ($dbh->selectrow_array("show variables like 'max_allowed_packet'"))[1];
+            if ($max_packet <= (1024 * 1024)) {
+                $max_packet = sprintf("%.1fM", $max_packet/1024/1024);
+                warn "max_allowed_packet is set to $max_packet, which limits the maximum attachment or email size that RT can process.  Consider adjusting MySQL's max_allowed_packet setting.\n";
+            }
+
+            my $full_version = ($dbh->selectrow_array("show variables like 'version'"))[1];
+            if ($full_version =~ /^5\.6\.(\d+)$/ and $1 >= 20) {
+                my $redo_log_size = ($dbh->selectrow_array("show variables like 'innodb_log_file_size'"))[1];
+                $redo_log_size *= ($dbh->selectrow_array("show variables like 'innodb_log_files_in_group'"))[1]
+                    if $full_version =~ /^5\.6\.(\d+)$/ and $1 >= 22;
+
+                if ($redo_log_size / 10 < 5 * 1024 * 1024) {
+                    $redo_log_size = sprintf("%.1fM",$redo_log_size/1024/1024);
+                    warn "innodb_log_file_size is set to $innodb_log_file_size; attachments can only be 10% of this value on MySQL 5.6.  Consider adjusting MySQL's innodb_log_file_size setting.\n";
+                }
+            }
         }
     }
     return (1)

commit a828ba6d34c5098b7d339645efd30338f0aa0680
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Mar 5 20:27:03 2015 -0500

    Increase the warn threshold on max_allowed_packet to 5M
    
    The default on MySQL 5.6 is 4M, which is still likely too small.
    Additionally, increasing this to 5M brings it into parity with the redo
    log size warning.

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 7b1f128..e8f67ee 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -301,7 +301,7 @@ sub CheckCompatibility {
 
         if ($state =~ /^(create|post)$/) {
             my $max_packet = ($dbh->selectrow_array("show variables like 'max_allowed_packet'"))[1];
-            if ($max_packet <= (1024 * 1024)) {
+            if ($max_packet <= (5 * 1024 * 1024)) {
                 $max_packet = sprintf("%.1fM", $max_packet/1024/1024);
                 warn "max_allowed_packet is set to $max_packet, which limits the maximum attachment or email size that RT can process.  Consider adjusting MySQL's max_allowed_packet setting.\n";
             }
@@ -314,7 +314,7 @@ sub CheckCompatibility {
 
                 if ($redo_log_size / 10 < 5 * 1024 * 1024) {
                     $redo_log_size = sprintf("%.1fM",$redo_log_size/1024/1024);
-                    warn "innodb_log_file_size is set to $innodb_log_file_size; attachments can only be 10% of this value on MySQL 5.6.  Consider adjusting MySQL's innodb_log_file_size setting.\n";
+                    warn "innodb_log_file_size is set to $redo_log_size; attachments can only be 10% of this value on MySQL 5.6.  Consider adjusting MySQL's innodb_log_file_size setting.\n";
                 }
             }
         }

-----------------------------------------------------------------------


More information about the rt-commit mailing list