HBASE-19728 Add lock to filesCompacting in all place.
This commit is contained in:
parent
df317a7db3
commit
e1bcf50b10
|
@ -1447,7 +1447,9 @@ public class HStore implements Store {
|
|||
this.lock.writeLock().lock();
|
||||
try {
|
||||
this.storeEngine.getStoreFileManager().addCompactionResults(compactedFiles, result);
|
||||
filesCompacting.removeAll(compactedFiles); // safe bc: lock.writeLock();
|
||||
synchronized (filesCompacting) {
|
||||
filesCompacting.removeAll(compactedFiles);
|
||||
}
|
||||
} finally {
|
||||
this.lock.writeLock().unlock();
|
||||
}
|
||||
|
@ -2560,7 +2562,11 @@ public class HStore implements Store {
|
|||
|
||||
@Override
|
||||
public boolean needsCompaction() {
|
||||
return this.storeEngine.needsCompaction(this.filesCompacting);
|
||||
List<StoreFile> filesCompactingClone = null;
|
||||
synchronized (filesCompacting) {
|
||||
filesCompactingClone = Lists.newArrayList(filesCompacting);
|
||||
}
|
||||
return this.storeEngine.needsCompaction(filesCompactingClone);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue