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();
|
this.lock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
this.storeEngine.getStoreFileManager().addCompactionResults(compactedFiles, result);
|
this.storeEngine.getStoreFileManager().addCompactionResults(compactedFiles, result);
|
||||||
filesCompacting.removeAll(compactedFiles); // safe bc: lock.writeLock();
|
synchronized (filesCompacting) {
|
||||||
|
filesCompacting.removeAll(compactedFiles);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.lock.writeLock().unlock();
|
this.lock.writeLock().unlock();
|
||||||
}
|
}
|
||||||
@ -2560,7 +2562,11 @@ public class HStore implements Store {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean needsCompaction() {
|
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
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user