Skip to content

Commit 1f5c75c

Browse files
author
Erick Erickson
committed
LUCENE-8370: Reproducing TestLucene{54,70}DocValuesFormat.testSortedSetVariableLengthBigVsStoredFields() failures
(cherry picked from commit c303c5f)
1 parent 4212da5 commit 1f5c75c

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

lucene/CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Bug Fixes:
1515
via LUCENE-8165 since we are now checking for offset+length going out of bounds.
1616
(Robert Muir, Nhat Nyugen, Simon Willnauer)
1717

18+
* LUCENE-8370: Reproducing
19+
TestLucene{54,70}DocValuesFormat.testSortedSetVariableLengthBigVsStoredFields()
20+
failures (Erick Erickson)
21+
1822
Changes in Runtime Behavior:
1923

2024
* LUCENE-7976: TieredMergePolicy now respects maxSegmentSizeMB by default when executing

lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,22 @@
6060
* LogMergePolicy}.
6161
*
6262
* <p><b>NOTE</b>: This policy always merges by byte size
63-
* of the segments, always pro-rates by percent deletes,
64-
* and does not apply any maximum segment size during
65-
* forceMerge (unlike {@link LogByteSizeMergePolicy}).
63+
* of the segments, always pro-rates by percent deletes
6664
*
67-
* <p><b>NOTE</b> As of Lucene 7.5, forceMerge (aka optimize)
68-
* and expungeDeletes (findForcedMerges and
69-
* findForcedDeletesMerges) respect the max segment
65+
* <p><b>NOTE</b> Starting with Lucene 7.5, there are several changes:
66+
*
67+
* - findForcedMerges and findForcedDeletesMerges) respect the max segment
7068
* size by default.
7169
*
70+
* - When findforcedmerges is called with maxSegmentCount other than 1,
71+
* the resulting index is not guaranteed to have &lt;= maxSegmentCount segments.
72+
* Rather it is on a "best effort" basis. Specifically the theoretical ideal
73+
* segment size is calculated and a "fudge factor" of 25% is added as the
74+
* new maxSegmentSize, which is respected.
75+
*
76+
* - findForcedDeletesMerges will not produce segments greater than
77+
* maxSegmentSize.
78+
*
7279
* @lucene.experimental
7380
*/
7481

lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ private void doRandomForceMerge() throws IOException {
369369
System.out.println("RIW: doRandomForceMerge(" + limit + ")");
370370
}
371371
w.forceMerge(limit);
372-
assert !doRandomForceMergeAssert || w.getSegmentCount() <= limit: "limit=" + limit + " actual=" + w.getSegmentCount();
372+
if (limit == 1 || (w.getConfig().getMergePolicy() instanceof TieredMergePolicy) == false) {
373+
assert !doRandomForceMergeAssert || w.getSegmentCount() <= limit : "limit=" + limit + " actual=" + w.getSegmentCount();
374+
}
373375
} else {
374376
if (LuceneTestCase.VERBOSE) {
375377
System.out.println("RIW: do random forceMergeDeletes()");

solr/solr-ref-guide/src/solr-upgrade-notes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Detailed steps for upgrading a Solr cluster are in the section <<upgrading-a-sol
3030
=== Solr 7.5
3131
When upgrading to Solr 7.4, users should be aware of the following major changes from v7.3:
3232

33-
* When using the default TieredMergePolicy (TMP), optimize and expungeDeletes now respect the maxMergedSegmentMB configuration parameter, which defaults to 5,000 (5 gigaBytes). If it is absolutely necessary to control the number of segments present after optimize, specify maxSegments=# where # is a positive integer. TMP will also reclaim resources from segments that exceed maxMergedSegmentMB more aggressively.
33+
* When using the default TieredMergePolicy (TMP), optimize and expungeDeletes now respect the maxMergedSegmentMB configuration parameter, which defaults to 5,000 (5 gigaBytes). If it is absolutely necessary to control the number of segments present after optimize, specify maxSegments=# where # is a positive integer. maxSegments > 1 are honored on a "best effort" basis. TMP will also reclaim resources from segments that exceed maxMergedSegmentMB more aggressively.
3434

3535

3636
=== Solr 7.4

solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Default is `true`. Blocks until a new searcher is opened and registered as the m
100100

101101
WARNING: expungeDeletes is "less expensive" than optimize, but the same warnings apply.
102102

103-
`maxSegments`:: (optimize only) Default is unlimited, resulting segments respect the maxMergedSegmentMB setting. Merges the segments down to no more than this number of segments. Unless there is tangible evidence that optimizing to a small number of segments is beneficial, this parameter should be omitted and the default behavior accepted.
103+
`maxSegments`:: (optimize only) Default is unlimited, resulting segments respect the maxMergedSegmentMB setting. Makes a "best effort" attempt to merge the segments down to no more than this number of segments but does not guarantee that the goal will be achieved. Unless there is tangible evidence that optimizing to a small number of segments is beneficial, this parameter should be omitted and the default behavior accepted.
104104

105105
Here are examples of <commit> and <optimize> using optional attributes:
106106

0 commit comments

Comments
 (0)