Skip to content

osd: Support for OMAPs in EC Pools - Classic - #66726

Merged
batrick merged 7 commits into
ceph:mainfrom
MattyWilliams22:ec-omaps-pr3
Jun 10, 2026
Merged

batrick merged 7 commits into
ceph:mainfrom
MattyWilliams22:ec-omaps-pr3

Conversation

@MattyWilliams22

@MattyWilliams22 MattyWilliams22 commented Dec 23, 2025 •

Copy link
Copy Markdown
Contributor

This PR prepares the code for enabling support for omap operations in EC pools

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

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.

Recovery

  • Add omap fields to read_request_t, read_result_t, ECSubRead and ECSubReadReply.
  • Read and write omap header and entries if !omap_complete.
  • Require omap_complete to finish recovery.

Integrating EC Omaps:
The code that allows for Omap operations in EC pools, including rollbacks and recovery, has been connected up with the rest of Ceph.
This includes:

  • Changing recovery reads to include journal updates.
  • Clearing the journal for a new epoch.
  • Setting the omap_complete boolean correctly before recovery in an EC pool.
  • Encoding omap updates and adding entries to the journal.
  • Decoding omap updates, applying updates to object store, then removing updates from the journal.
  • Changing the supports_omap function to use the pool flag. This function also returns true if is_replicated, this ensures that omap operations are handled during an upgrade, before the pool flag has been set.
  • Changing omap read operations in PrimaryLogPG to use PGBackend functions (which include journal updates for optimised_ec).

Integration Tests:

  • A test suite has been added allowing for tests to be run against ec pools with optimisations enabled.
  • We have tested all of the omap object operations.
  • We have tested omap recovery when the primary osd in changed.
  • We have tested that object recovery still works with no omap present.
  • We have tested that omap recovery works when multiple reads are required to retrieve all of the omap data.
  • These integrations tests currently skip the tests with FastEC pools.

Documentation:
Documentation updated to reflect the fact that omap in now supported in EC pools, but disabled by default.

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.

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

Comment thread src/mon/OSDMonitor.cc Resolved
Comment thread src/mon/OSDMonitor.cc Resolved
Comment thread src/mon/OSDMonitor.cc Resolved
Comment thread src/mon/OSDMonitor.cc Resolved
@MattyWilliams22
MattyWilliams22 force-pushed the ec-omaps-pr3 branch 3 times, most recently from 53d90d8 to 684294e Compare February 26, 2026 09:17
Comment thread src/mon/OSDMonitor.cc Resolved
@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@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

@batrick batrick added this to the umbrella milestone Jun 3, 2026
@ljflores

ljflores commented Jun 3, 2026

Copy link
Copy Markdown
Member

@MattyWilliams22 @batrick is this PR ready for a retest?

@batrick

batrick commented Jun 4, 2026

Copy link
Copy Markdown
Member

@MattyWilliams22 @batrick is this PR ready for a retest?

It's a funny question. My understanding is that this is tested "in-house" with a patch on top of this branch which addresses

#66726 (comment)

So it's on them to test it I guess.

I would request that the gate ^ be removed to allow tests to run normally. Add sufficient notice to documentation so users don't turn it on by accident.

@batrick

batrick commented Jun 4, 2026

Copy link
Copy Markdown
Member

This is the last Umbrella blocker. I would like to branch tomorrow if possible. Please give regular updates.

@anthonyeleven

anthonyeleven commented Jun 4, 2026 via email

Copy link
Copy Markdown
Contributor

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

