- if (dataSizeThresholdExceeded || logSizeExceededSnapshotBatchCount) {
- if(LOG.isDebugEnabled()) {
- if(dataSizeThresholdExceeded) {
- LOG.debug("{}: log data size {} exceeds the memory threshold {} - doing snapshotPreCommit with index {}",
- context.getId(), context.getReplicatedLog().dataSize(), dataThreshold,
+ if (dataSizeThresholdExceeded || logSizeExceededSnapshotBatchCount || captureSnapshot.isMandatoryTrim()) {
+ if (log.isDebugEnabled()) {
+ if (dataSizeThresholdExceeded) {
+ log.debug("{}: log data size {} exceeds the memory threshold {} - doing snapshotPreCommit "
+ + "with index {}", context.getId(), context.getReplicatedLog().dataSize(),
+ dataThreshold, captureSnapshot.getLastAppliedIndex());
+ } else if (logSizeExceededSnapshotBatchCount) {
+ log.debug("{}: log size {} exceeds the snapshot batch count {} - doing snapshotPreCommit with "
+ + "index {}", context.getId(), context.getReplicatedLog().size(),
+ context.getConfigParams().getSnapshotBatchCount(),