HomePhabricator

Make sure writes go to the right cluster

Description

Make sure writes go to the right cluster

Summary:
Two little issues

  1. there was an extra call to getHostForWrite,
  2. The engine instance was shared between multiple service definitions so it

was overwriting the list of writable hosts from one service with hosts from another.

Test Plan:
tested in wikimedia production with multiple services defined like this:

language=json
 [
        {
          "hosts": [
            {
              "host": "search.svc.codfw.wmnet",
              "protocol": "https",
              "roles": {
                "read": true,
                "write": true
              },
              "version": 5
            }
          ],
          "path": "/phabricator",
          "port": 9243,
          "type": "elasticsearch"
        },
        {
          "hosts": [
            {
              "host": "search.svc.eqiad.wmnet",
              "protocol": "https",
              "roles": {
                "read": true,
                "write": true
              },
              "version": 5
            }
          ],
          "path": "/phabricator",
          "port": 9243,
          "type": "elasticsearch"
        }
      ]

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D17581

Details

Provenance
20after4Authored on Mar 30 2017, 6:08 PM
industryPushed on Mar 30 2017, 6:08 PM
Reviewer
Blessed Reviewers
Differential Revision
D17581: Make sure writes go to the right cluster
Parents
rP67a1c4047647: Set content-type to application/json
Branches
Unknown
Tags
Unknown
Build Status
Buildable 16228
Build 21554: Run Core Tests