Remove index defaultMaxClauseCount config setting while reusing maxTerms
When browsing Related Changes that are ready to be submitted, the Submit
buttons used to disappear from the UI. That was caused by TooManyClauses
exceptions being thrown while trying to query the secondary index. And,
that exception was caused by either an index.defaultMaxClauseCount value
that was too low or just a naturally deep history of related changes.
The likelihood of this case increased when index.maxTerms was either not
set (thus no limit) or set to a value higher than defaultMaxClauseCount.
User experience through the UI should not have suffered from such
missing -or challenging- index config tuning.
Fix this issue by using index.maxTerms at all levels, leading to proper
fallback on the database if that query size limit is reached. Also,
change maxTerms default to 1024 (from no-limit), to match that late
defaultMaxClauseCount default of 1024. This is so that the original
default at index level (former defaultMaxClauseCount) is preserved, to
keep default index querying efficient.
Update the related Documentation accordingly.
Test:
- push at least a few Related Changes
- vote on them so they become Ready to Submit
- before this fix: set index.defaultMaxClauseCount to e.g. 3, to provoke
- index.maxTerms needs to be unset => default: no limit before, 1024 now
- browse those Related Changes (click on each)
- after this fix: Submit buttons should all still show
- after this fix: Change tab headers should all look fine.
Bug: Issue 3771
Change-Id: If2222d14d7b0345327c9bf9f28a7c1038d9b5a8b
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 6127036..ec2945e 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -2382,10 +2382,14 @@
+
Maximum number of leaf terms to allow in a query. Too-large queries may
perform poorly, so setting this option causes query parsing to fail fast
-before attempting to send them to the secondary index. Set to 0 for no
-limit.
+before attempting to send them to the secondary index. Should this limit
+be reached, database is used instead of index as applicable.
+
-Defaults to no limit.
+When the index type is `LUCENE`, also sets the maximum number of clauses
+permitted per BooleanQuery. This is so that all enforced query limits
+are the same.
++
+Defaults to 1024.
==== Lucene configuration
@@ -2394,14 +2398,6 @@
The following settings are only used when the index type is `LUCENE`.
-[[index.defaultMaxClauseCount]]index.defaultMaxClauseCount::
-+
-Only used when the type is `LUCENE`.
-+
-Sets the maximum number of clauses permitted per BooleanQuery.
-+
-Defaults to 1024.
-
[[index.name.ramBufferSize]]index.name.ramBufferSize::
+
Determines the amount of RAM that may be used for buffering added documents
@@ -2445,7 +2441,6 @@
----
[index]
type = LUCENE
- defaultMaxClauseCount = 2048
[index "changes_open"]
ramBufferSize = 60 m