Page MenuHomePhabricator

WIP: Cluster "Search Servers" config and back-end abstraction
AbandonedPublic

Authored by 20after4 on Feb 24 2017, 9:29 AM.
Tags
None
Referenced Files
F13085507: D17406.diff
Wed, Apr 24, 11:50 PM
Unknown Object (File)
Tue, Apr 16, 6:41 AM
Unknown Object (File)
Thu, Apr 11, 8:04 AM
Unknown Object (File)
Mar 23 2024, 9:26 AM
Unknown Object (File)
Dec 24 2023, 2:04 AM
Unknown Object (File)
Nov 13 2023, 6:10 AM
Unknown Object (File)
Oct 24 2023, 7:57 AM
Unknown Object (File)
Oct 22 2023, 4:46 PM
Subscribers

Details

Reviewers
None
Group Reviewers
Blessed Reviewers
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 as any of:

  • read-only
  • write-only
  • read-write
  • disabled

I'm also attempting to reuse the connection health monitoring infrastructure from
PhabricatorDatabaseHealthRecord 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 readable property when
we want to migrate to the other data center (and when we migrate from elasticsearch 2.x to 5.x)

Remaining TODO:

  • Callers will obtain a wrapper that will have the PhabricatorFulltextStorageEngine interface but will

transparently aggregate multiple back-end instances.

Test Plan

Still work in progress.

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15751
Build 20817: Run Core Tests
Build 20816: arc lint + arc unit

Event Timeline

As currently implemented, search.servers looks like this:

"search.servers": [
  {
    "type": "elasticsearch",
    "hosts": [
      {
        "host": "localhost",
        "roles": [ "read", "write" ]
      }
    ],
    "port": 9200,
    "protocol": "http",
    "path": "/phabricator",
    "version": 5
  },
  {
    "type": "mysql",
    "roles": [ "write" ]
   }
],

Settings at the 'host' level can override the settings from one level higher, so, for example, the individual host entries can specify port or version to override the service-level definition.