private void removeInactiveLogs() throws IOException { // We keep track of which procedures are holding the oldest WAL in 'holdingCleanupTracker'. // once there is nothing olding the oldest WAL we can remove it. while (logs.size() > 1 && holdingCleanupTracker.isEmpty()) { LOG.info("Remove the oldest log {}", logs.getFirst()); removeLogFile(logs.getFirst(), walArchiveDir); buildHoldingCleanupTracker(); } // TODO: In case we are holding up a lot of logs for long time we should // rewrite old procedures (in theory parent procs) to the new WAL. }
/** * Remove all logs with logId <= {@code lastLogId}. */ private void removeAllLogs(long lastLogId, String why) { if (logs.size() <= 1) { return; } LOG.info("Remove all state logs with ID less than {}, since {}", lastLogId, why); boolean removed = false; while (logs.size() > 1) { ProcedureWALFile log = logs.getFirst(); if (lastLogId < log.getLogId()) { break; } removeLogFile(log, walArchiveDir); removed = true; } if (removed) { buildHoldingCleanupTracker(); } }
buildHoldingCleanupTracker(); tryCleanupLogsOnLoad(); } finally {
buildHoldingCleanupTracker(); } else if (logs.size() > walCountWarnThreshold) { LOG.warn("procedure WALs count={} above the warning threshold {}. check running procedures" +
private void removeInactiveLogs() throws IOException { // We keep track of which procedures are holding the oldest WAL in 'holdingCleanupTracker'. // once there is nothing olding the oldest WAL we can remove it. while (logs.size() > 1 && holdingCleanupTracker.isEmpty()) { LOG.info("Remove the oldest log {}", logs.getFirst()); removeLogFile(logs.getFirst(), walArchiveDir); buildHoldingCleanupTracker(); } // TODO: In case we are holding up a lot of logs for long time we should // rewrite old procedures (in theory parent procs) to the new WAL. }
private void removeInactiveLogs() throws IOException { // We keep track of which procedures are holding the oldest WAL in 'holdingCleanupTracker'. // once there is nothing olding the oldest WAL we can remove it. while (logs.size() > 1 && holdingCleanupTracker.isEmpty()) { removeLogFile(logs.getFirst(), walArchiveDir); buildHoldingCleanupTracker(); } // TODO: In case we are holding up a lot of logs for long time we should // rewrite old procedures (in theory parent procs) to the new WAL. }
/** * Remove all logs with logId <= {@code lastLogId}. */ private void removeAllLogs(long lastLogId) { if (logs.size() <= 1) return; if (LOG.isTraceEnabled()) { LOG.trace("Remove all state logs with ID less than " + lastLogId); } boolean removed = false; while (logs.size() > 1) { ProcedureWALFile log = logs.getFirst(); if (lastLogId < log.getLogId()) { break; } removeLogFile(log, walArchiveDir); removed = true; } if (removed) { buildHoldingCleanupTracker(); } }
/** * Remove all logs with logId <= {@code lastLogId}. */ private void removeAllLogs(long lastLogId, String why) { if (logs.size() <= 1) { return; } LOG.info("Remove all state logs with ID less than {}, since {}", lastLogId, why); boolean removed = false; while (logs.size() > 1) { ProcedureWALFile log = logs.getFirst(); if (lastLogId < log.getLogId()) { break; } removeLogFile(log, walArchiveDir); removed = true; } if (removed) { buildHoldingCleanupTracker(); } }
buildHoldingCleanupTracker(); tryCleanupLogsOnLoad(); } finally {
try { buildHoldingCleanupTracker(); tryCleanupLogsOnLoad(); loading.set(false);
buildHoldingCleanupTracker(); } else if (logs.size() > walCountWarnThreshold) { LOG.warn("procedure WALs count=" + logs.size() +
buildHoldingCleanupTracker(); } else if (logs.size() > walCountWarnThreshold) { LOG.warn("procedure WALs count={} above the warning threshold {}. check running procedures" +