[FileBackend] Removed obsolete "allowStale" parameter.
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 27 Nov 2012 21:55:58 +0000 (13:55 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 27 Nov 2012 21:55:58 +0000 (13:55 -0800)
* This was obsoleted by doQuickOperations().

Change-Id: I9e1d9c1e1c910e4ce6de4317299424305b31469c

includes/filebackend/FileBackend.php
includes/filebackend/FileOp.php
includes/filebackend/FileOpBatch.php

index 3108d11..0b7c072 100644 (file)
@@ -279,9 +279,6 @@ abstract class FileBackend {
         *   - nonLocking          : No locks are acquired for the operations.
         *                           This can increase performance for non-critical writes.
         *                           This has no effect unless the 'force' flag is set.
-        *   - allowStale          : Don't require the latest available data.
-        *                           This can increase performance for non-critical writes.
-        *                           This has no effect unless the 'force' flag is set.
         *   - nonJournaled        : Don't log this operation batch in the file journal.
         *                           This limits the ability of recovery scripts.
         *   - parallelize         : Try to do operations in parallel when possible.
@@ -315,7 +312,6 @@ abstract class FileBackend {
                }
                if ( empty( $opts['force'] ) ) { // sanity
                        unset( $opts['nonLocking'] );
-                       unset( $opts['allowStale'] );
                }
                return $this->doOperationsInternal( $ops, $opts );
        }
index 0d64a44..7952bcb 100644 (file)
@@ -42,7 +42,6 @@ abstract class FileOp {
        protected $state = self::STATE_NEW; // integer
        protected $failed = false; // boolean
        protected $async = false; // boolean
-       protected $useLatest = true; // boolean
        protected $batchId; // string
 
        protected $doOperation = true; // boolean; operation is not a no-op
@@ -124,16 +123,6 @@ abstract class FileOp {
                $this->batchId = $batchId;
        }
 
-       /**
-        * Whether to allow stale data for file reads and stat checks
-        *
-        * @param $allowStale bool
-        * @return void
-        */
-       final public function allowStaleReads( $allowStale ) {
-               $this->useLatest = !$allowStale;
-       }
-
        /**
         * Get the value of the parameter with the given name
         *
@@ -411,7 +400,7 @@ abstract class FileOp {
                if ( isset( $predicates['exists'][$source] ) ) {
                        return $predicates['exists'][$source]; // previous op assures this
                } else {
-                       $params = array( 'src' => $source, 'latest' => $this->useLatest );
+                       $params = array( 'src' => $source, 'latest' => true );
                        return $this->backend->fileExists( $params );
                }
        }
@@ -429,7 +418,7 @@ abstract class FileOp {
                } elseif ( isset( $predicates['exists'][$source] ) && !$predicates['exists'][$source] ) {
                        return false; // previous op assures this
                } else {
-                       $params = array( 'src' => $source, 'latest' => $this->useLatest );
+                       $params = array( 'src' => $source, 'latest' => true );
                        return $this->backend->getFileSha1Base36( $params );
                }
        }
index 736393a..6e103ec 100644 (file)
@@ -42,9 +42,6 @@ class FileOpBatch {
         * $opts is an array of options, including:
         *   - force        : Errors that would normally cause a rollback do not.
         *                    The remaining operations are still attempted if any fail.
-        *   - allowStale   : Don't require the latest available data.
-        *                    This can increase performance for non-critical writes.
-        *                    This has no effect unless the 'force' flag is set.
         *   - nonJournaled : Don't log this operation batch in the file journal.
         *   - concurrency  : Try to do this many operations in parallel when possible.
         *
@@ -69,7 +66,6 @@ class FileOpBatch {
                }
 
                $batchId = $journal->getTimestampedUUID();
-               $allowStale = !empty( $opts['allowStale'] );
                $ignoreErrors = !empty( $opts['force'] );
                $journaled = empty( $opts['nonJournaled'] );
                $maxConcurrency = isset( $opts['concurrency'] ) ? $opts['concurrency'] : 1;
@@ -84,7 +80,6 @@ class FileOpBatch {
                foreach ( $performOps as $index => $fileOp ) {
                        $backendName = $fileOp->getBackend()->getName();
                        $fileOp->setBatchId( $batchId ); // transaction ID
-                       $fileOp->allowStaleReads( $allowStale ); // consistency level
                        // Decide if this op can be done concurrently within this sub-batch
                        // or if a new concurrent sub-batch must be started after this one...
                        if ( $fileOp->dependsOn( $curBatchDeps )