mirror of https://github.com/apache/activemq.git
Making the removeDataFile a little smarter to avoid removing data files that are still being worked on
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@741600 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
51e82d59e7
commit
789ea7cab9
|
@ -295,12 +295,14 @@ public class Journal {
|
|||
|
||||
public synchronized void removeDataFiles(Set<Integer> files) throws IOException {
|
||||
for (Integer key : files) {
|
||||
// Can't remove the data file (or subsequent files) that is currently being written to.
|
||||
if( key >= lastAppendLocation.get().getDataFileId() ) {
|
||||
continue;
|
||||
}
|
||||
DataFile dataFile = fileMap.get(key);
|
||||
// Can't remove the last file.
|
||||
if( dataFile == dataFiles.getTail() ) {
|
||||
continue;
|
||||
if( dataFile!=null ) {
|
||||
forceRemoveDataFile(dataFile);
|
||||
}
|
||||
forceRemoveDataFile(dataFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue