Merge pull request #69053 from tchaikov/wip-seastore-overwrite-update-checksum

crimson/seastore: skip LBA-leaf crc check for in-place delta-overwrite

Reviewed-by: Myoungwon Oh <ohmyoungwon@gmail.com>
This commit is contained in:
Kefu Chai 2026-07-05 08:41:27 +08:00 committed by GitHub
commit bc6ebfff79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 8 deletions

View File

@ -33,6 +33,9 @@ Cache::Cache(
ExtentPlacementManager &epm,
store_index_t store_index)
: epm(epm),
delta_based_overwrite_enabled(
crimson::common::get_conf<Option::size_t>(
"seastore_data_delta_based_overwrite") > 0),
pinboard(create_extent_pinboard(
crimson::common::get_conf<Option::size_t>(
"seastore_cachepin_size_pershard")))

View File

@ -1731,6 +1731,9 @@ private:
}
ExtentPlacementManager& epm;
// when delta-based overwrite is enabled, RANDOM_BLOCK data extents may be
// mutated in place, leaving their LBA-leaf crc stale; see _read_extent().
const bool delta_based_overwrite_enabled;
RootBlockRef root; ///< ref to current root
ExtentIndex extents_index; ///< set of live extents
@ -2062,14 +2065,26 @@ void stage_visibility_handoff(Transaction& t,
offset, length, *extent);
if (pin_crc != CRC_NULL) {
SUBDEBUG(seastore_cache, "read extent 0x{:x}~0x{:x} veryfing integrity -- {}",
offset, length, *extent);
// We must check the integrity here prior to complete_io.
// Previously, concurrent transaction could have checked
// crc of non matching extent data.
// See: https://tracker.ceph.com/issues/73790
assert(extent->is_fully_loaded());
check_full_extent_integrity(extent->last_committed_crc, pin_crc);
// a RANDOM_BLOCK data extent that delta-based overwrite may have
// mutated in place has a stale LBA-leaf crc: its content and its
// leaf crc are updated through separate, non-atomic paths, so a
// cold read can see the new content against the old leaf crc.
// such extents are verified via the delta chain instead (see
// replay_delta()), so skip the leaf-crc check for them.
bool inplace_delta_overwrite =
delta_based_overwrite_enabled &&
extent->get_paddr().is_absolute_random_block() &&
can_inplace_rewrite(extent->get_type());
if (!inplace_delta_overwrite) {
SUBDEBUG(seastore_cache, "read extent 0x{:x}~0x{:x} verifying integrity -- {}",
offset, length, *extent);
// We must check the integrity here prior to complete_io.
// Previously, concurrent transaction could have checked
// crc of non matching extent data.
// See: https://tracker.ceph.com/issues/73790
assert(extent->is_fully_loaded());
check_full_extent_integrity(extent->last_committed_crc, pin_crc);
}
}
} else {
extent->last_committed_crc = CRC_NULL;