I am currently testing the omap code in teuthology (including the bug fixes which aren't in this PR).
I have run a set of rados/thrash-erasure-code jobs which have come back clean of any related failures (for the first time).
I have now started a set of rados jobs.

There is a known issue with PeeringState/PGLog which we attempted to fix in this PR (#68888) but this fix has uncovered other issues that @bill-scales is working on fixing now.
We don't want to enable this feature until that other issue is fixed.

@ljflores

ljflores commented Jun 4, 2026

Copy link
Copy Markdown
Member

@MattyWilliams22 sounds good - if you need it retested by Yuri or Bharath, you can re-add the "needs-qa" label. Feel free to send a ping in the #prs_testing channel in Slack if it needs urgent testing (I added you there).

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

Here is a teuthology test run of the rados/thrash-erasure-code directory that is running ceph_test_rados against an EC pool with omap support enabled: https://pulpito-ng.ceph.com/runs/mattywilliams-2026-06-05_08:11:56-rados:thrash-erasure-code-main-distro-default-trial

All 48/48 tests passed.

The branch that was used for this test run included the code from this PR, the omap bug fixes from PR 69267, the PeeringState fix from PR 68888 and the change to ceph_test_rados from PR 69269

@MattyWilliams22

Copy link
Copy Markdown
Contributor Author

This force push was to remove a commit that I added. I did not change any other code.

@ljflores ljflores left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@MattyWilliams22 @aainscow latest results revealed one issue:

/a/lflores-2026-06-05_19:26:14-rados-wip-lflores-testing-3-2026-06-05-1057-distro-default-trial/
5 jobs: ['269112', '269245', '269313', '269176', '269039']

2026-06-05T20:25:58.135 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:37: expect_false:  ceph osd pool set pool_getset noscrub asdf
2026-06-05T20:25:58.293 INFO:tasks.workunit.client.0.trial023.stderr:Error EINVAL: expecting value 'true', 'false', '0', or '1'
2026-06-05T20:25:58.297 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:37: expect_false:  return 0
2026-06-05T20:25:58.297 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:2317: test_mon_osd_pool_set:  expect_false ceph osd pool set pool_getset noscrub 2
2026-06-05T20:25:58.297 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:36: expect_false:  set -x
2026-06-05T20:25:58.297 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:37: expect_false:  ceph osd pool set pool_getset noscrub 2
2026-06-05T20:25:58.454 INFO:tasks.workunit.client.0.trial023.stderr:Error EINVAL: expecting value 'true', 'false', '0', or '1'
2026-06-05T20:25:58.459 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:37: expect_false:  return 0
2026-06-05T20:25:58.460 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:2307: test_mon_osd_pool_set:  for flag in nodelete nopgchange nosizechange write_fadvise_dontneed noscrub nodeep-scrub bulk
2026-06-05T20:25:58.460 INFO:tasks.workunit.client.0.trial023.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:2308: test_mon_osd_pool_set:  ceph osd pool set pool_getset nodeep-scrub false
2026-06-05T20:25:58.613 INFO:tasks.workunit.client.0.trial023.stderr:Invalid command: nodeep-scrub not in allow_ec_optimizations|allow_ec_overwrites|bulk|cache_min_evict_age|cache_min_flush_age|cache_target_dirty_high_ratio|cache_target_dirty_ratio|cache_target_full_ratio|compression_algorithm|compression_max_blob_size|compression_min_blob_size|compression_mode|compression_required_ratio|crush_rule|csum_max_block|csum_min_block|csum_type|deep_scrub_interval|dedup_cdc_chunk_size|dedup_chunk_algorithm|dedup_tier|eio|fast_read|fingerprint_algorithm|hashpspool|hit_set_count|hit_set_fpp|hit_set_grade_decay_rate|hit_set_period|hit_set_search_last_n|hit_set_type|min_read_recency_for_promote|min_size|min_write_recency_for_promote|nodedeep-scrub|nodelete|nopgchange|noscrub|nosizechange|pct_update_delay|pg_autoscale_bias|pg_autoscale_mode|pg_num|pg_num_max|pg_num_min|pgp_num|pgp_num_actual|read_ratio|recovery_op_priority|recovery_priority|scrub_max_interval|scrub_min_interval|scrub_priority|set_pool_flags|size|supports_omap|target_max_bytes|target_max_objects|target_size_bytes|target_size_ratio|unset_pool_flags|use_gmt_hitset|write_fadvise_dontneed
2026-06-05T20:25:58.613 INFO:tasks.workunit.client.0.trial023.stderr:osd pool set <pool> <var:allow_ec_optimizations|allow_ec_overwrites|bulk|cache_min_evict_age|cache_min_flush_age|cache_target_dirty_high_ratio|cache_target_dirty_ratio|cache_target_full_ratio|compression_algorithm|compression_max_blob_size|compression_min_blob_size|compression_mode|compression_required_ratio|crush_rule|csum_max_block|csum_min_block|csum_type|deep_scrub_interval|dedup_cdc_chunk_size|dedup_chunk_algorithm|dedup_tier|eio|fast_read|fingerprint_algorithm|hashpspool|hit_set_count|hit_set_fpp|hit_set_grade_decay_rate|hit_set_period|hit_set_search_last_n|hit_set_type|min_read_recency_for_promote|min_size|min_write_recency_for_promote|nodedeep-scrub|nodelete|nopgchange|noscrub|nosizechange|pct_update_delay|pg_autoscale_bias|pg_autoscale_mode|pg_num|pg_num_max|pg_num_min|pgp_num|pgp_num_actual|read_ratio|recovery_op_priority|recovery_priority|scrub_max_interval|scrub_min_interval|scrub_priority|set_pool_flags|size|supports_omap|target_max_bytes|target_max_objects|target_size_bytes|target_size_ratio|unset_pool_flags|use_gmt_hitset|write_fadvise_dontneed> <val> [--yes-i-really-mean-it] :  set pool parameter <var> to <val>
2026-06-05T20:25:58.614 INFO:tasks.workunit.client.0.trial023.stderr:Error EINVAL: invalid command

It's coming from https://github.com/ceph/ceph/pull/66726/changes/b24e907f4b4c81f4e8f4354c83053139fb213460#diff-d2ae0d1f6b17661070357fe[…]7f8eb3b71e0d766e83dcb9c0a137. Seems like a simple error to fix. The nodeep-scrub flag was accidentally changed to nodedeep-scrub.

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]>
Add omap fields to read_request_t, read_result_t, ECSubRead and ECSubReadReply.
Read and write omap header and entries if !omap_complete.
Require omap_complete to finish recovery.

Fixes: https://tracker.ceph.com/issues/74244
Signed-off-by: Matty Williams <[email protected]>
Add pool flag to determine if omap operations are supported in a pool.
- Currently disabled in EC pools (will later be enabled for Fast EC pools)
Require all osds to have umbrella or later release version to enable pool flag.
Change recovery reads to use journal updates.
Clear the journal for a new epoch.
Set omap_complete accurately before recovery.
Encode omap updates and add entry to journal.
Decode omap updates, apply updates to object store, then remove from journal.
Change omap reads in PrimaryLogPG to use PGBackend functions, including omap updates from journal.

Assisted-by: Bob
Used for debugging and copying patterns (e.g. implementing REPLACE type to match MODIFY).

Fixes: https://tracker.ceph.com/issues/74188
Signed-off-by: Matty Williams <[email protected]>
Assisted-by: Bob
Used for writing tests following the pattern of existing tests.

Fixes: https://tracker.ceph.com/issues/74188
Signed-off-by: Matty Williams <[email protected]>
@ljflores

ljflores commented Jun 10, 2026 •

Copy link
Copy Markdown
Member

@MattyWilliams22
MattyWilliams22 requested a review from batrick June 10, 2026 15:13
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/27297541010

@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log 64c25741846ec007cd4a26dca9792a756beed596^..64c25741846ec007cd4a26dca9792a756beed596

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/27297541010

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.

10 participants