&child_node);
}
if (ret == Transaction::get_extent_ret::PRESENT) {
- if (child_node->is_stable()) {
+ if (child_node->is_stable_written()) {
assert(child_node->is_valid());
auto cnode = child_node->template cast<child_node_t>();
assert(cnode->has_parent_tracker());
}
// children are considered stable if any of the following case is true:
- // 1. Not in memory
- // 2. being stable
- // 3. being mutation pending and under-io
+ // 1. The child extent is absent in cache
+ // 2. The child extent is stable
bool is_child_stable(uint16_t pos) const final {
auto child = this->children[pos];
if (is_valid_child_ptr(child)) {
ceph_assert(child->is_logical());
- return child->is_stable() ||
- (child->is_mutation_pending() &&
- child->is_pending_io());
+ return child->is_stable();
} else if (this->is_pending()) {
auto key = this->iter_idx(pos).get_key();
auto &sparent = this->get_stable_for_key(key);
auto child = sparent.children[spos];
if (is_valid_child_ptr(child)) {
ceph_assert(child->is_logical());
- return child->is_stable() ||
- (child->is_mutation_pending() &&
- child->is_pending_io());
+ return child->is_stable();
} else {
return true;
}
return is_mutable() || state == extent_state_t::EXIST_CLEAN;
}
- /// Returns true if extent is stable and shared among transactions
- bool is_stable() const {
+ /// Returns true if extent is stable, written and shared among transactions
+ bool is_stable_written() const {
return state == extent_state_t::CLEAN_PENDING ||
state == extent_state_t::CLEAN ||
state == extent_state_t::DIRTY;
}
+ /// Returns true if extent is stable and shared among transactions
+ bool is_stable() const {
+ return is_stable_written() ||
+ (is_mutation_pending() &&
+ is_pending_io());
+ }
+
/// Returns true if extent has a pending delta
bool is_mutation_pending() const {
return state == extent_state_t::MUTATION_PENDING;
test_mappings.alloced(pin->get_key(), *extent, t.mapping_delta);
EXPECT_TRUE(extent->is_exist_clean());
} else {
- EXPECT_TRUE(extent->is_stable());
+ EXPECT_TRUE(extent->is_stable_written());
}
} else {
ceph_assert(t.t->is_conflicted());