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.
This commit is contained in:
Michał Chojnowski
2023-02-28 00:00:55 +01:00
parent effd1fe70f
commit 98dfe3355e
3 changed files with 5 additions and 5 deletions

View File

@@ -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());
});
}
}

View File

@@ -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();

View File

@@ -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 {