Merge "Set the WRITE_SYNC flag for SessionBackend writes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 29 Aug 2016 16:05:47 +0000 (16:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 29 Aug 2016 16:05:47 +0000 (16:05 +0000)
includes/session/SessionBackend.php

index 264e1ae..0439b36 100644 (file)
@@ -716,6 +716,8 @@ final class SessionBackend {
                        }
                }
 
+               $flags = $this->persist ? 0 : CachedBagOStuff::WRITE_CACHE_ONLY;
+               $flags |= CachedBagOStuff::WRITE_SYNC; // write to all datacenters
                $this->store->set(
                        wfMemcKey( 'MWSession', (string)$this->id ),
                        [
@@ -723,7 +725,7 @@ final class SessionBackend {
                                'metadata' => $metadata,
                        ],
                        $metadata['expires'],
-                       $this->persist ? 0 : CachedBagOStuff::WRITE_CACHE_ONLY
+                       $flags
                );
 
                $this->metaDirty = false;