You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2026/10/01 20:15:15 UTC
(accumulo) 01/01: Merge branch '2.1'
This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit b4bd0e9387a4309a02073cc1b762d952c6f7d936
Merge: 4fa738bf07 4a51ea49ff
Author: Dave Marion <dl...@apache.org>
AuthorDate: Thu Oct 1 20:15:04 2026 +0000
Merge branch '2.1'
.../src/main/java/org/apache/accumulo/tserver/TabletServer.java | 5 ++---
.../src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java | 6 ++++++
.../java/org/apache/accumulo/tserver/log/TabletServerLogger.java | 2 ++
3 files changed, 10 insertions(+), 3 deletions(-)
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index b678dd06de,ecb2687180..1402c22865
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@@ -1053,26 -1425,10 +1053,25 @@@ public class TabletServer extends Abstr
closedLogs.add(currentLog);
clSize = closedLogs.size();
}
- log.info("Marking " + currentLog.getPath() + " as closed. Total closed logs " + clSize);
+ log.info("Marking {} as closed. Total closed logs: {} ", currentLog.getPath(), clSize);
walMarker.closeWal(getTabletSession(), currentLog.getPath());
+
+ // whenever a new log is added to the set of closed logs, go through all of the tablets and
+ // see if any need to minor compact
+ List<DfsLogger> closedCopy;
+ synchronized (closedLogs) {
+ closedCopy = List.copyOf(closedLogs);
+ }
+
+ int maxLogs = getConfiguration().getCount(Property.TSERV_WAL_MAX_REFERENCED);
+ if (closedCopy.size() >= maxLogs) {
+ for (Entry<KeyExtent,Tablet> entry : getOnlineTablets().entrySet()) {
+ Tablet tablet = entry.getValue();
+ tablet.checkIfMinorCompactionNeededForLogs(closedCopy, maxLogs);
+ }
+ }
} else {
- log.info(
- "Marking " + currentLog.getPath() + " as unreferenced (skipping closed writes == 0)");
+ log.info("Marking {} as unreferenced (skipping closed writes == 0)", currentLog.getPath());
walMarker.walUnreferenced(getTabletSession(), currentLog.getPath());
}
}
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
index 7ef72feee0,caa6ace170..6843538510
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
@@@ -345,22 -367,24 +345,24 @@@ public class TabletServerLogger
if (!logIdLock.isWriteLockedByCurrentThread()) {
throw new IllegalStateException("close should be called with write lock held!");
}
- try {
- if (currentLog != null) {
+ if (currentLog != null) {
+ try {
+ currentLog.close();
++ log.info("Closing write-ahead log: {}, entries written: {}, bytes written: {}",
++ currentLog.getLogEntry(), currentLog.getWrites(), currentLog.getBytesWritten());
+ } catch (DfsLogger.LogClosedException ex) {
+ // ignore
+ } catch (IOException | RuntimeException ex) {
+ log.error("Unable to cleanly close log " + currentLog.getLogEntry() + ": " + ex, ex);
+ } finally {
try {
- currentLog.close();
- log.info("Closing write-ahead log: {}, entries written: {}, bytes written: {}",
- currentLog.getFileName(), currentLog.getWrites(), currentLog.getBytesWritten());
- } catch (DfsLogger.LogClosedException ex) {
- // ignore
- } catch (Exception ex) {
- log.error("Unable to cleanly close log " + currentLog.getFileName() + ": " + ex, ex);
- } finally {
this.tserver.walogClosed(currentLog);
- currentLog = null;
- logSizeEstimate.set(0);
+ } catch (WalMarkerException | RuntimeException t) {
+ throw new IOException(t);
}
+ currentLog = null;
+ logSizeEstimate.set(0);
}
- } catch (Exception t) {
- throw new IOException(t);
}
}