JournalFileFlags file_flags;
int r;
+ assert(f);
assert(s);
if (!*f)
return -EINVAL;
+ log_debug("Rotating journal file %s.", (*f)->path);
+
file_flags =
(s->compress.enabled ? JOURNAL_COMPRESS : 0)|
(seal ? JOURNAL_SEAL : 0) |
* messages are processed. */
server_full_sync(s, /* wait = */ true);
+ log_debug("Client request to sync journal completed.");
+
/* Let's get rid of the event source now, by marking it as non-floating again. It then has no ref
* anymore and is immediately destroyed after we return from this function, i.e. from this event
* source handler at the end. */
log_info("Received client request to rotate journal, rotating.");
server_full_rotate(s);
+ log_debug("Client request to rotate journal completed.");
return sd_varlink_reply(link, NULL);
}
log_info("Received client request to flush runtime journal.");
server_full_flush(s);
+ log_debug("Client request to flush runtime journal completed.");
return sd_varlink_reply(link, NULL);
}
log_info("Received client request to relinquish %s access.", s->system_storage.path);
server_relinquish_var(s);
+ log_debug("Client request to relinquish %s access completed.", s->system_storage.path);
return sd_varlink_reply(link, NULL);
}
if (f->offline_state == OFFLINE_JOINED)
return 0;
+ log_debug("Joining journal offlining thread for %s.", f->path);
+
r = pthread_join(f->offline_thread, NULL);
if (r)
return -r;
+ log_debug("Journal offlining thread for %s joined.", f->path);
+
f->offline_state = OFFLINE_JOINED;
if (mmap_cache_fd_got_sigbus(f->cache_fd))
#include "format-util.h"
#include "journal-authenticate.h"
#include "journal-file-util.h"
+#include "journal-internal.h"
+#include "log.h"
#include "path-util.h"
#include "random-util.h"
#include "set.h"
target_state = f->archive ? STATE_ARCHIVED : STATE_OFFLINE;
+ log_ratelimit_full(LOG_DEBUG,
+ JOURNAL_LOG_RATELIMIT,
+ "Journal file %s is %s transitioning to %s.",
+ f->path,
+ wait ? "synchronously" : "asynchronously",
+ f->archive ? "archived" : "offline");
+
/* An offlining journal is implicitly online and may modify f->header->state,
* we must also join any potentially lingering offline thread when already in
* the desired offline state.
*/
- if (!journal_file_is_offlining(f) && f->header->state == target_state)
+ if (!journal_file_is_offlining(f) && f->header->state == target_state) {
+ log_ratelimit_full(LOG_DEBUG,
+ JOURNAL_LOG_RATELIMIT,
+ "Journal file %s is already %s, waiting for offlining thread.",
+ f->path,
+ f->archive ? "archived" : "offline");
return journal_file_set_offline_thread_join(f);
+ }
/* Restart an in-flight offline thread and wait if needed, or join a lingering done one. */
restarted = journal_file_set_offline_try_restart(f);
if (restarted)
return 0;
+ log_ratelimit_full(LOG_DEBUG,
+ JOURNAL_LOG_RATELIMIT,
+ "Starting new %s offlining operation for journal file %s.",
+ wait ? "synchronous" : "asynchronous",
+ f->path);
+
/* Initiate a new offline. */
f->offline_state = OFFLINE_SYNCING;