Fix: sessiond: size-based rotations never trigger
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Jun 2022 20:53:53 +0000 (16:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Jun 2022 04:45:24 +0000 (00:45 -0400)
commitf4d2c26adb8b6d18a62ca6d35e3a0529ff8a87b5
tree3ecc21ed6c2f192641caa68055dfa83e3c6a3f6b
parentcc22de985fbd6c192a021063fc3be165dd6fa5c0
Fix: sessiond: size-based rotations never trigger

Issue observed
==============

Size-based scheduled rotations have no effect.

Cause
=====

Since c08136a3f, the rotation thread's handle_condition() checks that
the notification received matches the trigger that was registered.

As part of the equality check, the triggers' credentials are compared.

This checks fails systematically since the group id of a trigger's
credentials is not transported by the serialize/create_from functions.
The trigger that is received through the notification thus has an unset
group id, while the rotation trigger of the `ltt_session` has a group id
set; it was not stripped by the communication layer.

The check also fails since the trigger registered for the size-based
rotation is "hidden". This internal attribute is not propagated through
the communication layer, which causes the comparison to fail.

Solution
========

Since triggers only use the 'uid' part of lttng_credentials, we ensure
that lttng_trigger_set_credentials only sets this part of the structure.

Also, the `is_hidden` attribute of a trigger is now propagated through
the communication layer. This has no effect for external applications
since this attribute is not exposed through the API. However, it is
useful for internal triggers which use the same communication
facilities.

This allows the equality check in rotation-thread.cpp to go through as
expected.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I216f5cb9297ecd1a867dc292c10b8da595efce34
include/lttng/trigger/trigger-internal.hpp
src/common/trigger.cpp
This page took 0.025417 seconds and 4 git commands to generate.