From 2ee88fe7cf988e33e9903505e649075947c99acf Mon Sep 17 00:00:00 2001 From: Alfonso Subiotto Marques Date: Tue, 21 May 2024 17:35:58 +0200 Subject: [PATCH] table: enhance rotation log messages These log messges were useful when debugging DST failures. --- table.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/table.go b/table.go index ebefc28ffe..f806a607d1 100644 --- a/table.go +++ b/table.go @@ -497,12 +497,12 @@ func (t *Table) dropPendingBlock(block *TableBlock) { } func (t *Table) writeBlock(block *TableBlock, nextTxn uint64, skipPersist, snapshotDB bool) { - level.Debug(t.logger).Log("msg", "syncing block") + level.Debug(t.logger).Log("msg", "syncing block", "ulid", block.ulid, "size", block.index.Size()) block.pendingWritersWg.Wait() // from now on, the block will no longer be modified, we can persist it to disk - level.Debug(t.logger).Log("msg", "done syncing block") + level.Debug(t.logger).Log("msg", "done syncing block", "ulid", block.ulid, "size", block.index.Size()) // Persist the block var err error @@ -614,10 +614,13 @@ func (t *Table) RotateBlock(_ context.Context, block *TableBlock, skipPersist bo return nil } - level.Debug(t.logger).Log("msg", "rotating block", "blockSize", block.Size(), "skipPersist", skipPersist) - defer func() { - level.Debug(t.logger).Log("msg", "done rotating block") - }() + level.Debug(t.logger).Log( + "msg", "rotating block", + "ulid", block.ulid, + "size", block.Size(), + "skip_persist", skipPersist, + ) + defer level.Debug(t.logger).Log("msg", "done rotating block", "ulid", block.ulid) tx, _, commit := t.db.begin() defer commit()