1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-08 04:48:28 +01:00
phorge-phorge/src/applications/project
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
..
__tests__ Fix excessively strict "Can Use Application" policy filtering 2017-01-08 11:01:36 -08:00
application Add Dashboards as a default pinned application 2017-03-21 11:10:20 -07:00
capability Add default View, Edit, and Join Policies to Projects 2014-11-21 11:22:17 -08:00
command Implement a "!projects" mail command 2015-04-01 11:51:51 -07:00
conduit Mark "v3" API methods as stable; mark obsoleted methods as "Frozen" 2017-01-09 07:16:27 -08:00
config Move FontIcon calls to Icon 2016-01-28 08:48:45 -08:00
constants Allow workboard background colors to be configured 2016-02-16 08:15:12 -08:00
controller Fix milestone widget header color on projects profile 2017-03-07 16:01:50 -08:00
customfield Fix errors found by PHPStan 2017-02-17 10:10:15 +00:00
edge Replace subscribe/unsubscribe for projects with explicit mail setting 2016-01-19 19:39:02 -08:00
editor Allow workboard background colors to be configured 2016-02-16 08:15:12 -08:00
engine Add a sort order to the favorites menu 2017-03-11 09:40:06 -08:00
engineextension Add a "columns" attachment to the maniphest.search API method 2017-01-08 13:18:01 -08:00
events New People Hovercards 2016-02-11 15:41:55 -08:00
herald Add Herald support for projects 2016-01-19 19:37:54 -08:00
icon Fix errors found by PHPStan 2017-02-17 10:10:15 +00:00
interface Roughly implement milestone columns on workboards 2016-02-03 16:37:59 -08:00
lipsum Make bin/lipsum generate hanldle generator keys and arguments more clearly 2017-02-27 09:09:28 -08:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
menuitem Remove "disabled" look to subprojects/workboard nav items 2017-03-01 09:20:48 -08:00
phid Fix dead column link and provide more milestone UI context 2016-02-05 12:25:52 -08:00
policyrule De-garbage the horrible garbage project section of the policy selection control 2016-02-05 09:50:06 -08:00
query Reduce application search engine results list for Dashboards 2017-02-22 12:42:43 -08:00
remarkup Give project tags hovercards 2016-02-03 14:50:49 -08:00
search Support multiple fulltext search clusters with 'cluster.search' config 2017-03-26 08:16:47 +00:00
searchfield Fix a bad call when prefilling ApplicationSearch from ?projects=some_slug 2016-02-08 10:44:33 -08:00
storage Add "project.column.search" for querying workboard column information 2017-01-08 13:19:02 -08:00
typeahead Fix an issue where tokenizers can sort milestone results into the wrong query phase 2016-12-09 08:07:12 -08:00
view Use consistent tag order in Maniphest list views and workboard cards 2016-08-03 16:46:40 -07:00