mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
Merge pull request #41801 from liu-chunmei/seastore-fix-get-retired-extent
crimson/seastore: fix cache::get_extent got retired extent Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
commit
c323e59930
@ -123,7 +123,7 @@ void Cache::retire_extent(CachedExtentRef ref)
|
||||
remove_from_dirty(ref);
|
||||
ref->dirty_from_or_retired_at = JOURNAL_SEQ_MAX;
|
||||
retired_extent_gate.add_extent(*ref);
|
||||
ref->state = CachedExtent::extent_state_t::RETIRED;
|
||||
ref->state = CachedExtent::extent_state_t::INVALID;
|
||||
}
|
||||
|
||||
void Cache::replace_extent(CachedExtentRef next, CachedExtentRef prev)
|
||||
|
@ -185,8 +185,6 @@ public:
|
||||
return get_extent_ret<T>(
|
||||
get_extent_ertr::ready_future_marker{},
|
||||
std::move(ret));
|
||||
} else if (ret->is_retired()) {
|
||||
ceph_abort_msg("impossible retired extent");
|
||||
} else {
|
||||
return crimson::ct_error::eagain::make();
|
||||
}
|
||||
|
@ -46,8 +46,6 @@ std::ostream &operator<<(std::ostream &out, CachedExtent::extent_state_t state)
|
||||
return out << "CLEAN";
|
||||
case CachedExtent::extent_state_t::DIRTY:
|
||||
return out << "DIRTY";
|
||||
case CachedExtent::extent_state_t::RETIRED:
|
||||
return out << "RETIRED";
|
||||
case CachedExtent::extent_state_t::INVALID:
|
||||
return out << "INVALID";
|
||||
default:
|
||||
|
@ -48,7 +48,6 @@ class CachedExtent : public boost::intrusive_ref_counter<
|
||||
// during write, contents match disk, version == 0
|
||||
DIRTY, // Same as CLEAN, but contents do not match disk,
|
||||
// version > 0
|
||||
RETIRED, // In ExtentIndex while in retired_extent_gate
|
||||
INVALID // Part of no ExtentIndex set
|
||||
} state = extent_state_t::INVALID;
|
||||
friend std::ostream &operator<<(std::ostream &, extent_state_t);
|
||||
@ -225,12 +224,7 @@ public:
|
||||
|
||||
/// Returns true if extent has not been superceded or retired
|
||||
bool is_valid() const {
|
||||
return state != extent_state_t::INVALID && state != extent_state_t::RETIRED;
|
||||
}
|
||||
|
||||
/// True iff extent is in state RETIRED
|
||||
bool is_retired() const {
|
||||
return state == extent_state_t::RETIRED;
|
||||
return state != extent_state_t::INVALID;
|
||||
}
|
||||
|
||||
/// Returns true if extent or prior_instance has been invalidated
|
||||
@ -246,7 +240,7 @@ public:
|
||||
|
||||
/// Return journal location of oldest relevant delta, only valid while RETIRED
|
||||
auto get_retired_at() const {
|
||||
ceph_assert(is_retired());
|
||||
ceph_assert(!is_valid());
|
||||
return dirty_from_or_retired_at;
|
||||
}
|
||||
|
||||
@ -376,7 +370,7 @@ protected:
|
||||
poffset(other.poffset) {}
|
||||
|
||||
struct retired_placeholder_t{};
|
||||
CachedExtent(retired_placeholder_t) : state(extent_state_t::RETIRED) {}
|
||||
CachedExtent(retired_placeholder_t) : state(extent_state_t::INVALID) {}
|
||||
|
||||
friend class Cache;
|
||||
template <typename T, typename... Args>
|
||||
|
@ -339,7 +339,6 @@ class NodeExtentAccessorT {
|
||||
|
||||
bool is_retired() const {
|
||||
if (extent) {
|
||||
assert(!extent->is_retired());
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
@ -134,6 +134,7 @@ struct object_data_handler_test_t:
|
||||
seastar::future<> set_up_fut() final {
|
||||
onode = new TestOnode{};
|
||||
known_contents = buffer::create(4<<20 /* 4MB */);
|
||||
memset(known_contents.c_str(), 0, known_contents.length());
|
||||
size = 0;
|
||||
return tm_setup();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user