Skip to content

osd: avoid inserting empty OI_ATTR in rollback_setattrs - #70965

Merged
aainscow merged 1 commit into
ceph:mainfrom
sunyuechi:wip-osd-rollback-setattrs-oi
Sep 28, 2026
Merged

aainscow merged 1 commit into
ceph:mainfrom
sunyuechi:wip-osd-rollback-setattrs-oi

Conversation

@sunyuechi

Copy link
Copy Markdown
Contributor

In rollback_setattrs, operator[] on a missing OI_ATTR inserted an
empty bufferlist into to_set, and decoding it threw. Look the key up
instead and bail if absent.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

@sunyuechi
sunyuechi requested a review from a team as a code owner August 11, 2026 08:54
@github-actions github-actions Bot added the core label Aug 11, 2026
@sunyuechi
sunyuechi force-pushed the wip-osd-rollback-setattrs-oi branch from 66bbd93 to df0c0f5 Compare August 11, 2026 08:59

@tchaikov tchaikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. this crashes when a write that created the object gets rolled back. attr_updates() records OI_ATTR as nullopt for it, so on the non-primary written shards to_set has no OI_ATTR, and since 254650b we decode an empty bufferlist. returning is fine, the create() rollback removes the object anyway.

could you put that in the commit message and file a tracker? 254650b is in tentacle and umbrella, so this needs backports. also, a test next to RollbackVersionMismatch in TestECFailoverWithPeering would help.

cc @aainscow

@tchaikov
tchaikov requested a review from aainscow September 15, 2026 06:29

@aainscow aainscow left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks like it would successfully avoid an attribute rollback, if there were no OI. The big question is - why is there not an OI?

An object without OI will cause problems later on - probably causing a different set of looping asserts. I cannot immediately see a data corruption issue, but I would not rule this out.

operator[] on a missing OI_ATTR inserts an empty bufferlist and decode
throws an uncaught exception.  No known path produces such a rollback
record; make the assumption explicit with an assert.

Signed-off-by: Sun Yuechi <[email protected]>
@sunyuechi

Copy link
Copy Markdown
Contributor Author

@tchaikov @aainscow

I tried to write a reproducer and could not find a
reachable path. ObjectModDesc::create() sets rollback_info_completed,
so a rolled-back create never carries a SETATTRS record, and for an
existing object finish_ctx() always updates OI_ATTR, so the rollback
record always has it. The only way to hit this is to have the test
fixture clear attr_cache by hand, which tests the fixture rather than
the OSD.

Since there's no real bug to fix, I've changed the bail-out to a
ceph_assert and reworded the commit as a defensive change. What do you think?

@aainscow aainscow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good clean up of some code.

@aainscow

Copy link
Copy Markdown
Contributor

@tchaikov @sunyuechi I am happy with this change now and agree the code looks cleaner. It does still require qa. I have added the needs-qa flag, but you may need to chase this up on the prs channel on the ceph slack.

Thanks

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath22-testing-20260917.055008-main.

@aainscow

Copy link
Copy Markdown
Contributor

I have put ci-approved to get the make checks, etc.. running, but please do not merge until it gets RADOS APPROVED.

@connorfawcett

Copy link
Copy Markdown
Contributor

@aainscow
aainscow merged commit 4b85f1c into ceph:main Sep 28, 2026
17 checks passed
sunyuechi added a commit to sunyuechi/openRuyi that referenced this pull request Oct 28, 2026
The new snapshot brings in these fixes:
- osd/PeeringState: fix the divergence check against olog.head
  (ceph/ceph#70149)
- osd: assert OI_ATTR is present in rollback_setattrs (ceph/ceph#70965)
- osdc: fix ReplicaSplitOp chunk distribution, reassembly and
  small multi-op reads (ceph/ceph#70207)
- erasure-code/isa: default the technique when the profile has none
  (ceph/ceph#72215)
- mount.ceph: report kernels without aes256k key support
  (ceph/ceph#72159)
- rgw/es: require both major and minor in the ES version
  (ceph/ceph#70007)
- build: turn WITH_RADOSGW_LANCEDB off where lance cannot build
  (ceph/ceph#71935)
- cmake: make SIMD_COMPILE_FLAGS a list (ceph/ceph#72657)
- cmake/boost: do not pass context-impl to the headers step
  (ceph/ceph#71249)
- rpm: let ceph-mgr-cephadm require routes (ceph/ceph#73051)
- test/mds: widen result waits in ReleaseAwait (ceph/ceph#70463)
- qa/lsan.supp: match OpenSSL error state on ERR_set_mark
  (ceph/ceph#71460)

Signed-off-by: Sun Yuechi <[email protected]>
misaka00251 pushed a commit to openRuyi-Project/openRuyi that referenced this pull request Oct 28, 2026
The new snapshot brings in these fixes:
- osd/PeeringState: fix the divergence check against olog.head
  (ceph/ceph#70149)
- osd: assert OI_ATTR is present in rollback_setattrs (ceph/ceph#70965)
- osdc: fix ReplicaSplitOp chunk distribution, reassembly and
  small multi-op reads (ceph/ceph#70207)
- erasure-code/isa: default the technique when the profile has none
  (ceph/ceph#72215)
- mount.ceph: report kernels without aes256k key support
  (ceph/ceph#72159)
- rgw/es: require both major and minor in the ES version
  (ceph/ceph#70007)
- build: turn WITH_RADOSGW_LANCEDB off where lance cannot build
  (ceph/ceph#71935)
- cmake: make SIMD_COMPILE_FLAGS a list (ceph/ceph#72657)
- cmake/boost: do not pass context-impl to the headers step
  (ceph/ceph#71249)
- rpm: let ceph-mgr-cephadm require routes (ceph/ceph#73051)
- test/mds: widen result waits in ReleaseAwait (ceph/ceph#70463)
- qa/lsan.supp: match OpenSSL error state on ERR_set_mark
  (ceph/ceph#71460)

Signed-off-by: Sun Yuechi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants