From 813b00a1a643bb6592b8c1873da3fe01815675a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Mon, 4 Mar 2019 10:03:00 +0000 Subject: [PATCH] commitlog: provide more information in logs This commits adds some more information to the logs. Motivated, by experiences with investigating #4231. * size of each write * position of each write * log message for final write --- db/commitlog/commitlog.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/commitlog/commitlog.cc b/db/commitlog/commitlog.cc index 90fbf418b7..13fc4c6534 100644 --- a/db/commitlog/commitlog.cc +++ b/db/commitlog/commitlog.cc @@ -736,6 +736,7 @@ public: _segment_manager->totals.total_size_on_disk += bytes; ++_segment_manager->totals.cycle_count; if (bytes == view.size_bytes()) { + clogger.debug("Final write of {} to {}: {}/{} bytes at {}", bytes, *this, size, size, off); return make_ready_future(stop_iteration::yes); } // gah, partial write. should always get here with dma chunk sized @@ -743,7 +744,7 @@ public: bytes = align_down(bytes, alignment); off += bytes; view.remove_prefix(bytes); - clogger.debug("Partial write {}: {}/{} bytes", *this, size - view.size_bytes(), size); + clogger.debug("Partial write of {} to {}: {}/{} bytes at at {}", bytes, *this, size - view.size_bytes(), size, off - bytes); return make_ready_future(stop_iteration::no); // TODO: retry/ignore/fail/stop - optional behaviour in origin. // we fast-fail the whole commit.