Skip to content

Commit 9ee278b

Browse files
author
Taichi Yamakawa
committed
Prioritize the warn log over the info log
1 parent 872e4e4 commit 9ee278b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/scala/lerna/akka/entityreplication/raft/RaftActor.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,7 @@ private[raft] class RaftActor(
466466
) {
467467
val estimatedCompactedLogSize: Int =
468468
currentData.estimatedReplicatedLogSizeAfterCompaction(settings.compactionPreserveLogSize)
469-
if (snapshotSynchronizationIsInProgress) {
470-
// Snapshot updates during synchronizing snapshot will break consistency
471-
if (log.isInfoEnabled)
472-
log.info("Skipping compaction because snapshot synchronization is in progress")
473-
} else if (estimatedCompactedLogSize >= settings.compactionLogSizeThreshold) {
469+
if (estimatedCompactedLogSize >= settings.compactionLogSizeThreshold) {
474470
if (log.isWarningEnabled) {
475471
log.warning(
476472
"[{}] Skipping compaction since compaction might not delete enough entries " +
@@ -484,6 +480,10 @@ private[raft] class RaftActor(
484480
currentData.eventSourcingIndex,
485481
)
486482
}
483+
} else if (snapshotSynchronizationIsInProgress) {
484+
// Snapshot updates during synchronizing snapshot will break consistency
485+
if (log.isInfoEnabled)
486+
log.info("Skipping compaction because snapshot synchronization is in progress")
487487
} else {
488488
val (term, logEntryIndex, entityIds) = currentData.resolveSnapshotTargets()
489489
applyDomainEvent(SnapshottingStarted(term, logEntryIndex, entityIds)) { _ =>

0 commit comments

Comments
 (0)