# Part 1
# on the existing In-Portal installation:
# go to `.../core/install.php` URL
# confirm, that the "Installation Maintenance" step is shown (if perform the recommended steps shown on the screen)
# enter the login/password of the "root" user
# select the "Update Database Configuration" option
# press the "Continue" button
# confirm, that these new settings are now shown on the configuration screen and they're not empty:
* Database Error Backoff Max Retry Attempts
* Database Error Backoff Logic Base Time (in milliseconds)
* Database Lock Retry Debugging Enabled
# specify empty values for "Database Error Backoff*" settings
# press the "Continue" button
# confirm, that the validation error was shown
# change values for all of the settings to non-empty values
# press the "Continue" button
# press ENTER in the Web Browser Location field
# confirm, that the "Installation Maintenance" step is shown
# enter the login/password of the "root" user
# select the "Update Database Configuration" option
# press the "Continue" button
# confirm, that previously specified settings retained their new values
# Part 2
# try installing a clean In-Portal
# confirm, that these new settings are now shown on the "Database Configuration" step and they're not empty:
* Database Error Backoff Max Retry Attempts
* Database Error Backoff Logic Base Time (in milliseconds)
* Database Lock Retry Debugging Enabled
# specify empty values for "Database Error Backoff*" settings
# press the "Continue" button
# confirm, that the validation error was shown
# change values for all of the settings to non-empty values
# press the "Continue" button
# press ENTER in the Web Browser Location field
# confirm, that the "System Requirements Check" step is shown
# follow the installation instructions until you reach the "Database Configuration" step
# confirm, that previously specified settings retained their new values
# Part 3
# change `LanguageLabels` engine type to `InnoDB`
# in the PhpStorm confirmation ensure, that the "Max. simultaneous connections" setting is 2 or larger
# create the `/dl_test.php` file as a copy from the `/index.php` file
# in the "/dl_test.php" file replace `$application->Run();` line with this code:
```
lang=php
$application->Conn->Query('SET GLOBAL innodb_lock_wait_timeout = 10'); // If this doesn't work execute this line from the phpMyAdmin.
// Lock.
if ( $application->GetVar('user') === 'a' ) {
$application->Conn->Query('START TRANSACTION'); // Step 1.
$application->Conn->Query('SELECT * FROM ' . TABLE_PREFIX . 'LanguageLabels WHERE PhraseId = 1 LOCK IN SHARE MODE'); // Step 2.
$application->Conn->Query('DELETE FROM ' . TABLE_PREFIX . 'LanguageLabels WHERE PhraseId = 1'); // Step 5.
}
elseif ( $application->GetVar('user') === 'b' ) {
$application->Conn->Query('START TRANSACTION'); // Step 3.
$application->Conn->Query('DELETE FROM ' . TABLE_PREFIX . 'LanguageLabels WHERE PhraseId = 1'); // Step 4.
}
// Deadlock.
if ( $application->GetVar('user') === 'c' ) {
// the "user a" start the process
$application->Conn->Query('START TRANSACTION'); // Step 1.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Active C" WHERE PhraseId = 1'); // Step 3.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Add C" WHERE PhraseId = 2'); // Step 5.
}
elseif ( $application->GetVar('user') === 'd' ) {
$application->Conn->Query('START TRANSACTION'); // Step 2.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Add D" WHERE PhraseId = 2'); // Step 4.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Active D" WHERE PhraseId = 1'); // Step 6 = Deadlock.
}
$application->Conn->Query('SET GLOBAL innodb_lock_wait_timeout = 50'); // If this doesn't work execute this line from the phpMyAdmin.
```
# regular lock retries
# enable debug mode in the Web Browser
# enable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# place breakpoint inside each IF statement of the `dl_test.php` file
# open the `/dl_test.php?user=a` in 1st tab
# open the `/dl_test.php?user=b` in 2nd tab
# execute code line by line from the breakpoint as shown in comments (e.g. "Step 1" and "Step 2" in 1st debug tab of PhpStorm, then switch to 2nd debug tab of PhpStorm and execute "Step 3" and so on)
# confirm, that:
* a regular lock happened (wait time can be 10 seconds on each retry)
* after all scripts are finished detailed lock retry info is shown in the system log
# disable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# repeat the test, but this time no records about lock retries should be made
# deadlock retries
# enable debug mode in the Web Browser
# enable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# place breakpoint inside each IF statement of the `dl_test.php` file
# open the `/dl_test.php?user=c` in 1st tab
# open the `/dl_test.php?user=d` in 2nd tab
# execute code line by line from the breakpoint as shown in comments (e.g. "Step 1" in 1st debug tab of PhpStorm, then switch to 2nd debug tab of PhpStorm and execute "Step 2" and so on)
# confirm, that:
* a regular lock happened
* after all scripts are finished detailed lock retry info is shown in the system log
# disable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# repeat the test, but this time no records about lock retries should be made# execute `SET GLOBAL innodb_lock_wait_timeout = 10` database query by MySQL user with a SUPER privilege (e.g. `root`)
# change `LanguageLabels` engine type to `InnoDB`
# in the PhpStorm confirmation ensure, that the "Max. simultaneous connections" setting is 2 or larger
# create the `/dl_test.php` file as a copy from the `/index.php` file
# in the "/dl_test.php" file replace `$application->Run();` line with this code:
```
lang=php
// Lock.
if ( $application->GetVar('user') === 'a' ) {
$application->Conn->Query('START TRANSACTION'); // Step 1.
$application->Conn->Query('SELECT * FROM ' . TABLE_PREFIX . 'LanguageLabels WHERE PhraseId = 1 LOCK IN SHARE MODE'); // Step 2.
$application->Conn->Query('DELETE FROM ' . TABLE_PREFIX . 'LanguageLabels WHERE PhraseId = 1'); // Step 5.
}
elseif ( $application->GetVar('user') === 'b' ) {
$application->Conn->Query('START TRANSACTION'); // Step 3.
$application->Conn->Query('DELETE FROM ' . TABLE_PREFIX . 'LanguageLabels WHERE PhraseId = 1'); // Step 4.
}
// Deadlock.
if ( $application->GetVar('user') === 'c' ) {
// the "user a" start the process
$application->Conn->Query('START TRANSACTION'); // Step 1.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Active C" WHERE PhraseId = 1'); // Step 3.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Add C" WHERE PhraseId = 2'); // Step 5.
}
elseif ( $application->GetVar('user') === 'd' ) {
$application->Conn->Query('START TRANSACTION'); // Step 2.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Add D" WHERE PhraseId = 2'); // Step 4.
$application->Conn->Query('UPDATE ' . TABLE_PREFIX . 'LanguageLabels SET l1_Translation = "Active D" WHERE PhraseId = 1'); // Step 6 = Deadlock.
}
```
# regular lock retries
# enable debug mode in the Web Browser
# enable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# place breakpoint inside each IF statement of the `dl_test.php` file
# open the `/dl_test.php?user=a` in 1st tab
# open the `/dl_test.php?user=b` in 2nd tab
# execute code line by line from the breakpoint as shown in comments (e.g. "Step 1" and "Step 2" in 1st debug tab of PhpStorm, then switch to 2nd debug tab of PhpStorm and execute "Step 3" and so on)
# confirm, that:
* a regular lock happened (wait time can be 10 seconds on each retry)
* after all scripts are finished detailed lock retry info is shown in the system log
# disable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# repeat the test, but this time no records about lock retries should be made
# deadlock retries
# enable debug mode in the Web Browser
# enable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# place breakpoint inside each IF statement of the `dl_test.php` file
# open the `/dl_test.php?user=c` in 1st tab
# open the `/dl_test.php?user=d` in 2nd tab
# execute code line by line from the breakpoint as shown in comments (e.g. "Step 1" in 1st debug tab of PhpStorm, then switch to 2nd debug tab of PhpStorm and execute "Step 2" and so on)
# confirm, that:
* a regular lock happened
* after all scripts are finished detailed lock retry info is shown in the system log
# disable the "DBEnableLockRetryDebugging" setting in the `/system/config.php`
# repeat the test, but this time no records about lock retries should be made
# execute `SET GLOBAL innodb_lock_wait_timeout = 50` database query by MySQL user with a SUPER privilege (e.g. `root`)