Merge "objectcache: move lag waiting to SqlBagOStuff::doCas() instead of overriding...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 23 Aug 2019 19:19:51 +0000 (19:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 23 Aug 2019 19:19:51 +0000 (19:19 +0000)
includes/objectcache/SqlBagOStuff.php

index 7c9b281..a1820ab 100644 (file)
@@ -504,7 +504,12 @@ class SqlBagOStuff extends MediumSpecificBagOStuff {
                        return false;
                }
 
-               return (bool)$db->affectedRows();
+               $success = (bool)$db->affectedRows();
+               if ( $this->fieldHasFlags( $flags, self::WRITE_SYNC ) ) {
+                       $success = $this->waitForReplication() && $success;
+               }
+
+               return $success;
        }
 
        protected function doDeleteMulti( array $keys, $flags = 0 ) {
@@ -554,15 +559,6 @@ class SqlBagOStuff extends MediumSpecificBagOStuff {
                return $newCount;
        }
 
-       public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
-               $ok = $this->mergeViaCas( $key, $callback, $exptime, $attempts, $flags );
-               if ( $this->fieldHasFlags( $flags, self::WRITE_SYNC ) ) {
-                       $ok = $this->waitForReplication() && $ok;
-               }
-
-               return $ok;
-       }
-
        public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) {
                return $this->modifyMulti(
                        array_fill_keys( $keys, null ),