Skip to content

Commit 8ca6148

Browse files
committed
HBASE-23668 Master log start filling with "Flush journal status" messages"
This reverts commit fb9fa04. i.e. reapplication of patch that was preamaturely applied. Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent 56842d0 commit 8ca6148

3 files changed

Lines changed: 22 additions & 10 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/procedure2/store/region/RegionFlusherAndCompactor.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ class RegionFlusherAndCompactor implements Closeable {
120120
flushThread.start();
121121
compactExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder()
122122
.setNameFormat("Procedure-Region-Store-Compactor").setDaemon(true).build());
123+
LOG.info("Constructor flushSize={}, flushPerChanges={}, flushIntervalMs={}, " +
124+
"compactMin=", flushSize, flushPerChanges, flushIntervalMs, compactMin);
123125
}
124126

125127
// inject our flush related configurations
@@ -130,6 +132,8 @@ static void setupConf(Configuration conf) {
130132
conf.setLong(HRegion.MEMSTORE_FLUSH_PER_CHANGES, flushPerChanges);
131133
long flushIntervalMs = conf.getLong(FLUSH_INTERVAL_MS_KEY, DEFAULT_FLUSH_INTERVAL_MS);
132134
conf.setLong(HRegion.MEMSTORE_PERIODIC_FLUSH_INTERVAL, flushIntervalMs);
135+
LOG.info("Injected flushSize={}, flushPerChanges={}, flushIntervalMs={}", flushSize,
136+
flushPerChanges, flushIntervalMs);
133137
}
134138

135139
private void compact() {
@@ -180,6 +184,7 @@ private void flushLoop() {
180184
changesAfterLastFlush.set(0);
181185
try {
182186
region.flush(true);
187+
lastFlushTime = EnvironmentEdgeManager.currentTime();
183188
} catch (IOException e) {
184189
LOG.error(HBaseMarkers.FATAL, "Failed to flush procedure store region, aborting...", e);
185190
abortable.abort("Failed to flush procedure store region", e);
@@ -207,8 +212,14 @@ private void flushLoop() {
207212
}
208213

209214
private boolean shouldFlush(long changes) {
210-
return region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize() >= flushSize ||
211-
changes > flushPerChanges;
215+
long heapSize = region.getMemStoreHeapSize();
216+
long offHeapSize = region.getMemStoreOffHeapSize();
217+
boolean flush = heapSize + offHeapSize >= flushSize || changes > flushPerChanges;
218+
if (flush && LOG.isTraceEnabled()) {
219+
LOG.trace("shouldFlush totalMemStoreSize={}, flushSize={}, changes={}, flushPerChanges={}",
220+
heapSize + offHeapSize, flushSize, changes, flushPerChanges);
221+
}
222+
return flush;
212223
}
213224

214225
void onUpdate() {
@@ -237,4 +248,4 @@ public void close() {
237248
flushThread.interrupt();
238249
compactExecutor.shutdown();
239250
}
240-
}
251+
}

hbase-server/src/main/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStore.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ private void tryMigrate(FileSystem fs) throws IOException {
306306
if (!fs.exists(procWALDir)) {
307307
return;
308308
}
309-
LOG.info("The old procedure wal directory {} exists, start migrating", procWALDir);
309+
LOG.info("The old WALProcedureStore wal directory {} exists, migrating...", procWALDir);
310310
WALProcedureStore store = new WALProcedureStore(conf, leaseRecovery);
311311
store.start(numThreads);
312312
store.recoverLease();
@@ -347,7 +347,7 @@ public void handleCorrupted(ProcedureIterator procIter) throws IOException {
347347
}
348348
}
349349
});
350-
LOG.info("The max pid is {}, and the max pid of all loaded procedures is {}",
350+
LOG.info("The WALProcedureStore max pid is {}, and the max pid of all loaded procedures is {}",
351351
maxProcIdSet.longValue(), maxProcIdFromProcs.longValue());
352352
// Theoretically, the maxProcIdSet should be greater than or equal to maxProcIdFromProcs, but
353353
// anyway, let's do a check here.
@@ -358,12 +358,13 @@ public void handleCorrupted(ProcedureIterator procIter) throws IOException {
358358
PROC_QUALIFIER, EMPTY_BYTE_ARRAY));
359359
}
360360
} else if (maxProcIdSet.longValue() < maxProcIdFromProcs.longValue()) {
361-
LOG.warn("The max pid is less than the max pid of all loaded procedures");
361+
LOG.warn("The WALProcedureStore max pid is less than the max pid of all loaded procedures");
362362
}
363363
if (!fs.delete(procWALDir, true)) {
364-
throw new IOException("Failed to delete the migrated proc wal directory " + procWALDir);
364+
throw new IOException("Failed to delete the WALProcedureStore migrated proc wal directory " +
365+
procWALDir);
365366
}
366-
LOG.info("Migration finished");
367+
LOG.info("Migration of WALProcedureStore finished");
367368
}
368369

369370
@Override

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,7 @@ public FlushResultImpl flushcache(boolean forceFlushAllStores, boolean writeFlus
24312431
flushesQueued.reset();
24322432
}
24332433

2434-
status.markComplete("Flush successful");
2434+
status.markComplete("Flush successful " + fs.toString());
24352435
return fs;
24362436
} finally {
24372437
synchronized (writestate) {
@@ -8903,4 +8903,4 @@ static void decorateRegionConfiguration(Configuration conf) {
89038903
}
89048904
}
89058905
}
8906-
}
8906+
}

0 commit comments

Comments
 (0)