BryanDavis has uploaded a new change for review.

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

Change subject: logstash: Add a "synced flush" command when optimizing an index
......................................................................

logstash: Add a "synced flush" command when optimizing an index

Tell the Elasticsearch server to flush and mark the state of an index
after we optimize it and mark it as write blocked. This should help
ensure that the indices for past days recover quickly during a normal
cluster restart where the replicas and master are already in sync.

See 
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html

Change-Id: I72cf622dffd51f72a2f97926d668fbc27d445340
---
M modules/logstash/files/logstash_optimize_index.sh
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/249756/1

diff --git a/modules/logstash/files/logstash_optimize_index.sh 
b/modules/logstash/files/logstash_optimize_index.sh
index 64a7ee2..7ecc179 100755
--- a/modules/logstash/files/logstash_optimize_index.sh
+++ b/modules/logstash/files/logstash_optimize_index.sh
@@ -46,5 +46,8 @@
     -d '{"index.blocks.write":true}' ||
 die "Failed to change settings for ${ES_HOST}/${ES_INDEX}"
 
+runCurl -XPOST "${ES_HOST}/${ES_INDEX}/_flush/synced" ||
+die "Failed to force a synced flush for ${ES_HOST}/${ES_INDEX}"
+
 cleanUp
 exit

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72cf622dffd51f72a2f97926d668fbc27d445340
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

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

Reply via email to