Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/310493
Change subject: Set cpPosTime cookie for the non-redirect case as well
......................................................................
Set cpPosTime cookie for the non-redirect case as well
This is useful if the ChronologyProtector store cannot sync
among datacenters and waitForReplication() is DC-local.
It only applies if the user stays on the domain, however.
Change-Id: I800cade7b87a0f02d6a429e70924c54189a4a7af
---
M includes/MediaWiki.php
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/93/310493/1
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 5ea8c31..9bbbd35 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -604,6 +604,14 @@
// OutputPage::output() is fairly slow; run it in
$postCommitWork to mask
// the latency of syncing DB positions accross all
datacenters synchronously
$flags = $lbFactory::SHUTDOWN_CHRONPROT_SYNC;
+ if ( $lbFactory->hasOrMadeRecentMasterChanges( INF ) ) {
+ $cpPosTime = microtime( true );
+ // Set a cookie in case the DB position store
cannot sync accross datacenters.
+ // This will at least cover the common case of
the user staying on the domain.
+ $expires = time() +
ChronologyProtector::POSITION_TTL;
+ $options = [ 'prefix' => '' ];
+ $request->response()->setCookie( 'cpPosTime',
$cpPosTime, $expires, $options );
+ }
}
// Record ChronologyProtector positions for DBs affected in
this request at this point
$lbFactory->shutdown( $flags, $postCommitWork );
--
To view, visit https://gerrit.wikimedia.org/r/310493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I800cade7b87a0f02d6a429e70924c54189a4a7af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits