Skip to content

Commit

Permalink
Remove pending deletions workaround (#41245)
Browse files Browse the repository at this point in the history
The recent upgrade to lucene 8.1.0 included the fix for LUCENE-8735
(pending deletions did not delegate). Removed the temporary workaround
that was previously added for this issue.

Follow up to #40345
  • Loading branch information
henningandersen committed Apr 17, 2019
1 parent ebf7920 commit 97fd2ed
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.nio.channels.Channels;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.Set;

/**
* This class is used to wrap an existing {@link org.apache.lucene.store.FSDirectory} so that
Expand Down Expand Up @@ -80,10 +79,4 @@ public void write(byte[] b, int offset, int length) throws IOException {
CHUNK_SIZE);
}
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.io.Closeable;
import java.io.IOException;
import java.util.Collection;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;

final class LocalShardSnapshot implements Closeable {
Expand Down Expand Up @@ -117,12 +116,6 @@ public Lock obtainLock(String name) throws IOException {
public void close() throws IOException {
throw new UnsupportedOperationException("nobody should close this directory wrapper");
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,6 @@ public void readBytes(byte[] b, int offset, int len) throws IOException {
assert index.getFileDetails(dest).recovered() == l : index.getFileDetails(dest).toString();
}
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.io.UncheckedIOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.NoSuchFileException;
import java.util.Set;

final class ByteSizeCachingDirectory extends FilterDirectory {

Expand Down Expand Up @@ -180,10 +179,4 @@ public void deleteFile(String name) throws IOException {
}
}
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
}
7 changes: 0 additions & 7 deletions server/src/main/java/org/elasticsearch/index/store/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -760,13 +760,6 @@ public IndexInput openInput(String name, IOContext context) throws IOException {
public String toString() {
return "store(" + in.toString() + ")";
}

@Override
public Set<String> getPendingDeletions() throws IOException {
// FilterDirectory.getPendingDeletions does not delegate, working around it here.
// to be removed once fixed in FilterDirectory.
return unwrap(this).getPendingDeletions();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1457,12 +1457,6 @@ public String[] listAll() throws IOException {
return super.listAll();
}
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
};

try (Store store = createStore(shardId, new IndexSettings(metaData, Settings.EMPTY), directory)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.elasticsearch.test.ESTestCase;

import java.io.IOException;
import java.util.Set;

@LuceneTestCase.SuppressFileSystems("ExtrasFS")
public class ByteSizeCachingDirectoryTests extends ESTestCase {
Expand All @@ -46,12 +45,6 @@ public long fileLength(String name) throws IOException {
numFileLengthCalls++;
return super.fileLength(name);
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
}

public void testBasics() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Random;
import java.util.Set;

public class MockFSDirectoryService extends FsDirectoryService {

Expand Down Expand Up @@ -179,12 +178,6 @@ public synchronized void crash() throws IOException {
super.crash();
}
}

// temporary override until LUCENE-8735 is integrated
@Override
public Set<String> getPendingDeletions() throws IOException {
return in.getPendingDeletions();
}
}

static final class CloseableDirectory implements Closeable {
Expand Down

0 comments on commit 97fd2ed

Please sign in to comment.