Springle has submitted this change and it was merged.

Change subject: Switch to LOCK IN SHARE MODE in recordUpload2()
......................................................................


Switch to LOCK IN SHARE MODE in recordUpload2()

* We just need the latest data; the advisory locking in lock()
  already manages mutual exclusion.

Change-Id: I9af7a892b2dcafd30149332b0084f61d117c9cad
---
M includes/filerepo/file/LocalFile.php
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Springle: Looks good to me, approved



diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index 08c9afb..9f14669 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -1303,9 +1303,11 @@
                );
                if ( $dbw->affectedRows() == 0 ) {
                        if ( $allowTimeKludge ) {
-                               # Use FOR UPDATE to ignore any transaction 
snapshotting
+                               # Use LOCK IN SHARE MODE to ignore any 
transaction snapshotting
                                $ltimestamp = $dbw->selectField( 'image', 
'img_timestamp',
-                                       array( 'img_name' => $this->getName() 
), __METHOD__, array( 'FOR UPDATE' ) );
+                                       array( 'img_name' => $this->getName() ),
+                                       __METHOD__,
+                                       array( 'LOCK IN SHARE MODE' ) );
                                $lUnixtime = $ltimestamp ? wfTimestamp( 
TS_UNIX, $ltimestamp ) : false;
                                # Avoid a timestamp that is not newer than the 
last version
                                # TODO: the image/oldimage tables should be 
like page/revision with an ID field

-- 
To view, visit https://gerrit.wikimedia.org/r/167424
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9af7a892b2dcafd30149332b0084f61d117c9cad
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Springle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to