Initialize relay_stream chunk_id to its session's current trace archive id
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 10 May 2018 21:14:39 +0000 (17:14 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 5 Jun 2018 16:29:53 +0000 (12:29 -0400)
commit81164b6b222b4bafe1e3cec57c50429ab6dab30f
treea26150e646248c13c1c814d3d19060af9f88e4e2
parent0b50e4b3fb9859af7072adcca784684834e5f8d1
Initialize relay_stream chunk_id to its session's current trace archive id

Initializing the relayd's streams with a stream_chunk_id allows the
relayd to differentiate between a stream created before the first
rotation (at chunk id == 0) vs. a stream that has been created
after the last (or pending) rotation.

Before this fix, the relayd can fail to identify that a rotation
has been completed.

This is caused by the fact that a stream's chunk id is initialized
to 0 and updated by the RELAYD_ROTATE_STREAM command to the
id of the chunk that is currently being rotated.

The 'stream->current_chunk_id.value < chunk_id' check performed
by the RELAYD_ROTATE_PENDING will cause rotations to never
complete for streams that are created between the launch of a
rotation and the check for its completion.

For example, when the relayd is checking whether the rotation id
'3' is completed, it may see streams with the default value of
their chunk id set to '0' and determine that a rotation is still
pending.

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
This page took 0.025492 seconds and 4 git commands to generate.