relayd: set has rotated only for explicit rotations
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 12 Dec 2019 17:52:24 +0000 (12:52 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Dec 2019 23:33:32 +0000 (18:33 -0500)
Only set session has_rotated for explicit rotations on the trace chunk
close. This ensures has_rotated can distinguish between clear and
explicit rotate.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I97fac1ac2a6edc233bf1889d693f74f2d7936156
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c

index 749feb6f6f319a95c86d62a68af0b5f693a7c4d3..5e99befa7c5c775ef888a4166366abf44a9a3114 100644 (file)
@@ -2372,7 +2372,6 @@ static int relay_rotate_session_streams(
                } else {
                        chunk_id_str = chunk_id_buf;
                }
-               session->has_rotated = true;
        }
 
        DBG("Rotate %" PRIu32 " streams of session \"%s\" to chunk \"%s\"",
@@ -2803,6 +2802,10 @@ static int relay_close_trace_chunk(const struct lttcomm_relayd_hdr *recv_hdr,
                        goto end_unlock_session;
                }
        }
+       if (close_command.is_set &&
+                       close_command.value == LTTNG_TRACE_CHUNK_COMMAND_TYPE_MOVE_TO_COMPLETED) {
+               session->has_rotated = true;
+       }
        DBG("Reply chunk path on close: %s", closed_trace_chunk_path);
        path_length = strlen(closed_trace_chunk_path) + 1;
        if (path_length > UINT32_MAX) {
This page took 0.026166 seconds and 4 git commands to generate.