Page MenuHomeIn-Portal Phabricator

INP-1890 - Force "\kApplication::NextResourceId" method to use master database connection
AcceptedPublic

Authored by alex on Dec 10 2024, 7:22 AM.

Details

Reviewers
erik
Test Plan

Preparations

  1. in IDE:
    • open the /index.php for editing
    • replace $application->Run(); line with echo $application->NextResourceId(); line
    • save changes
    • open the /system/config.php file for editing
    • append this to end of the file:
$_CONFIG['Databases'] = array(
    array(
	'DBHost' => $_CONFIG['Database']['DBHost'],
	'DBUser' => $_CONFIG['Database']['DBUser'],
	'DBUserPassword' => $_CONFIG['Database']['DBUserPassword'],
	'DBLoad' => 1,
	'DBMaxLag' => 15,
    ),
);
  • save changes

Part 1

  1. don't apply the patch
  2. open /index.php in the browser
  3. confirm, that it hangs (page keeps loading) because lock was set in slave database, but data is changed in master database (they both reference the same database)
  4. apply the patch
  5. open /index.php in the browser
  6. confirm, that page has loaded and next resource id is displayed on the page
  7. open /index.php in the browser
  8. confirm, that page has loaded and next resource id is displayed on the page (not the same as previous time)

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 1350
Build 1350: arc lint + arc unit

Event Timeline

alex created this revision.Dec 10 2024, 7:22 AM
alex requested review of this revision.Dec 10 2024, 7:22 AM
alex edited the test plan for this revision. (Show Details)Dec 10 2024, 7:45 AM
Harbormaster completed remote builds in B1350: Diff 1299.
Harbormaster completed remote builds in B1350: Diff 1299.
erik accepted this revision.Thu, Dec 19, 10:25 AM

Tests passed, but first time after patch applied need wait long time (2-3 minutes) to get ID shown. Next page refreshes becomes fast (~1 sec).

This revision is now accepted and ready to land.Thu, Dec 19, 10:25 AM
alex added a comment.Thu, Dec 19, 11:44 AM
In D501#10225, @erik wrote:

Tests passed, but first time after patch applied need wait long time (2-3 minutes) to get ID shown. Next page refreshes becomes fast (~1 sec).

Strange.

Try restarting a MySQL server (command as root user on your VM: systemctl restart mysql.service) and rerunning a test. Suspecting a handling lock.

Does the same delay occur?

erik added a comment.EditedThu, Dec 19, 12:01 PM

Yes, when restarting before open index.php, then all is ok - no delay after patch applied