Rotate command
authorJulien Desfossez <jdesfossez@efficios.com>
Mon, 18 Dec 2017 19:45:56 +0000 (14:45 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 21 Mar 2018 15:25:11 +0000 (11:25 -0400)
commit5c408ad8ef08a226c018702aca969536f36ac4e5
tree690e9e13199eb33ea98d26ed3ad639353b684b96
parentd086f507d02078aed618ab291a0bc4a634958fa3
Rotate command

This is the core of the session rotation command in the session daemon,
no client interface for now. For each channel in the session, we send a
request to the related consumer to rotate the channel and add that
channel key and domain in the channel_pending_rotate_ht HT. When the
consumer has finished the rotation of all the streams in the channel, it
sends back a notification. The rotation thread in the session daemon
looks up the channel information in the HT and finds the corresponding
session. When all channels of a session have finished, the rotation
thread asks the consumer to rename the chunk folder to append the
timestamp of the end of the rotation.

On the first rotation, we have an extra step to change the session
directory layout from "<session-name>/<domain>" to
"<session-name>/<session-start-time>-<rotate-end-time>-1/<domain>".

When the rotation starts, the new chunk folder is created immediately
in: "<session-name>/<previous-rotate-start-time>-2/<domain>" so we won't
have to move the domain folder(s) after the next rotate has finished,
just rename the chunk folder.

The "mkdir" and "rename" commands are all propagated to the relay if
needed, only the rotate_pending check on the relay is not part of this
patch.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
20 files changed:
include/lttng/lttng-error.h
include/lttng/rotate-internal.h [new file with mode: 0644]
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/cmd.h
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/consumer.h
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/kernel.h
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/rotate.c
src/bin/lttng-sessiond/rotate.h
src/bin/lttng-sessiond/rotation-thread.c
src/bin/lttng-sessiond/session.c
src/bin/lttng-sessiond/session.h
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-app.h
src/common/consumer/consumer.h
src/common/error.c
src/common/sessiond-comm/sessiond-comm.h
tests/unit/test_ust_data.c
This page took 0.027004 seconds and 4 git commands to generate.