Merge "Removed old "noPush" config hacks from FileBackendMultiWrite"
[lhc/web/wiklou.git] / includes / filebackend / FileBackendMultiWrite.php
index 012e4e9..10e5a1e 100644 (file)
  * Only use this class when transitioning from one storage system to another.
  *
  * Read operations are only done on the 'master' backend for consistency.
- * Write operations are performed on all backends, in the order defined.
- * If an operation fails on one backend it will be rolled back from the others.
+ * Write operations are performed on all backends, starting with the master.
+ * This makes a best-effort to have transactional semantics, but since requests
+ * may sometimes fail, the use of "autoResync" or background scripts to fix
+ * inconsistencies is important.
  *
  * @ingroup FileBackend
  * @since 1.19
  */
 class FileBackendMultiWrite extends FileBackend {
-       /** @var array Prioritized list of FileBackendStore objects.
-        * array of (backend index => backends)
-        */
+       /** @var FileBackendStore[] Prioritized list of FileBackendStore objects */
        protected $backends = array();
 
        /** @var int Index of master backend */
@@ -140,6 +140,7 @@ class FileBackendMultiWrite extends FileBackend {
                // Try to lock those files for the scope of this function...
                if ( empty( $opts['nonLocking'] ) ) {
                        // Try to lock those files for the scope of this function...
+                       /** @noinspection PhpUnusedLocalVariableInspection */
                        $scopeLock = $this->getScopedLocksForOps( $ops, $status );
                        if ( !$status->isOK() ) {
                                return $status; // abort
@@ -650,6 +651,6 @@ class FileBackendMultiWrite extends FileBackend {
                );
 
                // Actually acquire the locks
-               return array( $this->getScopedFileLocks( $pbPaths, 'mixed', $status ) );
+               return $this->getScopedFileLocks( $pbPaths, 'mixed', $status );
        }
 }