From 98dfe3355e7a87f28821b0763fdb5fbe2a3126ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chojnowski?= Date: Tue, 28 Feb 2023 00:00:55 +0100 Subject: [PATCH] memtable: propagate the region to memtable_entry::upgrade_schema() Adds a logalloc::region argument to upgrade_schema(). It's currently unused, but will be further propagated to partition_entry::upgrade() in an upcoming patch. --- replica/memtable.cc | 4 ++-- replica/memtable.hh | 2 +- row_cache.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/replica/memtable.cc b/replica/memtable.cc index e5a3cadcdd..4a6bd5829a 100644 --- a/replica/memtable.cc +++ b/replica/memtable.cc @@ -838,7 +838,7 @@ bool memtable::is_flushed() const noexcept { return bool(_underlying); } -void memtable_entry::upgrade_schema(const schema_ptr& s, mutation_cleaner& cleaner) { +void memtable_entry::upgrade_schema(logalloc::region& r, const schema_ptr& s, mutation_cleaner& cleaner) { if (schema() != s) { partition().upgrade(schema(), s, cleaner, no_cache_tracker); } @@ -848,7 +848,7 @@ void memtable::upgrade_entry(memtable_entry& e) { if (e.schema() != _schema) { assert(!reclaiming_enabled()); with_allocator(allocator(), [this, &e] { - e.upgrade_schema(_schema, cleaner()); + e.upgrade_schema(region(), _schema, cleaner()); }); } } diff --git a/replica/memtable.hh b/replica/memtable.hh index 708fdf5247..e2bb177f01 100644 --- a/replica/memtable.hh +++ b/replica/memtable.hh @@ -68,7 +68,7 @@ public: // Makes the entry conform to given schema. // Must be called under allocating section of the region which owns the entry. - void upgrade_schema(const schema_ptr&, mutation_cleaner&); + void upgrade_schema(logalloc::region&, const schema_ptr&, mutation_cleaner&); size_t external_memory_usage_without_rows() const { return _key.key().external_memory_usage(); diff --git a/row_cache.cc b/row_cache.cc index fcb401f436..fc1a37c443 100644 --- a/row_cache.cc +++ b/row_cache.cc @@ -1026,7 +1026,7 @@ future<> row_cache::update(external_updater eu, replica::memtable& m) { upgrade_entry(entry); assert(entry.schema() == _schema); _tracker.on_partition_merge(); - mem_e.upgrade_schema(_schema, _tracker.memtable_cleaner()); + mem_e.upgrade_schema(_tracker.region(), _schema, _tracker.memtable_cleaner()); return entry.partition().apply_to_incomplete(*_schema, std::move(mem_e.partition()), _tracker.memtable_cleaner(), alloc, _tracker.region(), _tracker, _underlying_phase, acc); } else if (cache_i->continuous() @@ -1038,7 +1038,7 @@ future<> row_cache::update(external_updater eu, replica::memtable& m) { partition_entry::make_evictable(*_schema, mutation_partition(*_schema))); entry->set_continuous(cache_i->continuous()); _tracker.insert(*entry); - mem_e.upgrade_schema(_schema, _tracker.memtable_cleaner()); + mem_e.upgrade_schema(_tracker.region(), _schema, _tracker.memtable_cleaner()); return entry->partition().apply_to_incomplete(*_schema, std::move(mem_e.partition()), _tracker.memtable_cleaner(), alloc, _tracker.region(), _tracker, _underlying_phase, acc); } else {