Reduce Title::invalidateCache contention a bit
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 27 May 2014 18:21:07 +0000 (11:21 -0700)
committerSpringle <springle@wikimedia.org>
Wed, 28 May 2014 02:34:57 +0000 (02:34 +0000)
* Lots of deadlocks seems to happen on page deletion,
  where the ID is likely 0 (this also has the worst locks)

bug: 37519
Change-Id: I028783a998946615b93e1425c6f69e00afd7b1bb

includes/Title.php

index ea4a1b2..d8f6b75 100644 (file)
@@ -4728,6 +4728,10 @@ class Title {
                        return false;
                }
 
+               if ( $this->mArticleID === 0 ) {
+                       return true; // avoid gap locking if we know it's not there
+               }
+
                $method = __METHOD__;
                $dbw = wfGetDB( DB_MASTER );
                $conds = $this->pageCond();