File tree 1 file changed +13
-2
lines changed 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -927,13 +927,24 @@ void Agent::lastAckedAgo(Builder& ret) const {
927
927
VPackObjectBuilder b (&ret);
928
928
for (auto const & i : lastAcked) {
929
929
auto lsit = lastSent.find (i.first );
930
+ // Note that it is possible that a server is already in lastAcked
931
+ // but not yet in lastSent, since lastSent only has times of non-empty
932
+ // appendEntriesRPC calls, but we also get lastAcked entries for the
933
+ // empty ones.
930
934
ret.add (VPackValue (i.first ));
931
935
{ VPackObjectBuilder o (&ret);
932
936
ret.add (" lastAckedTime" , VPackValue (dur2str (i)));
933
937
ret.add (" lastAckedIndex" , VPackValue (confirmed.at (i.first )));
934
938
if (i.first != id ()) {
935
- ret.add (" lastAppend" , VPackValue (dur2str (*lsit)));
936
- }}
939
+ if (lsit != lastSent.end ()) {
940
+ ret.add (" lastAppend" , VPackValue (dur2str (*lsit)));
941
+ } else {
942
+ ret.add (" lastAppend" , VPackValue (dur2str (i)));
943
+ // This is just for the above mentioned case, which will very
944
+ // soon be rectified.
945
+ }
946
+ }
947
+ }
937
948
}
938
949
}
939
950
You can’t perform that action at this time.
0 commit comments