Skip to content

Commit

Permalink
LUCENE-9569 Disalbe sort opt on _doc (#1959)
Browse files Browse the repository at this point in the history
Sort optimization on _doc was introduced in PR #1856,
but it looks unstable and lead to some recent tests failure.
As the release of 8.7 is very soon, we need to temporarily
disable this sort optimization for _doc for this release
with a plan to stabilize it for later releases.
  • Loading branch information
mayya-sharipova authored Oct 7, 2020
1 parent e914862 commit 1c0f07a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ public class DocComparator extends FieldComparator<Integer> {
/** Creates a new comparator based on document ids for {@code numHits} */
public DocComparator(int numHits, boolean reverse, int sortPost) {
this.docIDs = new int[numHits];
// Temporarily disable sort optimization for 8.7 release
this.enableSkipping = false;
// TODO: enable sort optimization after 8.7 release
// skipping functionality is enabled if we are sorting by _doc in asc order as a primary sort
this.enableSkipping = (reverse == false && sortPost == 0);
// this.enableSkipping = (reverse == false && sortPost == 0);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ public void testFloatSortOptimization() throws IOException {
dir.close();
}

@AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-9569")
public void testDocSortOptimizationWithAfter() throws IOException {
final Directory dir = newDirectory();
final IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());
Expand Down Expand Up @@ -397,7 +398,7 @@ public void testDocSortOptimizationWithAfter() throws IOException {
dir.close();
}


@AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-9569")
public void testDocSortOptimization() throws IOException {
final Directory dir = newDirectory();
final IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());
Expand Down

0 comments on commit 1c0f07a

Please sign in to comment.