Fix: relayd: tracefile rotation: viewer opening missing index file
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Nov 2019 20:23:03 +0000 (16:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 6 Nov 2019 19:35:10 +0000 (14:35 -0500)
commit78118e3bdace1208479db18df6553ab9c4400426
tree90cf2e74538eace61f619b01126d5560d25e18e2
parent3c3c793599c40378d96b2fa135c748352c775606
Fix: relayd: tracefile rotation: viewer opening missing index file

Moving the head position of the tracefile array when the data is
received opens a window where a viewer attaching to the session could
try to open a missing index file (which has not been received yet).

However, we want to bump the tail position as soon as we receive
data, because the prior tail is not valid anymore.

Solve this by introducing two head positions: the "read" head
and the "write" head. The "write" head is the position of the
newest data file (equivalent to the prior "head" position). We
also introduce a "read" head position, which is only moved
forward when the index is received.

The viewer now uses the "read" head position as upper bound, which
ensures it never attempts to open a non-existing index file.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/stream.c
src/bin/lttng-relayd/tracefile-array.c
src/bin/lttng-relayd/tracefile-array.h
src/bin/lttng-relayd/viewer-stream.c
This page took 0.033948 seconds and 4 git commands to generate.