HBASE-5568 Multi concurrent flushcache() for one region could cause data loss (Chunhui)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1301639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4a5a27eac2
commit
8e84390b37
@ -1318,22 +1318,22 @@ public class HRegion implements HeapSize { // , Writable{
|
|||||||
status.setStatus("Running coprocessor pre-flush hooks");
|
status.setStatus("Running coprocessor pre-flush hooks");
|
||||||
coprocessorHost.preFlush();
|
coprocessorHost.preFlush();
|
||||||
}
|
}
|
||||||
try {
|
synchronized (writestate) {
|
||||||
synchronized (writestate) {
|
if (!writestate.flushing && writestate.writesEnabled) {
|
||||||
if (!writestate.flushing && writestate.writesEnabled) {
|
this.writestate.flushing = true;
|
||||||
this.writestate.flushing = true;
|
} else {
|
||||||
} else {
|
if (LOG.isDebugEnabled()) {
|
||||||
if (LOG.isDebugEnabled()) {
|
LOG.debug("NOT flushing memstore for region " + this
|
||||||
LOG.debug("NOT flushing memstore for region " + this +
|
+ ", flushing=" + writestate.flushing + ", writesEnabled="
|
||||||
", flushing=" +
|
+ writestate.writesEnabled);
|
||||||
writestate.flushing + ", writesEnabled=" +
|
|
||||||
writestate.writesEnabled);
|
|
||||||
}
|
|
||||||
status.abort("Not flushing since " +
|
|
||||||
(writestate.flushing ? "already flushing" : "writes not enabled"));
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
status.abort("Not flushing since "
|
||||||
|
+ (writestate.flushing ? "already flushing"
|
||||||
|
: "writes not enabled"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
boolean result = internalFlushcache(status);
|
boolean result = internalFlushcache(status);
|
||||||
|
|
||||||
if (coprocessorHost != null) {
|
if (coprocessorHost != null) {
|
||||||
|
@ -152,7 +152,7 @@ public class TestStore extends TestCase {
|
|||||||
|
|
||||||
public void testDeleteExpiredStoreFiles() throws Exception {
|
public void testDeleteExpiredStoreFiles() throws Exception {
|
||||||
int storeFileNum = 4;
|
int storeFileNum = 4;
|
||||||
int ttl = 1;
|
int ttl = 4;
|
||||||
|
|
||||||
Configuration conf = HBaseConfiguration.create();
|
Configuration conf = HBaseConfiguration.create();
|
||||||
// Enable the expired store file deletion
|
// Enable the expired store file deletion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user