Fix: relayd: live: erroneous message timestamp observed from live viewer
[lttng-tools.git] / src / bin / lttng-relayd / viewer-stream.c
index 00616569ba0b147e7ce63181bcf82e21e84596c1..e49519a705483c4265a3b7d56a9a3b39641204d9 100644 (file)
@@ -302,7 +302,15 @@ void viewer_stream_sync_tracefile_array_tail(struct relay_viewer_stream *vstream
        if (seq_tail == -1ULL) {
                seq_tail = 0;
        }
-       vstream->index_sent_seqcount = seq_tail;
+
+       /*
+        * Move the index sent seqcount forward if it was lagging behind
+        * the new tail of the tracefile array. If the current
+        * index_sent_seqcount is already further than the tracefile
+        * array tail position, keep its current position.
+        */
+       vstream->index_sent_seqcount = seq_tail > vstream->index_sent_seqcount ?
+                       seq_tail : vstream->index_sent_seqcount;
 }
 
 /*
This page took 0.027956 seconds and 4 git commands to generate.