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>
Fri, 12 Oct 2018 23:59:43 +0000 (19:59 -0400)
commitcb523e0290a439cf57fa7823ffa78803500ba4c3
tree5b6937406c735bbdc7a5d7f4bd55d7100da538cb
parent116ffe568c1f1caec896970a2db2a2e30400747b
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.026613 seconds and 5 git commands to generate.