mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 10:23:41 -04:00
revert unneeded changes on Store
This commit is contained in:
parent
ea4e3e58dc
commit
aea96920d9
1 changed files with 10 additions and 19 deletions
|
@ -28,7 +28,6 @@ import org.apache.lucene.store.*;
|
||||||
import org.apache.lucene.util.*;
|
import org.apache.lucene.util.*;
|
||||||
import org.elasticsearch.ElasticsearchIllegalStateException;
|
import org.elasticsearch.ElasticsearchIllegalStateException;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.collect.Tuple;
|
import org.elasticsearch.common.collect.Tuple;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
|
@ -540,10 +539,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
|
||||||
/**
|
/**
|
||||||
* This method deletes every file in this store that is not contained in the given source meta data or is a
|
* This method deletes every file in this store that is not contained in the given source meta data or is a
|
||||||
* legacy checksum file. After the delete it pulls the latest metadata snapshot from the store and compares it
|
* legacy checksum file. After the delete it pulls the latest metadata snapshot from the store and compares it
|
||||||
* to the given snapshot. If the snapshots are inconsistent an illegal state exception is thrown.
|
* to the given snapshot. If the snapshots are inconsistent an illegal state exception is thrown
|
||||||
*
|
|
||||||
* If the store is part of a shadow replica, extra files are not cleaned up because they could be in use
|
|
||||||
* by a shared filesystem.
|
|
||||||
*
|
*
|
||||||
* @param reason the reason for this cleanup operation logged for each deleted file
|
* @param reason the reason for this cleanup operation logged for each deleted file
|
||||||
* @param sourceMetaData the metadata used for cleanup. all files in this metadata should be kept around.
|
* @param sourceMetaData the metadata used for cleanup. all files in this metadata should be kept around.
|
||||||
|
@ -557,11 +553,10 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
|
||||||
final StoreDirectory dir = directory;
|
final StoreDirectory dir = directory;
|
||||||
for (String existingFile : dir.listAll()) {
|
for (String existingFile : dir.listAll()) {
|
||||||
// don't delete snapshot file, or the checksums file (note, this is extra protection since the Store won't delete checksum)
|
// don't delete snapshot file, or the checksums file (note, this is extra protection since the Store won't delete checksum)
|
||||||
// we also don't want to deleted IndexWriter's write.lock
|
if (!sourceMetaData.contains(existingFile) && !Store.isChecksum(existingFile)) {
|
||||||
// files, since it could be a shared filesystem
|
|
||||||
if (!sourceMetaData.contains(existingFile) && !Store.isChecksum(existingFile) && !Store.isEngineLock(existingFile)) {
|
|
||||||
try {
|
try {
|
||||||
dir.deleteFile(reason, existingFile);
|
dir.deleteFile(reason, existingFile);
|
||||||
|
dir.deleteFile(existingFile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// ignore, we don't really care, will get deleted later on
|
// ignore, we don't really care, will get deleted later on
|
||||||
}
|
}
|
||||||
|
@ -1088,10 +1083,6 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
|
||||||
return name.startsWith(CHECKSUMS_PREFIX) || name.endsWith(".cks"); // bwcomapt - .cks used to be a previous checksum file
|
return name.startsWith(CHECKSUMS_PREFIX) || name.endsWith(".cks"); // bwcomapt - .cks used to be a previous checksum file
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final boolean isEngineLock(String name) {
|
|
||||||
return name.equals("write.lock");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Produces a string representation of the given digest value.
|
* Produces a string representation of the given digest value.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue