Fix relayd: stream index file created in the wrong directory
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Oct 2018 23:49:42 +0000 (19:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Oct 2018 10:09:50 +0000 (11:09 +0100)
commit2bf5b194b531f00cb4ddf58e83df0daa30530b54
tree0b19918b2e23dd79919418254bb945a0fa7924aa
parentc67737f1e9dfa035efde2fc029a495682c7f9a73
Fix relayd: stream index file created in the wrong directory

This fix addresses an issue that can cause a stream's index
file to be created in the wrong trace archive chunk's
directory.

The data connection creates a stream's first index file.

This can happen _after_ a ROTATE_STREAM command. More specifically,
the data of the first packet of a stream can be received after a
ROTATE_STREAM command.

The ROTATE_STREAM command changes the streams path_name to point to
the "next" chunk. If a rotation is pending for a stream, as
indicated by "rotate_at_seq_num != -1ULL", it means that we are still
receiving data that belongs in the stream's former path.

In fact, we may have never received any data for this stream at this
point.

In this specific case, we must ensure that the index file is created
in the streams's former path, "prev_path_name", on reception of the
first packet's data on the data connection.

All other rotations beyond the first one are not affected by this
problem since the actual rotation operation creates the new chunk's
index file.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/stream.c
src/bin/lttng-relayd/stream.h
src/common/index/index.c
src/common/index/index.h
This page took 0.026321 seconds and 4 git commands to generate.