Removed the warning for `innodb_flush_log_at_trx_commit`
authorAlexander Ebert <ebert@woltlab.com>
Sun, 4 Oct 2020 11:08:39 +0000 (13:08 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 4 Oct 2020 11:08:39 +0000 (13:08 +0200)
The value is now displayed as a server variable on the index page for manual review.

Closes #3535

wcfsetup/install/files/acp/templates/dataImport.tpl
wcfsetup/install/files/acp/templates/index.tpl
wcfsetup/install/files/acp/templates/rebuildData.tpl
wcfsetup/install/files/lib/acp/form/DataImportForm.class.php
wcfsetup/install/files/lib/acp/page/IndexPage.class.php
wcfsetup/install/files/lib/acp/page/RebuildDataPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index b77a057becd4ce002b6f0c7380e26765abd60271..799c084928ff987ebfb83c443f79d6793a93cb82 100644 (file)
 
 {include file='formError'}
 
-{if $showInnoDBWarning}
-       <p class="warning">{lang}wcf.acp.index.innoDBWarning{/lang}</p>
-{/if}
-
 {if !$exporterName}
        {if !$availableExporters|count}
                <p class="info">{lang}wcf.acp.dataImport.selectExporter.noExporters{/lang}</p>
index 1cb65ba3772e383bfc40772b78a387910be0e770..6c7d8c8aefa38dd2463db0b272e22114257760f3 100644 (file)
                                        </dl>
                                {/if}
                                
+                               {if $server[innodbFlushLogAtTrxCommit] !== false}
+                                       <dl>
+                                               <dt>innodb_flush_log_at_trx_commit</dt>
+                                               <dd>{$server[innodbFlushLogAtTrxCommit]}</dd>
+                                       </dl>
+                               {/if}
+                               
                                {event name='serverFields'}
                        </section>
                
index 85c8bd03c507aed70a3b903f8c01ef8d0d9a8ff7..4aadca412b2fbe52033b0666abfc65e7e7bad7fe 100644 (file)
        {/hascontent}
 </header>
 
-{if $showInnoDBWarning}
-       <p class="warning">{lang}wcf.acp.index.innoDBWarning{/lang}</p>
-{/if}
-
 {event name='afterContentHeader'}
 
 <section class="section">
index 85b221cf42f3782a1a21a65973e4604809ab86ad..a0f6170252cc0efaab08310d720c79f067298558 100644 (file)
@@ -107,12 +107,6 @@ class DataImportForm extends AbstractForm {
         */
        public $fileSystemPath = '';
        
-       /**
-        * display a warning if InnoDB uses a slow configuration
-        * @var boolean
-        */
-       public $showInnoDBWarning = false;
-       
        /**
         * display notice for existing import mappings
         * @var boolean
@@ -280,14 +274,6 @@ class DataImportForm extends AbstractForm {
                                }
                        }
                }
-               
-               $sql = "SHOW VARIABLES LIKE 'innodb_flush_log_at_trx_commit'";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute();
-               $row = $statement->fetchArray();
-               if ($row && $row['Value'] == 1) {
-                       $this->showInnoDBWarning = true;
-               }
        }
        
        /**
@@ -310,9 +296,8 @@ class DataImportForm extends AbstractForm {
                        'dbPrefix' => $this->dbPrefix,
                        'fileSystemPath' => $this->fileSystemPath,
                        'userMergeMode' => $this->userMergeMode,
-                       'showInnoDBWarning' => $this->showInnoDBWarning,
                        'showMappingNotice' => $this->showMappingNotice,
-                       'additionalData' => $this->additionalData
+                       'additionalData' => $this->additionalData,
                ]);
        }
 }
index 7969ae88ec029ead3ed37353890b24fdb3e3fde3..2729b9a7a73661a99b8e5dd2cc10a70a6d9c5f4c 100755 (executable)
@@ -32,6 +32,15 @@ class IndexPage extends AbstractPage {
        public function readData() {
                parent::readData();
                
+               $sql = "SHOW VARIABLES LIKE 'innodb_flush_log_at_trx_commit'";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute();
+               $row = $statement->fetchArray();
+               $innodbFlushLogAtTrxCommit = false;
+               if ($row !== false) {
+                       $innodbFlushLogAtTrxCommit = $row['Value'];
+               }
+               
                $this->server = [
                        'os' => PHP_OS,
                        'webserver' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '',
@@ -40,7 +49,8 @@ class IndexPage extends AbstractPage {
                        'memoryLimit' => @ini_get('memory_limit'),
                        'upload_max_filesize' => @ini_get('upload_max_filesize'),
                        'postMaxSize' => @ini_get('post_max_size'),
-                       'sslSupport' => RemoteFile::supportsSSL()
+                       'sslSupport' => RemoteFile::supportsSSL(),
+                       'innodbFlushLogAtTrxCommit' => $innodbFlushLogAtTrxCommit,
                ];
                
                // get load
index 0f6dfd6d3e3aa4211c44a67e2f644607f9e3c3ec..392c23b394320d9e1f58abe177494e215d69105e 100644 (file)
@@ -35,12 +35,6 @@ class RebuildDataPage extends AbstractPage {
         */
        public $objectTypes = [];
        
-       /**
-        * display a warning if InnoDB uses a slow configuration
-        * @var boolean
-        */
-       public $showInnoDBWarning = false;
-       
        /**
         * @inheritDoc
         */
@@ -65,14 +59,6 @@ class RebuildDataPage extends AbstractPage {
                        return 0;
                });
                
-               $sql = "SHOW VARIABLES LIKE 'innodb_flush_log_at_trx_commit'";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute();
-               $row = $statement->fetchArray();
-               if ($row && $row['Value'] == 1) {
-                       $this->showInnoDBWarning = true;
-               }
-               
                // We're disallowing rebuilding any other data unless the
                // database encoding has been converted to utf8mb4. The
                // user_storage table is used as a reference, as it is the
@@ -102,7 +88,6 @@ class RebuildDataPage extends AbstractPage {
                WCF::getTPL()->assign([
                        'convertEncoding' => $this->convertEncoding,
                        'objectTypes' => $this->objectTypes,
-                       'showInnoDBWarning' => $this->showInnoDBWarning
                ]);
        }
 }
