From: Aaron Schulz Date: Tue, 27 Nov 2012 21:55:58 +0000 (-0800) Subject: [FileBackend] Removed obsolete "allowStale" parameter. X-Git-Tag: 1.31.0-rc.0~21403^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=69b24f9a63304df2b6b7ed61ab56cd6f6693c35b;p=lhc%2Fweb%2Fwiklou.git [FileBackend] Removed obsolete "allowStale" parameter. * This was obsoleted by doQuickOperations(). Change-Id: I9e1d9c1e1c910e4ce6de4317299424305b31469c --- diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 3108d11efb..0b7c072752 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -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 ); } diff --git a/includes/filebackend/FileOp.php b/includes/filebackend/FileOp.php index 0d64a44b5e..7952bcb32e 100644 --- a/includes/filebackend/FileOp.php +++ b/includes/filebackend/FileOp.php @@ -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 ); } } diff --git a/includes/filebackend/FileOpBatch.php b/includes/filebackend/FileOpBatch.php index 736393af86..6e103ec550 100644 --- a/includes/filebackend/FileOpBatch.php +++ b/includes/filebackend/FileOpBatch.php @@ -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 )