}
void on_data_commit() final {
- auto &prior = static_cast<this_type_t&>(*this->get_prior_instance());
- if (this->is_mutation_pending()) {
- prior.delta_buffer = std::move(delta_buffer);
- }
- prior.set_layout_buf(prior.get_bptr().c_str());
+ this->set_layout_buf(this->get_bptr().c_str());
}
void on_invalidated(Transaction &t) final {
}
void on_data_commit() final {
- auto &prior = static_cast<this_type_t&>(*this->get_prior_instance());
- if (this->is_mutation_pending()) {
- prior.delta_buffer = std::move(delta_buffer);
- }
- prior.set_layout_buf(prior.get_bptr().c_str());
+ this->set_layout_buf(this->get_bptr().c_str());
}
void sync_layout_buf() {
committer.commit_and_share_paddr();
if (is_lba_backref_node(i->get_type())) {
committer.commit_data();
- committer.share_prior_data_to_pending();
}
touch_extent_fully(prior, &t_src, t.get_cache_hint());
+ committer.sync_version();
committer.unblock_trans(t);
prior.complete_io();
i->committer.reset();
ceph_assert(prior.is_valid());
if (is_lba_backref_node(i->get_type())) {
committer.commit_data();
- committer.share_prior_data_to_pending();
}
+ committer.sync_version();
prior.complete_io();
prior.clear_delta();
i->committer.reset();
void ExtentCommitter::commit_data() {
assert(extent.prior_instance);
// extent and its prior are sharing the same bptr content
- extent.prior_instance->set_bptr(extent.get_bptr());
- extent.on_data_commit();
+ auto &prior = *extent.prior_instance;
+ prior.set_bptr(extent.get_bptr());
+ prior.on_data_commit();
+ _share_prior_data_to_mutations();
+ _share_prior_data_to_pending_versions();
}
void ExtentCommitter::commit_state() {
prior.version = extent.version;
prior.user_hint = extent.user_hint;
prior.rewrite_generation = extent.rewrite_generation;
- prior.last_touch_end = extent.last_touch_end;
- prior.cache_state = extent.cache_state;
prior.state = extent.state;
extent.on_state_commit();
}
}
void ExtentCommitter::_share_prior_data_to_mutations() {
+ LOG_PREFIX(ExtentCommitter::_share_prior_data_to_mutations);
+ ceph_assert(is_lba_backref_node(extent.get_type()));
auto &prior = *extent.prior_instance;
for (auto &mext : prior.mutation_pending_extents) {
auto &mextent = static_cast<CachedExtent&>(mext);
+ TRACE("{} -> {}", extent, mextent);
extent.get_bptr().copy_out(
0, extent.get_length(), mextent.get_bptr().c_str());
+ mextent.on_data_commit();
mextent.reapply_delta();
}
}
void ExtentCommitter::_share_prior_data_to_pending_versions()
{
+ ceph_assert(is_lba_backref_node(extent.get_type()));
auto &prior = *extent.prior_instance;
switch (extent.get_type()) {
case extent_types_t::LADDR_LEAF:
void sync_version();
- void share_prior_data_to_pending() {
- _share_prior_data_to_mutations();
- _share_prior_data_to_pending_versions();
- }
-
void commit_and_share_paddr();
private:
coll_map_t decoded;
delta_buffer_t delta_buffer;
- void do_on_state_commit() final {
- auto &prior = static_cast<CollectionNode&>(*get_prior_instance());
- prior.delta_buffer = std::move(delta_buffer);
- prior.decoded = std::move(decoded);
- }
-
CachedExtentRef duplicate_for_write(Transaction&) final {
assert(delta_buffer.empty());
return CachedExtentRef(new CollectionNode(*this));
do_on_replace_prior(t);
}
virtual void do_on_replace_prior(Transaction &t) {}
+ void on_data_commit() final {
+ ceph_abort("impossible");
+ }
};
using LogicalChildNodeRef = TCachedExtentRef<LogicalChildNode>;
} // namespace crimson::os::seastore
std::pair<bool, bool> pre_stable_extent_paddr_mod(
read_set_item_t<Transaction> &item)
{
- LOG_PREFIX(Transaction::sync_extent_state);
+ LOG_PREFIX(Transaction::pre_stable_extent_paddr_mod);
SUBTRACET(seastore_t, "{}", *this, *item.ref);
#ifndef NDEBUG
auto [existed, it] = lookup_trans_from_read_extent(item.ref);