Fix: trace chunk reported unknown before close command execution
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 30 Sep 2019 19:57:33 +0000 (15:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Oct 2019 18:25:53 +0000 (14:25 -0400)
commit95245d44f4c3d2f062d3c348710b605002168446
tree6dcf157827a5f2eb07dc3207c696b2203dfececa
parent13f8fa24410b634589c1d3c41e27d75e3f97c68a
Fix: trace chunk reported unknown before close command execution

The check for the existence of a trace chunk is done by using the
regular 'find' operations on a trace chunk registry in both the relay
and consumer daemons.

The 'find' operations attempt to acquire a reference to the trace
chunk being looked-up. On failure to acquire a reference, a trace
chunk is reported as being "unknown". The rotation completion check
uses this mechanism to determine if a trace chunk is still in use.

A close command defers a given operation until a trace chunk is no
longer in use (when its last reference is dropped). Hence, a thread
can attempt to 'find' a trace chunk, fail to acquire a reference, and
fail to see the effects of the close command.

In other words, the thread that has dropped the last reference to
the chunk could still be running the close command of a trace chunk
that is reported to be "unknown" by the consumer and relay daemons.

To fix this, dedicated "chunk_exists" operations are introduced. These
operations do not attempt to acquire a trace chunk. They only look it
up in the registry's internal hash table. As the removal of the trace
chunk from the hash table is performed _after_ the execution of its
close command, it provides a reliable way to ensure that a chunk that
had a close command could complete it before being reported as
"unknown"/no longer in use.

In terms of provided guarantees, this changes the moment at which a
trace chunk is considered to no longer exist from the moment its last
reference was dropped to the moment after the execution of its close
command has completed.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/sessiond-trace-chunks.c
src/bin/lttng-relayd/sessiond-trace-chunks.h
src/common/consumer/consumer.c
src/common/trace-chunk-registry.h
src/common/trace-chunk.c
This page took 0.026023 seconds and 4 git commands to generate.