index 4a5e0b59d9a5fd55e9ab3a0ac88d1117115a2ccd..86fa0d48ba6bb41707427fa11aae5139e30a5940 100644 (file)
@@ -914,7 +914,6 @@ ACHTUNG: Die oben genannten Meldungen sind stark gekürzt. Sie können Details z
                <item name="wcf.acp.index.credits.productManager"><![CDATA[Projektleitung]]></item>
                <item name="wcf.acp.index.credits.trademarks"><![CDATA[„WoltLab&reg;“ und „Burning Board&reg;“ sind eingetragene Gemeinschaftsmarken beim europäischen Harmonisierungsamt für den Binnenmarkt (OHIM) in Alicante, Spanien.]]></item>
                <item name="wcf.acp.index.credits.contributor.more"><![CDATA[Weitere]]></item>
-               <item name="wcf.acp.index.innoDBWarning"><![CDATA[Die MySQL-Einstellung „innodb_flush_log_at_trx_commit“ steht auf dem Wert „1“ und verursacht dadurch eine starke Verlangsamung bestimmter Datenbankabfragen. Es wird empfohlen diesen Wert auf „2“ zu setzen.]]></item>
                <item name="wcf.acp.index.inRescueMode"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du rufst{else}Sie rufen{/if} diese Installation über eine abweichende Domain auf, etwa aufgrund eines Umzuges. Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}korrigiere{else}korrigieren Sie{/if} die Einstellungen unter <a href="{link controller='ApplicationManagement'}{/link}">Apps verwalten</a>.]]></item>
                <item name="wcf.acp.index.tmpBroken"><![CDATA[Für den ordnungsgemäßen Betrieb muss das Verzeichnis „{WCF_DIR|concat:'tmp/'}“ existieren und beschreibbar sein. Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}überprüfe{else}überprüfen Sie{/if} auch die Zugriffsrechte auf den Ordner „{'WCF_DIR'|constant}“.]]></item>
                <item name="wcf.acp.index.news"><![CDATA[Nachrichten]]></item>
index 9d5a28a42070d26a200862db3b9cf1eff20b2496..9a42943916335af38f2cbe1ef1aca2dcdafcbb70 100644 (file)
@@ -891,7 +891,6 @@ ATTENTION: The messages listed above are greatly shortened. You can view details
                <item name="wcf.acp.index.credits.productManager"><![CDATA[Product Manager]]></item>
                <item name="wcf.acp.index.credits.trademarks"><![CDATA[“WoltLab&reg;” and “Burning Board&reg;” are registered Community Trade Marks at The Office of Harmonization for the Internal Market (OHIM) in Alicante, Spain.]]></item>
                <item name="wcf.acp.index.credits.contributor.more"><![CDATA[More]]></item>
-               <item name="wcf.acp.index.innoDBWarning"><![CDATA[The MySQL configuration option “innodb_flush_log_at_trx_commit” is set to “1”, slowing down certain database queries. It is highly recommended to set its value to “2”.]]></item>
                <item name="wcf.acp.index.inRescueMode"><![CDATA[You are accessing this installation from an unknown domain, possibly caused by moving to a new host. Please update the settings on <a href="{link controller='ApplicationManagement'}{/link}">Manage Apps</a>.]]></item>
                <item name="wcf.acp.index.tmpBroken"><![CDATA[For proper operation the folder “{WCF_DIR|concat:'tmp/'}” must exist and it must be writable. Please also check the permissions of the “{'WCF_DIR'|constant}” folder.]]></item>
                <item name="wcf.acp.index.news"><![CDATA[News]]></item>