Page MenuHomePhabricator

Make SqlChangeDispatchCoordinator more db-agnostic
Closed, DeclinedPublic

Description

The current SqlChangeDispatchCoordinator wouldn't work on non-MySQL databases (with CAST in its syntax T207226: Wikibase does not support Postgresql (and does not even mention it requires mysql)) nor in a wiki that has a table prefix. This really should go away:

		$where = [
			'( chd_touched < ' . $dbr->addQuotes( $freshDispatchTime ) . // and wasn't touched too recently or
				// or it's lagging by more than batchSize
				' OR ( ' . (int)$maxId . ' - CAST(chd_seen AS SIGNED) ) > ' . (int)$this->batchSize . ') ' ,
			'chd_seen < ' . (int)$maxId, // and not fully up to date.
			'chd_disabled = 0' // and not disabled
		];

This is a blocker of enabling Postgres as a voting CI job.

Event Timeline

I have a local change that removes the CAST in favor of more portable syntax, but it does not solve the table prefix issue. I haven't had time to look into replacing this with something truly portable yet. Would the CAST removal be potentially welcome as an intermediate patch? Or should I wait to submit a patch until I have something that replaces the semi-hardcoded $where with something more portable?

Well, the whole class got removed, that fixed it *shrugs*