Handle start times before the start of a log file
We have seen log files where the start time is before any data after a
node reboots. The side effect of this is that we try to call the
startup callback at the start time, but we only officially reboot at the
first message, so we can't actually start at the start time. The world
then explodes.
Add a test reproducing it, and then fix it.
Change-Id: I7de986a6f7df0d050a0c8164827d27c799221fbf
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/log_reader.cc b/aos/events/logging/log_reader.cc
index d8f8b04..35ef498 100644
--- a/aos/events/logging/log_reader.cc
+++ b/aos/events/logging/log_reader.cc
@@ -724,7 +724,16 @@
state->monotonic_remote_now(timestamped_message.channel_index);
if (!FLAGS_skip_order_validation) {
CHECK_EQ(timestamped_message.monotonic_remote_time.boot,
- monotonic_remote_now.boot);
+ monotonic_remote_now.boot)
+ << state->event_loop()->node()->name()->string_view() << " to "
+ << state->remote_node(timestamped_message.channel_index)
+ ->name()
+ ->string_view()
+ << " while trying to send a message on "
+ << configuration::CleanedChannelToString(
+ logged_configuration()->channels()->Get(
+ timestamped_message.channel_index))
+ << " " << timestamped_message << " " << state->DebugString();
CHECK_LE(timestamped_message.monotonic_remote_time,
monotonic_remote_now)
<< state->event_loop()->node()->name()->string_view() << " to "