Skip to content

osd: Support for OMAPs in EC Pools PR 1 - #66618

Closed
MattyWilliams22 wants to merge 3 commits into
ceph:mainfrom
MattyWilliams22:ec-omaps-pr1
Closed

MattyWilliams22 wants to merge 3 commits into
ceph:mainfrom
MattyWilliams22:ec-omaps-pr1

Conversation

@MattyWilliams22

@MattyWilliams22 MattyWilliams22 commented Dec 12, 2025 •

Copy link
Copy Markdown
Contributor

This PR introduces the data structures and interfaces required to enable omap operations in erasure coded pools with optimisations enabled.

Fixes: https://tracker.ceph.com/issues/74187

ECOmapJournal:
An in-memory journal to maintain OMAP consistency for Erasure Coded pools.

Background:
Unlike Replicated pools which use a "roll-forward" recovery model, EC pools rely on a
"roll-back" mechanism for interrupted updates. To support efficient rollback without
incurring expensive read-before-write operations to generate rollback info, EC OMAP
updates are initially recorded only in the PG Log. They are applied to the underlying
ObjectStore only after the transaction is fully committed on all shards.

The Problem:
This deferred application creates a latency window where the authoritative state exists
in the PG Log but the ObjectStore contains stale data. Reads served during this window
would return incorrect results.

The Solution:
An ECOmapJournal tracks these "log-only" updates in memory. When an OMAP read occurs,
the backend fetches the base state from the ObjectStore and supplements it with the
updates stored in this journal. This ensures clients always receive the most up-to-date
result, merging the persistent state with the in-flight log state.

Unit tests for the journal have also been added.

"supports_omap" Pool Flag:
Added a pool flag to determine whether a pool supports omap operations.
This pool flag is currently always enabled in Replicated pools and always disabled in EC pools.
This flag will be used to enable EC Omap functionality in EC pools in PR 3.

Omap Read Operation Wrappers:
In PGBackend, we have introduced abstract omap read operations methods.
In ReplicatedBackend, these methods maintain existing behaviour.
In ECSwitch:

  • If optimisations are not enabled, these methods maintain existing behaviour.
  • If optimisations are enabled, these methods combine the updates from the ec_omap_journal with the contents of the object store.

ObjectModDesc::Visitor:
Added EC_OMAP ModID and a function to encode omap updates.

Trimmer:
Added function to commit omap updates and remove the corresponding entry from the journal.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

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)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Comment thread src/osd/PGBackend.cc Resolved
@MattyWilliams22
MattyWilliams22 marked this pull request as ready for review December 17, 2025 15:40
@MattyWilliams22
MattyWilliams22 requested a review from a team as a code owner December 17, 2025 15:40
@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test api

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@MattyWilliams22 MattyWilliams22 changed the title Support for OMAPs in EC Pools PR 1 osd: Support for OMAPs in EC Pools PR 1 Dec 23, 2025
@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

1 similar comment
@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@bill-scales bill-scales 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.

Looking good, one bug in should_be_removed and a few nits or places the code could be tidied up a little.

Comment thread src/osd/ECBackend.cc Resolved
Comment thread src/osd/ECBackend.cc Resolved
Comment thread src/osd/ECBackend.cc Resolved
Comment thread src/osd/ECBackend.cc Resolved
Comment thread src/osd/PGBackend.h Resolved
Comment thread src/osd/PGBackend.h Resolved
Comment thread src/osd/ReplicatedBackend.cc Resolved
@github-actions github-actions Bot added mon and removed needs-rebase labels Apr 21, 2026
@anthonyeleven

Copy link
Copy Markdown
Contributor

nit: the original source of the term omap lowercased it, so that’s what we’ve been doing in docs.

@CJamesIBM

Copy link
Copy Markdown
Contributor

nit: the original source of the term omap lowercased it, so that’s what we’ve been doing in docs.

