lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: "Jérémie Galarneau via lttng-dev" <lttng-dev@lists.lttng.org>
To: Subrata Paul <subrata.turs@gmail.com>
Cc: lttng-dev <lttng-dev@lists.lttng.org>
Subject: Re: [lttng-dev] Running trace-rotate and session-rotate together
Date: Wed, 5 Jan 2022 12:05:52 -0500 (EST)	[thread overview]
Message-ID: <2050940547.2707.1641402352283.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <CABAcCUNcS1yaP7-mLijXmecOczr9vQkOukhW4Q-YgKc6Vz-bZw@mail.gmail.com>



----- Message original -----
> De: "lttng-dev" <lttng-dev@lists.lttng.org>
> À: "lttng-dev" <lttng-dev@lists.lttng.org>
> Envoyé: Mardi 21 Décembre 2021 01:47:12
> Objet: [lttng-dev] Running trace-rotate and session-rotate together

> Hi,
> 1. In the lttng-enable-rotation manpage it is mentioned that we should not use
> trace rotate when automatic session rotate is enabled. Can you please tell me
> why?
> ```
> Important
> You may only use the enable-rotation command when:
> * The selected recording session was created in normal mode or in network
> streaming mode
> (see lttng-create(1)).
> * No channel was created with a configured trace file count or size limit (see
> the
> --tracefile-size and --tracefile-count options of the lttng-enable-channel(1)
> command).
> ```

Hi, 

The reason mostly boils down to the fact that we didn't see a use case for this. Hence, it's not implemented nor tested. 

Let me know if you have a use case for combining both features, though.

> 2. When automatic session rotate is running, is there any race condition in
> writing the current ring buffers and archiving the current trace chunk?

I am not sure I understand your question, but I think you're asking if session rotations are "atomic" with respect to the switchover of all per-CPU streams from one trace archive to the next?

The switchover is not instantaneous. The file output of each per-CPU stream is switched to the new trace archive sequentially. That leaves you with a window of time during which information, for a given stream, may be found in either the old trace archive or the new one. To be clear, no information is ever duplicated or lost during this operation. 

I briefly touched on this topic in a presentation at the Open Source Summit 2018, see slide 32+[1]

The various colours represent successive trace archives produced by session rotations.

This transition window makes writing analyses a bit harder since the beginning and end of trace archives may not have all of the information for all per-CPU streams during a short window of time. That window is contained between issuing the rotation and receiving a confirmation that it has been completed (using the CLI or the liblttng-ctl API). 

You can see that in that context, I chose to process trace archives in pairs to constitute an "effective trace archive" (slide 34) during which I can be sure I always have access to all events from all per-CPU streams.

Thanks,
Jérémie

[1] https://events19.linuxfoundation.org/wp-content/uploads/2017/12/Fine-grained-Distributed-Application-Monitoring-Using-LTTng-J%C3%A9r%C3%A9mie-Galarneau-EfficiOS.pdf

> --------------------------------------------------------------
> Regards,
> Subrata Paul

> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

      reply	other threads:[~2022-01-05 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21  6:47 [lttng-dev] Running trace-rotate and session-rotate together Subrata Paul via lttng-dev
2022-01-05 17:05 ` Jérémie Galarneau via lttng-dev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2050940547.2707.1641402352283.JavaMail.zimbra@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=jeremie.galarneau@efficios.com \
    --cc=subrata.turs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).