X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fviewer-stream.cpp;h=ca0be9a62d200136972ac6922a692a6bb5917526;hb=7fb6d478a17b87805813b9409cb89903e55018ff;hp=7a66fde5bd6b8bf54d540a8aa0762e47ee9017bd;hpb=fb2772932d3207bd9d340f34f41d822d9c0ff0a9;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/viewer-stream.cpp b/src/bin/lttng-relayd/viewer-stream.cpp index 7a66fde5b..ca0be9a62 100644 --- a/src/bin/lttng-relayd/viewer-stream.cpp +++ b/src/bin/lttng-relayd/viewer-stream.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "lttng-relayd.h" #include "viewer-stream.h" @@ -302,7 +303,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 = + std::max(seq_tail, vstream->index_sent_seqcount); } /*