Page MenuHomeIn-Portal Phabricator

INP-1833 - Add database server index to the error messages
ClosedPublic

Authored by alex on Oct 24 2022, 7:01 AM.

Details

Test Plan

Preparations

  1. add these lines to the /system/config.php file to emulate master-slave configuration (set actual database connection settings):
$_CONFIG['Databases'] = array(
	array(
		'DBHost' => 'localhost',
		'DBUser' => 'user',
		'DBUserPassword' => 'pass',
		'DBLoad' => 1,
		'DBMaxLag' => 15,
	),
);
  1. replace SELECT ... in the ListSQLs property of the l unit config with aSELECT and save changes
  2. replace SELECT ... in the ListSQLs property of the search-log unit config with aSELECT and save changes

Test Plan

  1. go to Front-End (homepage)
  2. confirm, that an SQL error happened
  3. go to Admin Console
  4. go to the Logs & ReportsSystem Log section
  5. confirm, that:
    • a record, for just happened on the Front-End, SQL error was created
    • log message starts with [Server #1] , which means 2nd server = slave
  6. go to Logs & ReportsSearch Log section
  7. confirm, that:
    • a record, for just happened on the Front-End, SQL error was created
    • log message doesn't start with [Server #...] text (where ... is server index), which means 1nd server = master

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex created this revision.Oct 24 2022, 7:01 AM
alex requested review of this revision.Oct 24 2022, 7:01 AM
alex edited the test plan for this revision. (Show Details)Oct 24 2022, 7:19 AM
alex added a project: Restricted Project.
alex updated this revision to Diff 1105.Oct 25 2022, 6:36 AM

Prepend server index instead of appending.

erik accepted this revision.Oct 25 2022, 6:39 AM
This revision is now accepted and ready to land.Oct 25 2022, 6:39 AM
alex edited the test plan for this revision. (Show Details)Oct 25 2022, 6:48 AM
This revision was automatically updated to reflect the committed changes.