diff --git a/src/Config/Database/DbConfig.php b/src/Config/Database/DbConfig.php index 0195cbd378..9dd2be19ce 100644 --- a/src/Config/Database/DbConfig.php +++ b/src/Config/Database/DbConfig.php @@ -35,6 +35,7 @@ class DbConfig implements ConfigInterface const KEY_ENGINE = 'engine'; const KEY_INIT_STATEMENTS = 'initStatements'; const KEY_ACTIVE = 'active'; + const KEY_SYNCHRONOUS_REPLICATION = 'synchronous_replication'; /** * Names of connections @@ -195,6 +196,7 @@ private function collectEnvConfig(array $customDbConfig): array } $mageConnectionConfig = $this->convertToMageFormat($slaveConnectionData, true); $config[self::KEY_SLAVE_CONNECTION][$mageConnectionName] = $mageConnectionConfig; + $config[self::KEY_SLAVE_CONNECTION][$mageConnectionName][self::KEY_SYNCHRONOUS_REPLICATION] = true; } return $config; } diff --git a/src/Test/Unit/Config/Database/DbConfigTest.php b/src/Test/Unit/Config/Database/DbConfigTest.php index bfd778737c..50948bd8d7 100644 --- a/src/Test/Unit/Config/Database/DbConfigTest.php +++ b/src/Test/Unit/Config/Database/DbConfigTest.php @@ -317,6 +317,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], ], ], @@ -342,6 +343,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], ], ], @@ -495,6 +497,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], ], ], @@ -616,6 +619,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], ], ], @@ -759,6 +763,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], 'checkout' => [ 'host' => 'some_host_quote_slave:3310', @@ -769,6 +774,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], 'sales' => [ 'host' => 'some_host_sales_slave:3311', @@ -779,6 +785,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], ], ], @@ -977,6 +984,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], 'sales' => ['host' => 'some_host_sales_slave:3311', 'username' => 'some_username_sales_slave', @@ -986,6 +994,7 @@ public function getDataProvider() 'engine' => 'innodb', 'initStatements' => 'SET NAMES utf8;', 'active' => '1', + 'synchronous_replication' => true, ], ], ],