Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Log replicated log dataSize changes
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
AbstractReplicatedLogImpl.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
index 2662d7151c0a51b4b3acf218a0425faf35911833..42af1502ee00ce3a5fe76d47e3be22c1bb769d40 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
@@
-260,12
+260,14
@@
public abstract class AbstractReplicatedLogImpl implements ReplicatedLog {
snapshottedJournal = null;
previousSnapshotIndex = -1;
previousSnapshotTerm = -1;
snapshottedJournal = null;
previousSnapshotIndex = -1;
previousSnapshotTerm = -1;
- dataSize = 0;
+
// need to recalc the datasize based on the entries left after precommit.
// need to recalc the datasize based on the entries left after precommit.
+ int newDataSize = 0;
for (ReplicatedLogEntry logEntry : journal) {
for (ReplicatedLogEntry logEntry : journal) {
-
d
ataSize += logEntry.size();
+
newD
ataSize += logEntry.size();
}
}
-
+ LOG.trace("{}: Updated dataSize from {} to {}", logContext, dataSize, newDataSize);
+ dataSize = newDataSize;
}
@Override
}
@Override