fixed metadata regen + indexes, it is working
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 1 Sep 2017 19:29:49 +0000 (15:29 -0400)
committerJulien Desfossez <jdesfossez@efficios.com>
Wed, 6 Sep 2017 17:59:58 +0000 (13:59 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/rotate.c
src/common/consumer/consumer.c

index fa5cd344a14cb827284b0eb0d955fd704999b519..6a536d36d9fcc03f64b855a515875871f7dbb85b 100644 (file)
@@ -2222,6 +2222,7 @@ static int relay_rotate_session_stream(struct lttcomm_relayd_hdr *recv_hdr,
                ERR("Rotating stream output file");
                goto end_stream_unlock;
        }
+       stream->tracefile_size_current = 0;
 
        /* Rotate also the index if the stream is not a metadata stream. */
        if (!stream->is_metadata) {
index dd0b8834354c88c60569a94cca977e4471aa6fc2..98207f00aae9ca0f00bee52513eb833f5280cff6 100644 (file)
@@ -168,8 +168,6 @@ int rename_first_chunk(struct ltt_session *session,
        /* New domain path: <session>/<start-date>-<end-date>-<rotate-count>/kernel */
        snprintf(tmppath2, PATH_MAX, "%s/%s",
                        new_path, consumer->subdir);
-       fprintf(stderr, "A: %s, B: %s, C: %s\n",
-                       consumer->dst.net.base_dir, consumer->subdir, new_path);
        /*
         * Move the per-domain folder inside the first rotation
         * folder.
index e2f3568b3f3b9e99551ee06f700352444220d026..d22f947e13df5e87e90ff2fd82b381295abd3e38 100644 (file)
@@ -4134,31 +4134,6 @@ int rotate_local_stream(struct lttng_consumer_local_data *ctx,
                }
                stream->index_file = index_file;
                stream->out_fd_offset = 0;
-       } else {
-               switch (consumer_data.type) {
-               case LTTNG_CONSUMER_KERNEL:
-                       /*
-                        * Reset the position of what has been read from the metadata
-                        * cache to 0 so we can dump it again.
-                        */
-                       ret = kernctl_metadata_cache_dump(stream->wait_fd);
-                       if (ret < 0) {
-                               ERR("Failed to dump the kernel metadata cache after rotation");
-                               goto error;
-                       }
-                       break;
-               case LTTNG_CONSUMER32_UST:
-               case LTTNG_CONSUMER64_UST:
-                       /*
-                        * Reset the position pushed from the metadata cache so it
-                        * will write from the beginning on the next push.
-                        */
-                       stream->ust_metadata_pushed = 0;
-                       break;
-               default:
-                       ERR("Unknown consumer_data type");
-                       abort();
-               }
        }
 
        ret = 0;
@@ -4210,8 +4185,41 @@ int lttng_consumer_rotate_stream(struct lttng_consumer_local_data *ctx,
        } else {
                ret = rotate_local_stream(ctx, stream);
        }
+       if (ret < 0) {
+               goto error;
+       }
+
+       if (stream->metadata_flag) {
+               switch (consumer_data.type) {
+               case LTTNG_CONSUMER_KERNEL:
+                       /*
+                        * Reset the position of what has been read from the metadata
+                        * cache to 0 so we can dump it again.
+                        */
+                       ret = kernctl_metadata_cache_dump(stream->wait_fd);
+                       if (ret < 0) {
+                               ERR("Failed to dump the kernel metadata cache after rotation");
+                               goto error;
+                       }
+                       break;
+               case LTTNG_CONSUMER32_UST:
+               case LTTNG_CONSUMER64_UST:
+                       /*
+                        * Reset the position pushed from the metadata cache so it
+                        * will write from the beginning on the next push.
+                        */
+                       stream->ust_metadata_pushed = 0;
+                       break;
+               default:
+                       ERR("Unknown consumer_data type");
+                       abort();
+               }
+       }
        lttng_consumer_reset_stream_rotate_state(stream);
 
+       ret = 0;
+
+error:
        return ret;
 }
 
This page took 0.030183 seconds and 5 git commands to generate.