*/
function load( $address = '', $user = 0, $killExpired = true )
{
- global $wgDBmysql4 ;
+ global $wgDBmysql4, $wgAntiLockFlags;
$fname = 'Block::load';
wfDebug( "Block::load: '$address', '$user', $killExpired\n" );
$killed = false;
if ( $this->forUpdate() ) {
$db =& wfGetDB( DB_MASTER );
- $options = 'FOR UPDATE';
+ if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) {
+ $options = '';
+ } else {
+ $options = 'FOR UPDATE';
+ }
} else {
$db =& wfGetDB( DB_SLAVE );
$options = '';
*/
/*static*/ function enumBlocks( $callback, $tag, $flags = 0 )
{
+ global $wgAntiLockFlags;
+
$block = new Block();
if ( $flags & EB_FOR_UPDATE ) {
$db =& wfGetDB( DB_MASTER );
- $options = 'FOR UPDATE';
+ if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) {
+ $options = '';
+ } else {
+ $options = 'FOR UPDATE';
+ }
$block->forUpdate( true );
} else {
$db =& wfGetDB( DB_SLAVE );
* Preload links during link update for save
* ALF_PRELOAD_EXISTENCE
* Preload cur_id during replaceLinkHolders
+ * ALF_NO_LINK_LOCK
+ * Don't use locking reads when updating the link table. This is
+ * necessary for wikis with a high edit rate for performance
+ * reasons, but may cause link table inconsistency
+ * ALF_NO_BLOCK_LOCK
+ * As for ALF_LINK_LOCK, this flag is a necessity for high-traffic
+ * wikis.
*/
$wgAntiLockFlags = 0;
define( 'ALF_PRELOAD_LINKS', 1 );
define( 'ALF_PRELOAD_EXISTENCE', 2 );
define( 'ALF_NO_LINK_LOCK', 4 );
+define( 'ALF_NO_BLOCK_LOCK', 8 );
/**#@-*/
?>