Skip to content

Commit

Permalink
Side-step pending deletes check
Browse files Browse the repository at this point in the history
When we split/shrink an index we open several IndexWriter instances
causeing file-deletes to be pending on windows. This subsequently fails
when we open an IW to bootstrap the index history due to pending deletes.
This change sidesteps the check since we know our history goes forward
in terms of files and segments.

Closes elastic#30416
  • Loading branch information
s1monw committed May 14, 2018
1 parent 6a8aa99 commit 05663e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 11 additions & 0 deletions server/src/main/java/org/elasticsearch/index/store/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,17 @@ private void innerClose() throws IOException {
public String toString() {
return "store(" + in.toString() + ")";
}

@Override
public boolean checkPendingDeletions() throws IOException {
if (super.checkPendingDeletions() == false) {
deletesLogger.debug("directory has still pending deletes");
}
// we skip this check since our IW usage always goes forward.
// we still might run into situations where we have pending deletes ie. in shrink / split case
// and that will cause issues on windows since we open multiple IW instance one after another during the split/shrink recovery
return false;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.SortedSetSelector;
import org.apache.lucene.search.SortedSetSortField;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
import org.elasticsearch.Version;
import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteResponse;
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
Expand Down Expand Up @@ -77,7 +76,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/30416")
public class ShrinkIndexIT extends ESIntegTestCase {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.lucene.search.SortedSetSelector;
import org.apache.lucene.search.SortedSetSortField;
import org.apache.lucene.search.join.ScoreMode;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.Version;
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
Expand Down Expand Up @@ -81,7 +80,6 @@
import static org.hamcrest.Matchers.greaterThanOrEqualTo;


@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/30416")
public class SplitIndexIT extends ESIntegTestCase {

@Override
Expand Down

0 comments on commit 05663e4

Please sign in to comment.