I'm seconding that recommendation to be clear. More specifically, I'd suggest
that the AFT classes have two new protected methods:
* getSlaveDB() - wrapper for wfGetLBFactory()->getExternalLB(
$wgArticleFeedBackCluster )->getConnection( DB_SLAVE, array(), $wikiId )
* getMasterDB() - wrapper for wfGetLBFactory()->getExternalLB(
$wgArticleFeedBackCluster )->getConnection( DB_MASTER, array(), $wikiId )
The wrappers could also handle the case where the cluster is the usual wiki
cluster as well (e.g. good old wfGetDB()).

You could then swap out the current wfGetDB() calls with these methods. It
might be easiest to start with the current AFT, do this, and fix up the
excessive queries write queries rather that try to convert the AFT5 code
that used sharding. The name of the cluster would be an AFT configuration
variable (e.g. $wgArticleFeedBackCluster = 'external-aft' ).

This works by adding the new  'external-aft' cluster to the 'externalLoads'
portion of the load balancer configuration. It may make sense to give the
cluster a non-AFT specific name though (like 'external-1'), since I assume
other extensions would use it. Maybe the clusters could be named after
philosophers to be more interesting...

One could instead use wfGetDB( index, array(), 'extension-aft' ), though
this would be a bit hack since:
a) A wiki ID would be used as an external cluster name where there is no
wiki
b) The actual wiki IDs would have to go into table names or a column



--
View this message in context: 
http://wikimedia.7.n6.nabble.com/Refactor-of-mediawiki-extensions-ArticleFeedbackv5-backend-tp4990937p4990952.html
Sent from the Wikipedia Developers mailing list archive at Nabble.com.

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to