Rotate log files when the remote reboots
Add a logger_boot_uuid to track the difference between the logger node's
and the remote node's boot uuids, and also a logger start time. This
gives us enough information to enforce only 1 boot per node, and to also
detect which log came first if a node rebooted. Order detection isn't
used today, but before we generate more logs, we should fix the issue.
Also, enforce one boot per node when replaying. We don't manage
timestamps well enough to do anything else.
Change-Id: Ib5ba9f881a2c17d05b143e38ee20a209553acca8
diff --git a/aos/events/logging/logfile_utils.h b/aos/events/logging/logfile_utils.h
index fd600d3..61f16aa 100644
--- a/aos/events/logging/logfile_utils.h
+++ b/aos/events/logging/logfile_utils.h
@@ -314,6 +314,15 @@
bool done_ = false;
MessageReader message_reader_;
+ // True after we have seen a message after the start of the log. The
+ // guarentees on logging essentially are that all data from before the
+ // starting time of the log may be arbitrarily out of order, but once we get
+ // max_out_of_order_duration past the start, everything will remain within
+ // max_out_of_order_duration. We shouldn't see anything before the start
+ // after we've seen a message that is at least max_out_of_order_duration after
+ // the start.
+ bool after_start_ = false;
+
monotonic_clock::time_point newest_timestamp_ = monotonic_clock::min_time;
};