You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2016/02/09 15:43:08 UTC

lucene-solr git commit: SOLR-3141: Warn in logs when expensive optimize calls are made

Repository: lucene-solr
Updated Branches:
  refs/heads/master e9c90037a -> be807919b


SOLR-3141: Warn in logs when expensive optimize calls are made


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/be807919
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/be807919
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/be807919

Branch: refs/heads/master
Commit: be807919b632a55d9f7e870133f916043f8d8ec1
Parents: e9c9003
Author: Jan Høydahl <ja...@apache.org>
Authored: Tue Feb 9 15:37:25 2016 +0100
Committer: Jan Høydahl <ja...@apache.org>
Committed: Tue Feb 9 15:37:25 2016 +0100

----------------------------------------------------------------------
 solr/CHANGES.txt                                               | 2 ++
 .../src/java/org/apache/solr/update/DirectUpdateHandler2.java  | 6 ++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/be807919/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d0289a7..d37ce33 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -668,6 +668,8 @@ Other Changes
 * SOLR-8308: Core gets inaccessible after RENAME operation with special characters
   (Erik Hatcher, Erick Erickson)
 
+* SOLR-3141: Warn in logs when expensive optimize calls are made (yonik, janhoy)
+
 ==================  5.4.1 ==================
 
 Bug Fixes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/be807919/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
index fe14bd5..6fe4884 100644
--- a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
+++ b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
@@ -594,8 +594,14 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
       try {
         IndexWriter writer = iw.get();
         if (cmd.optimize) {
+          if (cmd.maxOptimizeSegments == 1) {
+            log.warn("Starting optimize... Reading and rewriting the entire index! Use with care.");
+          } else {
+            log.warn("Starting optimize... Reading and rewriting a potentially large percent of the entire index, reducing to " + cmd.maxOptimizeSegments + " segments");
+          }
           writer.forceMerge(cmd.maxOptimizeSegments);
         } else if (cmd.expungeDeletes) {
+          log.warn("Starting expungeDeletes... Reading and rewriting segments with enough deletes, potentially the entire index");
           writer.forceMergeDeletes();
         }