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

Alex Vandiver alexmv at bestpractical.com
Fri Mar 6 13:19:05 EST 2015


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

- Log -----------------------------------------------------------------
commit 4393822888ba0444e5586514ac9e2950190c6bd6
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..94ffe78 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 $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";
+                }
+            }
         }
     }
     return (1)

commit 3e8cda519830d2c2ffc22f6a831111e999938ca6
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 94ffe78..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";
             }

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


More information about the rt-commit mailing list