From 5196d450bd81a1973f4de23fc2d554bc3ed5d505 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Fri, 8 Oct 2021 00:14:55 +0200 Subject: [PATCH] row_cache: Improve trace-level logging Print MVCC snapshot to help distinguish reads which use different snapshots. Also, print the whole cursor, not just its position. This helps in determining which MVCC version the iterator comes from. --- cache_flat_mutation_reader.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cache_flat_mutation_reader.hh b/cache_flat_mutation_reader.hh index 771269d06c..ac5ddf65f4 100644 --- a/cache_flat_mutation_reader.hh +++ b/cache_flat_mutation_reader.hh @@ -202,7 +202,8 @@ public: , _read_context(ctx) // ctx is owned by the caller, who's responsible for closing it. , _next_row(*_schema, *_snp, false, _read_context.is_reversed()) { - clogger.trace("csm {}: table={}.{}, reversed={}", fmt::ptr(this), _schema->ks_name(), _schema->cf_name(), _read_context.is_reversed()); + clogger.trace("csm {}: table={}.{}, reversed={}, snap={}", fmt::ptr(this), _schema->ks_name(), _schema->cf_name(), _read_context.is_reversed(), + fmt::ptr(&*_snp)); push_mutation_fragment(*_schema, _permit, partition_start(std::move(dk), _snp->partition_tombstone())); } cache_flat_mutation_reader(schema_ptr s, @@ -356,7 +357,7 @@ future<> cache_flat_mutation_reader::do_fill_buffer() { } } _next_row.maybe_refresh(); - clogger.trace("csm {}: next={}, cont={}", fmt::ptr(this), _next_row.position(), _next_row.continuous()); + clogger.trace("csm {}: next={}", fmt::ptr(this), _next_row); _lower_bound_changed = false; while (_state == state::reading_from_cache) { copy_from_cache_to_buffer();