fd-tracker: restore suspended handles from their inode's path
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Jan 2020 04:53:49 +0000 (23:53 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Jan 2020 06:55:34 +0000 (01:55 -0500)
commitf7c3ffd79ddcece895eb0de616001d549aced5fc
tree58e2d43cb77b95534d0350186a510c7fef38f83e
parent9a1a997f2f22b556f63437d911b98c7b522b38e4
fd-tracker: restore suspended handles from their inode's path

In order to support session rotations and, to a lesser degree, the
"clear" command, the fd-tracker internals (lttng_inode and fs_handle)
need to recover from files being renamed while the handle to it is
suspended.

This refactor introduces a "location" to the lttng_inode which is
updated anytime an unlink or rename is performed on an fs_handle.
Keep in mind that multiple independent fs_handles can refer to the
same lttng_inode (a unique tuple of device id and inode number).

This location is used to restore the fs_handle whenever it is needed.

Moreover, since the session rotation/clear operations sometimes rely
on directories having been emptied after rename/unlink, the current
scheme of renaming unlinked files to the form
"filename-deleted-suffix" no longer works.

The renaming scheme is replaced by a new "unlinked file pool", which
is an hidden directory at the base of the output directory which
contains the files which were unlinked to which
references (fs_handles) are still being held. The API of the
fd-tracker itself had to be changed slightly and the tests are adapted
as a consequence. New tests targeting this new behaviour are also
added.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9b1344da1966c85bdd6b51838507d3208e1d9a42
src/bin/lttng-relayd/main.c
src/common/defaults.h
src/common/fd-tracker/fd-tracker.c
src/common/fd-tracker/fd-tracker.h
src/common/fd-tracker/inode.c
src/common/fd-tracker/inode.h
tests/unit/test_fd_tracker.c
This page took 0.035184 seconds and 4 git commands to generate.