Skip to content

osdc: setting rados_replica_read_policy to default should clear extra_flags - #70707

Merged
rzarzynski merged 2 commits into
ceph:mainfrom
bill-scales:issue77097
Aug 18, 2026
Merged

rzarzynski merged 2 commits into
ceph:mainfrom
bill-scales:issue77097

Conversation

@bill-scales

@bill-scales bill-scales commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Objecter reacts to changes to rados_replica_read_policy by setting extra_flags to add either CEPH_OSD_FLAG_LOCALIZE_READS or CEPH_OSD_FLAG_BALANCE_READS to all read requests. It should also deal with changing the policy back to default by clearing extra_flags.

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

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.

@bill-scales
bill-scales requested review from JonBailey1993 and Copilot and removed request for Copilot July 30, 2026 13:42

@JonBailey1993 JonBailey1993 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 couple of points from reviewing

Comment thread src/osdc/Objecter.cc
return {completion_locks[h % num_locks], std::defer_lock};
}

std::vector<std::string> Objecter::get_tracked_keys() const noexcept

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.

This function is used to decide what config values to call handle_conf_change for. It's missing "rados_replica_read_policy", so when we set the value, it won't call through to the function until one of these four items gets set.

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.

This clean-up sounds like a follow-up.

Comment thread src/osdc/Objecter.cc Outdated

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.

Following on from this comment: https://github.com/ceph/ceph/pull/70707/changes#r3712364496

If we add the rados_replica_read_policy into the tracked_keys, we can make use of the changed.count(...) that all other items in here use and only update when we actually modify the read_policy, instead of updating on every config update.

bill-scales and others added 2 commits August 7, 2026 10:06
…_flags

Objecter reacts to changes to rados_replica_read_policy by setting extra_flags
to add either CEPH_OSD_FLAG_LOCALIZE_READS or CEPH_OSD_FLAG_BALANCE_READS
to all read requests. It should also deal with changing the policy back to
default by clearing extra_flags.

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

Signed-off-by: Bill Scales <[email protected]>
Objecter should correctly register to track changes to the
rados_replica_read_policy, when notified of a conf change it
should only re-evaluate this conf setting if it has changed.

Signed-off-by: Bill Scales <[email protected]>
Co-authored-by: Jon Bailey <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 7, 2026 09:08
@bill-scales

Copy link
Copy Markdown
Contributor Author

Pushed 2nd commit addressing suggested improvements from Jon

Copilot AI 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.

Pull request overview

Updates Objecter to handle runtime replica-read policy changes correctly.

Changes:

  • Tracks rados_replica_read_policy.
  • Clears replica-read flags when policy returns to default.

Comment thread src/osdc/Objecter.cc
extra_read_flags = CEPH_OSD_FLAG_LOCALIZE_READS;
} else if (read_policy == "balance") {
extra_read_flags = CEPH_OSD_FLAG_BALANCE_READS;
if (changed.count("rados_replica_read_policy")) {

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

Thanks for the changes Bill, LGTM

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath8-testing-20260813.003211-main.

@sseshasa

Copy link
Copy Markdown
Contributor

@rzarzynski
rzarzynski merged commit 17fc2b5 into ceph:main Aug 18, 2026
7 checks passed
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