EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/320309

Change subject: Don't allow creating metastore from saneitizeJobs.php
......................................................................

Don't allow creating metastore from saneitizeJobs.php

It seems it's possible for the cluster to be in an odd state, where one
node has become partitioned off from the rest of the cluster, and that
node will tell our code that the index doesn't exist even when it does.
This code creates the index, and then the node has trouble re-joining
the cluster.

To be frank, this doesn't seem like a CirrusSearch problem and instead
is some sort of problem with elasticsearch itself. There should only be
one master, and creating an index should require an 'OK' from the
master. We've seen it happen though, so work around the issue by bailing
if the index doesn't exist, expecting it to always be created explicitly
by an admin via metastore.php maintenance script.

Bug: T148821
Change-Id: I6c102677ae91715d277e8469597c4f4990b6c928
---
M maintenance/saneitizeJobs.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/09/320309/1

diff --git a/maintenance/saneitizeJobs.php b/maintenance/saneitizeJobs.php
index 7f215c4..32d1653 100644
--- a/maintenance/saneitizeJobs.php
+++ b/maintenance/saneitizeJobs.php
@@ -359,6 +359,11 @@
                $this->metaStores = [];
                foreach ( $connections as $cluster => $connection ) {
                        $store = new MetaStoreIndex( $connection, $this );
+                       if ( !$store->exists() ) {
+                               $this->error( "No metastore found in cluster 
$cluster", 1 );
+                       }
+                       // This won't create, since we already checked. Should 
it be allowed
+                       // to do a major upgrade though, or limited to minor 
upgrades?
                        $store->createOrUpgradeIfNecessary();
                        $this->metaStores[$cluster] = $store;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/320309
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c102677ae91715d277e8469597c4f4990b6c928
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to