1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 07:42:40 +01:00
phorge-phorge/src/applications/search
Mukunda Modell e41c25de50 Support multiple fulltext search clusters with 'cluster.search' config
Summary:
The goal is to make fulltext search back-ends more extensible, configurable and robust.

When this is finished it will be possible to have multiple search storage back-ends and
potentially multiple instances of each.

Individual instances can be configured with roles such as 'read', 'write' which control
which hosts will receive writes to the index and which hosts will respond to queries.

These two roles make it possible to have any combination of:

* read-only
* write-only
* read-write
* disabled

This 'roles' mechanism is extensible to add new roles should that be needed in the future.

In addition to supporting multiple elasticsearch and mysql search instances, this refactors
the connection health monitoring infrastructure from PhabricatorDatabaseHealthRecord and
utilizes the same system for monitoring the health of elasticsearch nodes. This will
allow Wikimedia's phabricator to be redundant across data centers (mysql already is,
elasticsearch should be as well).

The real-world use-case I have in mind here is writing to two indexes (two elasticsearch clusters
in different data centers) but reading from only one. Then toggling the 'read' property when
we want to migrate to the other data center (and when we migrate from elasticsearch 2.x to 5.x)

Hopefully this is useful in the upstream as well.

Remaining TODO:

* test cases
* documentation

Test Plan:
(WARNING) This will most likely require the elasticsearch index to be deleted and re-created due to schema changes.

Tested with elasticsearch versions 2.4 and 5.2 using the following config:

```lang=json
  "cluster.search": [
    {
      "type": "elasticsearch",
      "hosts": [
        {
          "host": "localhost",
          "roles": { "read": true, "write": true }
        }
      ],
      "port": 9200,
      "protocol": "http",
      "path": "/phabricator",
      "version": 5
    },
    {
      "type": "mysql",
      "roles": { "write": true }
     }
  ]

Also deployed the same changes to Wikimedia's production Phabricator instance without any issues whatsoever.
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Tags: #elasticsearch, #clusters, #wikimedia

Differential Revision: https://secure.phabricator.com/D17384
2017-03-26 08:16:47 +00:00
..
application Convert Maniphest merge operations to modern Relationship code 2016-06-30 08:35:45 -07:00
applicationpanel Rename "SearchEngine" to "FulltextStorageEngine" 2015-12-21 17:26:19 -08:00
buckets Use new Differential bucketing logic on default (non-dashboard) homepage 2016-05-19 15:20:39 -07:00
constants Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
controller Add an action to adding Panels from ApplicationSearch 2017-03-20 14:15:31 -07:00
editor Validate menu item fields (links, projects, dashboards, applications, forms, etc) 2017-01-20 11:58:25 -08:00
engine Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
engineextension Redesign Config Application 2016-08-29 15:49:49 -07:00
exception Allow administrators to get a list of users who don't have MFA configured 2017-03-15 17:49:01 -07:00
field Prevent use of the "quality" constraint in the Badge search API 2017-03-09 12:26:58 -08:00
fulltextstorage Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
index Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
interface Prepare Profile Panels for adoption in other applications 2016-01-15 09:12:53 -08:00
management Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
menuitem Add ActionIcon to PHUIListItemView, use in Dashboards 2017-03-16 11:32:16 -07:00
ngrams Implement basic ngram search for Owners Package names 2015-12-22 08:00:33 -08:00
phidtype Rename "ProfilePanelConfiguration" to "ProfileMenuItemConfiguration" 2016-12-11 11:44:22 -08:00
query Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
relationship Render parent and child tasks in Maniphest with a graph trace 2016-07-01 10:41:07 -07:00
storage Fix errors found by PHPStan 2017-02-17 10:10:15 +00:00
typeahead Added application name to the typeahead results for doc type search 2016-08-25 11:26:49 -04:00
view Allow users to drop .ics files on calendar views to import them 2016-10-18 15:26:44 -07:00
worker Convert all "DocumentIndexers" into "FulltextEngines" 2015-12-21 17:25:23 -08:00