Page MenuHomePhabricator

Entity dumpers should reload db config on the fly
Closed, ResolvedPublic

Description

Follow up to T300255: Wikidata entity dumper keeps connecting to depooled host for really long time and T298485: MW scripts should reload the database config

It is taking a bit after each depool for the dumper to actually drain the connections. The solution would be to add $lbFactory->autoReconfigure() to after each batch (DumpGenerator::generateDump() I think)

Event Timeline

If we want to avoid adding DB-specific knowledge into the DumpGenerator, I think we could also put the “reconfigure” call into SqlEntityIdPager::fetchIds()… but the dump generator probably makes more sense.

Prio Notes:

  • Affects Production systems
  • Does not affect development efforts
  • Does not affect onboarding efforts
  • Might affect additional stakeholders (DBAs)

Note from a conversation with Amir the other day: Once we fix this, we can increase the dumpers’ runtime again (revert the change related to T300255).

Change 857670 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Auto-reconfigure LBFactory in DumpGenerator

https://gerrit.wikimedia.org/r/857670

@Ladsgroup and @daniel – I just stumbled across this paragraph in the LBFactory::autoReconfigure() (and reconfigure()) phpdoc:

@warning This must only be called in top level code such as the execute()
method of a maintenance script. Any database connection in use when this
method is called will become defunct.

This no longer applies, right? DBConnRefs automatically reconnect, and we don’t really use non-ref connections anymore?

Change 857707 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Add autoReconfigure() to ILBFactory

https://gerrit.wikimedia.org/r/857707

Change 857707 merged by jenkins-bot:

[mediawiki/core@master] Add autoReconfigure() to ILBFactory

https://gerrit.wikimedia.org/r/857707

Change 857670 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Auto-reconfigure LBFactory in DumpGenerator

https://gerrit.wikimedia.org/r/857670

Change 860922 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Auto-reconfigure LBFactory in some more places

https://gerrit.wikimedia.org/r/860922

@Ladsgroup and @daniel – I just stumbled across this paragraph in the LBFactory::autoReconfigure() (and reconfigure()) phpdoc:

@warning This must only be called in top level code such as the execute()
method of a maintenance script. Any database connection in use when this
method is called will become defunct.

This no longer applies, right? DBConnRefs automatically reconnect, and we don’t really use non-ref connections anymore?

Uploaded a Gerrit change to remove that comment.

Change 860922 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Auto-reconfigure LBFactory in some more places

https://gerrit.wikimedia.org/r/860922

I’m going to assume this is done; DBAs, if you still see reconnects from long-running Wikibase scripts, please reopen.