From 1e78d43a8c6e7b906bda61f09f3f7016326ff3b4 Mon Sep 17 00:00:00 2001 From: Qi Xu Date: Wed, 13 Mar 2024 20:17:29 -0700 Subject: [PATCH] add log for the first write Signed-off-by: Qi Xu --- db/db_impl/db_impl_write.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/db_impl/db_impl_write.cc b/db/db_impl/db_impl_write.cc index bfa21411850..8ccb9ddb40c 100644 --- a/db/db_impl/db_impl_write.cc +++ b/db/db_impl/db_impl_write.cc @@ -1434,7 +1434,11 @@ IOStatus DBImpl::WriteToWAL(const WriteBatch& merged_batch, uint64_t* log_size, LogFileNumberSize& log_file_number_size) { assert(log_size != nullptr); - + if (log_writer->file()->GetFileSize() == 0) { + ROCKS_LOG_INFO(immutable_db_options_.info_log, + "Start writing to WAL: [%" PRIu64 "]", + log_writer->get_log_number()); + } Slice log_entry = WriteBatchInternal::Contents(&merged_batch); *log_size = log_entry.size(); // When two_write_queues_ WriteToWAL has to be protected from concurretn calls