Add comments to ApiBase::isWriteMode()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 12 Apr 2017 23:17:00 +0000 (16:17 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 12 Apr 2017 23:17:00 +0000 (16:17 -0700)
Change-Id: I3581f5e3055c425367d265a5c57831bb34dd5a2f

includes/api/ApiBase.php

index b698cef..37750c8 100644 (file)
@@ -385,6 +385,13 @@ abstract class ApiBase extends ContextSource {
 
        /**
         * Indicates whether this module requires write mode
+        *
+        * This should return true for modules that may require synchronous database writes.
+        * Modules that do not need such writes should also not rely on master database access,
+        * since only read queries are needed and each master DB is a single point of failure.
+        * Additionally, requests that only need replica DBs can be efficiently routed to any
+        * datacenter via the Promise-Non-Write-API-Action header.
+        *
         * @return bool
         */
        public function isWriteMode() {