Delegate write.lock to primary directory
This commit is contained in:
parent
f5b2dfd052
commit
d6ae832c90
|
@ -19,6 +19,7 @@
|
|||
package org.elasticsearch.index.store;
|
||||
|
||||
import org.apache.lucene.index.IndexFileNames;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.store.*;
|
||||
import org.apache.lucene.util.IOUtils;
|
||||
import org.elasticsearch.common.math.MathUtils;
|
||||
|
@ -148,7 +149,7 @@ public final class DistributorDirectory extends BaseDirectory {
|
|||
* Returns true if the primary directory should be used for the given file.
|
||||
*/
|
||||
private boolean usePrimary(String name) {
|
||||
return IndexFileNames.SEGMENTS_GEN.equals(name) || Store.isChecksum(name);
|
||||
return IndexFileNames.SEGMENTS_GEN.equals(name) || Store.isChecksum(name) || IndexWriter.WRITE_LOCK_NAME.equals(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -507,7 +507,7 @@ public class StoreTest extends ElasticsearchLuceneTestCase {
|
|||
|
||||
}
|
||||
|
||||
public void assertDeleteContent(Store store,DirectoryService service) throws IOException {
|
||||
public void assertDeleteContent(Store store, DirectoryService service) throws IOException {
|
||||
store.deleteContent();
|
||||
assertThat(Arrays.toString(store.directory().listAll()), store.directory().listAll().length, equalTo(0));
|
||||
assertThat(store.stats().sizeInBytes(), equalTo(0l));
|
||||
|
|
Loading…
Reference in New Issue