Skip to content

mixed balance read and rwordered in read ops#62806

Merged
SrinivasaBharath merged 2 commits intoceph:mainfrom
NitzanMordhai:wip-nitzan-mixed-balance-read-and-rwordered-fix
Jun 17, 2025
Merged

mixed balance read and rwordered in read ops#62806
SrinivasaBharath merged 2 commits intoceph:mainfrom
NitzanMordhai:wip-nitzan-mixed-balance-read-and-rwordered-fix

Conversation

@NitzanMordhai
Copy link
Contributor

@NitzanMordhai NitzanMordhai commented Apr 14, 2025

Ops with mixed flags of balance_reads and rwordered will cause errors when send to replica, we should not allow that mix of flags

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

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

@NitzanMordhai NitzanMordhai requested a review from athanatos April 14, 2025 14:38
@NitzanMordhai NitzanMordhai requested a review from a team as a code owner April 14, 2025 14:38
@github-actions github-actions bot added the core label Apr 14, 2025
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-mixed-balance-read-and-rwordered-fix branch from 5d13b41 to 7e99410 Compare April 14, 2025 14:39
@rzarzynski rzarzynski self-requested a review April 14, 2025 18:32
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-mixed-balance-read-and-rwordered-fix branch from 7e99410 to 7415b79 Compare April 15, 2025 12:28
@NitzanMordhai
Copy link
Contributor Author

@athanatos can you please review?

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

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

LGTM.


// If the op is rwordered, strip out the balanced and localized flags.
if (flags & CEPH_OSD_FLAG_RWORDERED) {
ret &= ~(CEPH_OSD_FLAG_BALANCE_READS | CEPH_OSD_FLAG_LOCALIZE_READS);
Copy link
Contributor

Choose a reason for hiding this comment

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

ACK.

Copy link
Contributor

Choose a reason for hiding this comment

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

ACK2.

op->rwordered()) {
dout(4) << __func__ << ": rebalance reads with rwordered not allowed "
<< *m << dendl;
osd->reply_op_error(op, -EINVAL);
Copy link
Contributor

Choose a reason for hiding this comment

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

ACK.

Copy link
Contributor

Choose a reason for hiding this comment

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

As the objecter no longer supports the problematic mixed ops, why are we checking instead of asserting? Is that for the sake of older clients?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i just wanted to be sure: https://tracker.ceph.com/issues/70715#note-13 see the #2

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's for old clients.
You basically have no control over client versions and you need to be ready to handle even misbehaving ones gracefully for long time (this fits particularly well to kernel clients).
Definitely you don't want to assert in such scenario.

@ljflores
Copy link
Member

jenkins test make check

@ljflores
Copy link
Member

Retriggered make check since the logs expired, but there might be a related issue there. We should check if it happens again. In the meantime, marking this ready for QA since it's been approved.

CEPH_OSD_FLAG_LOCALIZE_READS)) &&
op->may_read() &&
!(op->may_write() || op->may_cache())) {
!(op->may_write() || op->may_cache() || op->rwordered())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC the issue is accepting flag of rwordered and balanced reads - which is handled by:
if (m->has_flag(CEPH_OSD_FLAG_BALANCE_READS) && op->rwordered()) above.

Why are we also adding another check here? This will disallow also localized reads with rwordered, is that the intent?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, that one is redundant and will add a new issue for localize.

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-mixed-balance-read-and-rwordered-fix branch from 7415b79 to e18bff7 Compare April 22, 2025 17:43
@NitzanMordhai NitzanMordhai requested a review from Matan-B April 22, 2025 17:43
Copy link
Contributor

@Matan-B Matan-B left a comment

Choose a reason for hiding this comment

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

LGTM - My comment was addressed - #62806 (review)
'
@rzarzynski, would you like to give this another look as you previously reviewed it? Thanks!

This might need a re-build since the PR has changed.

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

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

I'm afraid we stopped doing the error handling for rwordered, localized reads.

op->rwordered()) {
dout(4) << __func__ << ": rebalance reads with rwordered not allowed "
<< *m << dendl;
osd->reply_op_error(op, -EINVAL);
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's for old clients.
You basically have no control over client versions and you need to be ready to handle even misbehaving ones gracefully for long time (this fits particularly well to kernel clients).
Definitely you don't want to assert in such scenario.

@ljflores ljflores requested a review from rzarzynski April 24, 2025 19:48
@ljflores
Copy link
Member

jenkins test make check

@ljflores
Copy link
Member

jenkins test api

@rzarzynski
Copy link
Contributor

@ljflores: the review comments need to be addressed; at the moment merging is blocked.

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-mixed-balance-read-and-rwordered-fix branch from e18bff7 to 0a52f39 Compare April 30, 2025 12:13
@NitzanMordhai
Copy link
Contributor Author

@rzarzynski please review

@ljflores
Copy link
Member

ljflores commented May 5, 2025

Let's put this in a new batch.


// If the op is rwordered, strip out the balanced and localized flags.
if (flags & CEPH_OSD_FLAG_RWORDERED) {
ret &= ~(CEPH_OSD_FLAG_BALANCE_READS | CEPH_OSD_FLAG_LOCALIZE_READS);
Copy link
Contributor

Choose a reason for hiding this comment

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

ACK2.

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-mixed-balance-read-and-rwordered-fix branch from 0a52f39 to 94c4cb4 Compare May 7, 2025 09:25
@ljflores
Copy link
Member

jenkins test api

@ljflores
Copy link
Member

jenkins test make check

Objecter shouldn't sent ops with mixed rwordered and balance_read flags

Fixes: https://tracker.ceph.com/issues/70715
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
… flags

do_op can't accept mixed flag of rwordered and balance_read

Fixes: https://tracker.ceph.com/issues/70715
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-mixed-balance-read-and-rwordered-fix branch from 94c4cb4 to f68b217 Compare May 28, 2025 06:58
@amathuria
Copy link
Contributor

@amathuria
Copy link
Contributor

jenkins test make check arm64

1 similar comment
@SrinivasaBharath
Copy link
Contributor

jenkins test make check arm64

@SrinivasaBharath SrinivasaBharath merged commit edf8b22 into ceph:main Jun 17, 2025
12 checks passed
Matan-B added a commit to Matan-B/ceph that referenced this pull request Jul 15, 2025
…reads

This is the counterpart of ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Matan-B added a commit to Matan-B/ceph that referenced this pull request Jul 15, 2025
…reads

This is the counterpart of ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Matan-B added a commit to ceph/ceph-ci that referenced this pull request Jul 15, 2025
…reads

This is the counterpart of ceph/ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit 18cfa59bc900460d666c5c686499f87e433cc79f)
Matan-B added a commit to ceph/ceph-ci that referenced this pull request Jul 23, 2025
…reads

This is the counterpart of ceph/ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit 18cfa59bc900460d666c5c686499f87e433cc79f)
Matan-B added a commit to Matan-B/ceph that referenced this pull request Jul 27, 2025
…reads

This is the counterpart of ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
stzuraski898 pushed a commit to stzuraski898/ceph that referenced this pull request Jul 29, 2025
…reads

This is the counterpart of ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
zmc pushed a commit to ceph/ceph-ci that referenced this pull request Aug 5, 2025
…reads

This is the counterpart of ceph/ceph#62806
Which fixes classical: https://tracker.ceph.com/issues/70715

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
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