Add/clean up some CHECKs in LogReader.
Specifically:
- If we reach a point where we have a multi-node config but
none of the nodes have logs to replay, immediately crash.
- Correctly compare the logged_configuration to the replay
configuration for checking node list length, rather than
comparing the replay configuration to itself.
Change-Id: Ibd2da62cacab45153361cafb746102c42711f0d5
diff --git a/aos/events/logging/logger.h b/aos/events/logging/logger.h
index 34dbd24..ce21598 100644
--- a/aos/events/logging/logger.h
+++ b/aos/events/logging/logger.h
@@ -424,6 +424,8 @@
// Returns the offset from the monotonic clock for a node to the distributed
// clock. distributed = monotonic + offset;
std::chrono::nanoseconds offset(int node_index) const {
+ CHECK_LT(node_index, offset_matrix_.rows())
+ << ": Got too high of a node index.";
return -std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::duration<double>(offset_matrix_(node_index))) -
base_offset_matrix_(node_index);