X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=blobdiff_plain;f=includes%2FStorage%2FPageEditStash.php;h=4671d99f15c654c46cb5d26ceea191dd5d24470f;hb=3e74b6eeaaf4ad0ce1217d013cca09a3f07cb5c7;hp=9c2b3e7de4981bcc27d869fd06232c545a675422;hpb=37e011b5554dd9b2966ccfdbef9a9bc8309a233f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/PageEditStash.php b/includes/Storage/PageEditStash.php index 9c2b3e7de4..4671d99f15 100644 --- a/includes/Storage/PageEditStash.php +++ b/includes/Storage/PageEditStash.php @@ -109,7 +109,7 @@ class PageEditStash { // the stash request finishes parsing. For the lock acquisition below, there is not much // need to duplicate parsing of the same content/user/summary bundle, so try to avoid // blocking at all here. - $dbw = $this->lb->getConnection( DB_MASTER ); + $dbw = $this->lb->getConnectionRef( DB_MASTER ); if ( !$dbw->lock( $key, $fname, 0 ) ) { // De-duplicate requests on the same key return self::ERROR_BUSY; @@ -269,17 +269,28 @@ class PageEditStash { if ( $editInfo->output->getFlag( 'vary-revision' ) ) { // This can be used for the initial parse, e.g. for filters or doEditContent(), - // but a second parse will be triggered in doEditUpdates(). This is not optimal. + // but a second parse will be triggered in doEditUpdates() no matter what $logger->info( - "Cache for key '{key}' has vary_revision; post-insertion parse inevitable.", - $context - ); - } elseif ( $editInfo->output->getFlag( 'vary-revision-id' ) ) { - // Similar to the above if we didn't guess the ID correctly. - $logger->debug( - "Cache for key '{key}' has vary_revision_id; post-insertion parse possible.", + "Cache for key '{key}' has 'vary-revision'; post-insertion parse inevitable.", $context ); + } else { + static $flagsMaybeReparse = [ + // Similar to the above if we didn't guess the ID correctly + 'vary-revision-id', + // Similar to the above if we didn't guess the timestamp correctly + 'vary-revision-timestamp', + // Similar to the above if we didn't guess the content correctly + 'vary-revision-sha1' + ]; + foreach ( $flagsMaybeReparse as $flag ) { + if ( $editInfo->output->getFlag( $flag ) ) { + $logger->debug( + "Cache for key '{key}' has $flag; post-insertion parse possible.", + $context + ); + } + } } return $editInfo; @@ -351,7 +362,8 @@ class PageEditStash { * @return string|null TS_MW timestamp or null */ private function lastEditTime( User $user ) { - $db = $this->lb->getConnection( DB_REPLICA ); + $db = $this->lb->getConnectionRef( DB_REPLICA ); + $actorQuery = ActorMigration::newMigration()->getWhere( $db, 'rc_user', $user, false ); $time = $db->selectField( [ 'recentchanges' ] + $actorQuery['tables'],