@anthonyeleven Can I check is this also the case for lists such as below? i.e Omap should simply be omap?

  • Omap Journal Unit Tests: Test the functionality of the journal in isolation
  • Omap Integration Tests: Test omap operations and recovery in a full rados cluster
  • Cls Integration Tests: Test cls method calls in a full rados cluster
  • EC omap in Teuthology Tests: Allow omap operations in EC pools with ceph_test_rados
  • RBD in Teuthology Tests: Change all uses of RBD in teuthology to use just an EC pool
  • RGW in Teuthology Tests: Change all uses of RGW in teuthology to use just an EC pool
  • CephFS in Teuthology Tests: Change all uses of CephFS in teuthology to use just an EC pool

@anthonyeleven

Copy link
Copy Markdown
Contributor

That is my personal practice, but it's a nit and not a hill to die on.

@CJamesIBM

CJamesIBM commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Have changed Omap to omap where it exists in the middle of a sentence.

Have left as Omap where it either,

A) Begins the sentence
B) Needs to follow variable naming conventions

@bill-scales bill-scales 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

@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.

Mostly nits / style / add consts.

I have concern about append_create - maybe I have misunderstood the code, but as I read it a delete-create-update-omap sequence may end up updating the wrong object.

Comment thread src/osd/ECOmapJournal.cc Resolved
Comment thread src/osd/ECOmapJournal.cc Resolved
Comment thread src/osd/ECOmapJournal.cc Resolved
Comment thread src/osd/ECOmapJournal.cc Resolved
Comment thread src/osd/ECOmapJournal.cc Resolved
Comment thread src/mon/OSDMonitor.cc Resolved
Comment thread src/osd/PGBackend.h Resolved
Comment thread src/test/osd/MockPGBackend.h Resolved
Comment thread src/osd/osd_types.h Resolved
Comment thread src/osd/ECOmapJournal.cc Resolved
The ECOmapJournal will be used to store omap updates (in ec pools with optimisations enabled) which have not yet been committed to the object store.
Added unit tests for this class.
Promoted OmapUpdateType to osd_types.h so that it can be shared to multiple files without circular dependencies.

Signed-off-by: Matty Williams <[email protected]>
Introduced a "supports_omap" pool flag which is always enabled for Replicated pools and currently always disabled for EC pools.
Introduced wrappers around omap read operations in PGBackend to include updates from the journal in EC pools with optimisations enabled.
Introduced a function for encoding an EC_OMAP operation in the ObjectModDesc::Visitor class and a function for committing an operation in the Trimmer struct.

Signed-off-by: Matty Williams <[email protected]>
Comment thread src/osd/ECOmapJournal.cc Resolved

@anthonyeleven anthonyeleven 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.

Fascinating stuff.

Operationally would one still have the ability to provision a separate omap pool, be it replicated or EC? Notably in cases where bulk data storage is on slower / less endurant media like HDDs, coarse-IU QLC, aspirational PLC etc.

Are there any issues with existing data pools that share a single metadata pool, e.g. for RGW .index?

@bill-scales

Copy link
Copy Markdown
Contributor

Operationally would one still have the ability to provision a separate omap pool, be it replicated or EC? Notably in cases where bulk data storage is on slower / less endurant media like HDDs, coarse-IU QLC, aspirational PLC etc.

Yes. This change doesn't prevent you using separate pools for metadata and data (and these are good examples of where you would want separate pools), you now just have the option of these both being the same EC pool.

You could choose to use separate EC pools for data and metadata, but if you are only storing metadata in a pool there is no advantage (omaps will still be replicated).

Are there any issues with existing data pools that share a single metadata pool, e.g. for RGW .index?

No, nothing will change with existing pools. This feature In conjunction with pool migration could technically allow you to change a metadata pool from being Replica to EC (but see comment above), there is currently no way you can merge a metadata and data pool which is where sharing a metadata pool might cause problems.

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test api

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

1 similar comment
@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

This PR has been combined into this PR: #66726

@MattyWilliams22
MattyWilliams22 deleted the ec-omaps-pr1 branch June 2, 2026 15:09
@MattyWilliams22
MattyWilliams22 restored the ec-omaps-pr1 branch July 20, 2026 14:32
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.

6 participants