Project

General

Profile

Actions

Bug #68060

closed
AK AK

_deferred_replay can overwrite BlueFS

Bug #68060: _deferred_replay can overwrite BlueFS

Added by Adam Kupczyk about 2 years ago. Updated about 1 month ago.

Status:
Backporting
Priority:
High
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
umbrella, tentacle, squid
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v22.0.0-369-g1e6a9216c5
Released In:
Upkeep Timestamp:
2026-11-03T13:54:08+00:00

Description

_deferred_replay avoids BlueFS locations.
But the set of BlueFS allocations is captured before procedure starts.
During the procedure keys are removed from DB, which might trigger allocation.
These newly allocated spaces are not protected and can be written over.

Fixed algorithm:
1. open BlueFS read-only
2. write blocks
3. open BlueFS read-write
4. delete keys


Related issues 4 (4 open — 0 closed)

Related to bluestore - Bug #81440: BlueStore ignores RocksDB iterator read errors: fsck, listing, omap iteration and allocation recovery silently skip dataNewAdam Kupczyk

Actions
Copied to bluestore - Backport #82616: tentacle: _deferred_replay can overwrite BlueFSIn ProgressJaya Prakash

Actions
Copied to bluestore - Backport #82617: umbrella: _deferred_replay can overwrite BlueFSIn ProgressJaya Prakash

Actions
Copied to bluestore - Backport #82618: squid: _deferred_replay can overwrite BlueFSIn ProgressJaya Prakash

Actions

IF Updated by Igor Fedotov about 2 years ago Actions #1

  • Priority changed from Normal to High
  • Severity changed from 3 - minor to 2 - major

AK Updated by Adam Kupczyk about 2 years ago Actions #3

There are two flavors of corruption possible.

1.
In _deferred_replay, it might happen that after

bool has_some = _eliminate_outdated_deferred(deferred_txn, bluefs_extents);

has_some is false, meaning that no IO should be executed.
In this case we skip sending deferred_txn through BlueStore state machine.
By that we skip the last step of removing according L entry from RocksDB.
Remaining deferred is lurking in DB until such restart that something of it can be applied.
That new target could be:
- BlueFS (ok - we skip this)
- empty space (ok - its empty)
- Object data (bad - corruption)

2.
The original reported case when BlueFS is compacting in the background.
Our deferred made a snapshot of BlueFS allocations at some point,
but it does not track the changes.
The target of deferred could be:
- BlueFS as originally allocated (ok - we skip this)
- empty space (ok - its empty)
- Object data (ok - its what we are supposed to do)
- BlueFS newly allocated (bad! corrupting the files)

AK Updated by Adam Kupczyk about 2 years ago Actions #4

  • Pull request ID set to 60753

AK Updated by Adam Kupczyk about 2 years ago Actions #5

  • Status changed from New to Fix Under Review

IF Updated by Igor Fedotov over 1 year ago Actions #6

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to squid, reef

UB Updated by Upkeep Bot over 1 year ago Actions #9

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot over 1 year ago Actions #10

  • Merge Commit set to 9ef9c124511eeafb09eb4cbdfea083dc00cae106
  • Fixed In set to v20.0.0-232-g9ef9c124511
  • Upkeep Timestamp set to 2025-07-08T18:45:00+00:00

UB Updated by Upkeep Bot over 1 year ago Actions #11

  • Fixed In changed from v20.0.0-232-g9ef9c124511 to v20.0.0-232-g9ef9c124511e
  • Upkeep Timestamp changed from 2025-07-08T18:45:00+00:00 to 2025-07-14T15:45:20+00:00

UB Updated by Upkeep Bot over 1 year ago Actions #12

  • Fixed In changed from v20.0.0-232-g9ef9c124511e to v20.0.0-232-g9ef9c12451
  • Upkeep Timestamp changed from 2025-07-14T15:45:20+00:00 to 2025-07-14T21:09:48+00:00

UB Updated by Upkeep Bot over 1 year ago Actions #14

  • Status changed from New to Pending Backport
  • Upkeep Timestamp changed from 2025-07-14T21:09:48+00:00 to 2025-08-13T14:01:32+00:00

PD Updated by Patrick Donnelly over 1 year ago ยท Edited Actions #15

Igor Fedotov wrote in #note-13:

Reverted by https://github.com/ceph/ceph/pull/62214

Should the backports be Rejected then? The bot is confused.

IF Updated by Igor Fedotov over 1 year ago Actions #16

  • Status changed from Pending Backport to New
  • Tags (freeform) deleted (backport_processed)

IF Updated by Igor Fedotov over 1 year ago Actions #17

Patrick Donnelly wrote in #note-15:

Igor Fedotov wrote in #note-13:

Reverted by https://github.com/ceph/ceph/pull/62214

Should the backports be Rejected then? The bot is confused.

Done, thanks for pointing.

UB Updated by Upkeep Bot over 1 year ago Actions #18

  • Status changed from New to Pending Backport
  • Upkeep Timestamp changed from 2025-08-13T14:01:32+00:00 to 2025-08-21T11:39:21+00:00

UB Updated by Upkeep Bot over 1 year ago Actions #19

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot over 1 year ago Actions #20

  • Status changed from Pending Backport to Resolved
  • Upkeep Timestamp changed from 2025-08-21T11:39:21+00:00 to 2025-08-25T19:43:40+00:00

IF Updated by Igor Fedotov over 1 year ago Actions #21

  • Status changed from Resolved to New

UB Updated by Upkeep Bot over 1 year ago Actions #22

  • Status changed from New to Pending Backport
  • Upkeep Timestamp changed from 2025-08-25T19:43:40+00:00 to 2025-08-29T00:56:41+00:00

UB Updated by Upkeep Bot over 1 year ago Actions #23

  • Status changed from Pending Backport to Resolved
  • Upkeep Timestamp changed from 2025-08-29T00:56:41+00:00 to 2025-08-29T01:36:33+00:00

PD Updated by Patrick Donnelly over 1 year ago Actions #24

  • Status changed from Resolved to New
  • Pull request ID deleted (60753)
  • Tags (freeform) deleted (backport_processed)
  • Merge Commit deleted (9ef9c124511eeafb09eb4cbdfea083dc00cae106)
  • Fixed In deleted (v20.0.0-232-g9ef9c12451)
  • Upkeep Timestamp deleted (2025-08-29T01:36:33+00:00)

Igor, in this situation just remove the PR number.

IF Updated by Igor Fedotov over 1 year ago Actions #25

Patrick Donnelly wrote in #note-24:

Igor, in this situation just remove the PR number.

ah, ok. Good to know.

YO Updated by Yuma Ogami over 1 year ago Actions #26

I have two questions about this issue.

Q1: The following my understanding correct?

- If object data is corrupted: If there are other healthy replicas, the corruption will be detected and fixed on scrub or read.
- If BlueFS is corrupted: The OSD would crash during operation or fail to start at next BlueFS's open process.

Q2: And is there a new fix being developed after the following PR was reverted?
https://github.com/ceph/ceph/pull/60753

YO Updated by Yuma Ogami about 1 year ago Actions #27

Any updates on this?

SK Updated by Stefan Kooman about 1 year ago Actions #28

I'm also interested in how this will be fixed. This issue got a severity of major. Since it involves data corruption I would expect a high priority. Is the likelihood of hitting this issue really low?

KS Updated by Konstantin Shalygin 8 months ago Actions #30

  • Backport changed from squid, reef to tentacle, squid

AA Updated by Alex Ainscow about 2 months ago Actions #31

  • Related to Bug #81440: BlueStore ignores RocksDB iterator read errors: fsck, listing, omap iteration and allocation recovery silently skip data added

AK Updated by Adam Kupczyk about 1 month ago Actions #32

  • Backport changed from tentacle, squid to umbrella, tentacle, squid

AK Updated by Adam Kupczyk about 1 month ago Actions #33

  • Pull request ID set to 69961

AK Updated by Adam Kupczyk about 1 month ago Actions #34

  • Status changed from New to Fix Under Review

UB Updated by Upkeep Bot about 1 month ago Actions #35

  • Copied to Backport #82616: tentacle: _deferred_replay can overwrite BlueFS added

UB Updated by Upkeep Bot about 1 month ago Actions #36

  • Copied to Backport #82617: umbrella: _deferred_replay can overwrite BlueFS added

UB Updated by Upkeep Bot about 1 month ago Actions #37

  • Copied to Backport #82618: squid: _deferred_replay can overwrite BlueFS added

UB Updated by Upkeep Bot about 1 month ago Actions #38

  • Status changed from Fix Under Review to Backporting
  • Merge Commit set to 1e6a9216c5db52ffbc7fe701ac2e6a06bdd703e5
  • Fixed In set to v22.0.0-369-g1e6a9216c5
  • Upkeep Timestamp set to 2026-11-03T13:54:08+00:00
Actions

Also available in: PDF Atom