Skip to content

Commit a38ff7c

Browse files
committed
crimson/os/seastore/transaction: more logs about inconsistent
retired_placeholder Signed-off-by: Xuehan Xu <[email protected]>
1 parent e495e0e commit a38ff7c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/crimson/os/seastore/transaction.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ class Transaction {
294294
}
295295

296296
void replace_placeholder(CachedExtent& placeholder, CachedExtent& extent) {
297+
LOG_PREFIX(Transaction::replace_placeholder);
297298
ceph_assert(!is_weak());
298299

299300
assert(is_retired_placeholder_type(placeholder.get_type()));
@@ -303,8 +304,17 @@ class Transaction {
303304
assert(extent.get_paddr().is_absolute());
304305
{
305306
auto where = read_set.find(placeholder.get_paddr(), extent_cmp_t{});
306-
assert(where != read_set.end());
307-
assert(where->ref.get() == &placeholder);
307+
if (unlikely(where == read_set.end())) {
308+
SUBERRORT(seastore_t,
309+
"unable to find placeholder {}", *this, placeholder);
310+
ceph_abort();
311+
}
312+
if (unlikely(where->ref.get() != &placeholder)) {
313+
SUBERRORT(seastore_t,
314+
"inconsistent placeholder, current: {}; should-be: {}",
315+
*this, *where->ref.get(), placeholder);
316+
ceph_abort();
317+
}
308318
placeholder.read_transactions.erase(
309319
read_trans_set_t<Transaction>::s_iterator_to(*where));
310320
where = read_set.erase(where);

0 commit comments

Comments
 (0)