Skip to content

osdc/Objecter: release an op failed with pool EIO in _op_submit() - #72282

Merged
ronen-fr merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-recalc
Oct 15, 2026
Merged

ronen-fr merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-recalc

Conversation

@ronen-fr

@ronen-fr ronen-fr commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

When _calc_target() returns RECALC_OP_TARGET_POOL_EIO, _op_submit() completed the op with -EIO and returned. The op was never assigned to a session, so it never reached _finish_op(): its throttle budget and the Objecter's reference were leaked, and a resubmitted op (redirect, -EAGAIN) also kept its in-flight count and a stale timeout event. A client that keeps submitting to a pool flagged EIO would eventually block all of its ops in the throttle.

Add _finish_unsent_op() to release these, and track whether the op was counted in inflight_ops so that a first submission is not un-counted.

Also make SplitOp::create() decline to split reads on a pool flagged EIO. Sub-ops would now be freed inside _op_submit() while create() still references them, and a single-op direct read skipped _calc_target(), and with it the EIO check.

Extend LibRadosAio.PoolEIOFlag test to write to the EIO pool from a client with a small objecter_inflight_ops; the writes block if the budget leaks.

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

Looks good with a couple of optional small nits

Comment thread src/osdc/Objecter.cc Resolved
Comment thread src/osdc/Objecter.cc Outdated
_session_op_assign(splitop_session, op);
_maybe_arm_op_timeout(op);
inflight_ops++;
op->inflight_accounted = true;

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.

nit: Given this always needs to be called together with inflight_ops++, would an inline method be better to keep these tied together?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed (and, also - led me to have an additional fix in the PR)

Comment thread src/test/librados/aio_cxx.cc Outdated
not_eio->set_value(eio_ops);
return;
}
unsigned bad = 0;

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.

nit: I'm not keen on the name bad here, perhaps not_eio_count or something might be clearer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree. Fixed.

@ronen-fr
ronen-fr force-pushed the wip-rf-recalc branch 2 times, most recently from b757b46 to 2f132a1 Compare October 1, 2026 14:14
@ronen-fr

ronen-fr commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@JonBailey1993 - apart from the nits, I fixed another missing counter increment. Can you take a second look?
thanks

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

Fixes look good, approved.
Tiny nit with a whitespace oddity one one of the fixes if you want to fix it, but everything looks great, thank you

Comment thread src/test/librados/aio_cxx.cc Outdated
unsigned not_eio_count = 0;
for (unsigned i = 0; i < eio_ops; ++i) {
if (ioctx.write(oid, bl, bl.length(), 0) != -EIO) {
++not_eio_count;

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.

nit: whitespace

When _calc_target() returns RECALC_OP_TARGET_POOL_EIO, _op_submit()
completed the op with -EIO and returned.  The op was never assigned to
a session, so it never reached _finish_op(): its throttle budget and the
Objecter's reference were leaked, and a resubmitted op (redirect,
-EAGAIN) also kept its in-flight count and a stale timeout event.  A
client that keeps submitting to a pool flagged EIO would eventually
block all of its ops in the throttle.

Add _finish_unsent_op() to release these, and track whether the op was
counted in inflight_ops and in the op_active perf counter, so that a
first submission is not un-counted.

add_op_to_splitop_session() counted its op in inflight_ops but left
op_active to _send_op_account(), which a split-read parent never
reaches, while _finish_op() decrements op_active for every op.  The
gauge was thus driven below the real count by each split read, and
_finish_unsent_op(), keyed off the same flag, would do the same.  Count
op_active there as well, so that it tracks inflight_ops.

Also make SplitOp::create() decline to split reads on a pool flagged
EIO.  Sub-ops would now be freed inside _op_submit() while create()
still references them, and a single-op direct read skipped
_calc_target(), and with it the EIO check.

Extend LibRadosAio.PoolEIOFlag test to write to the EIO pool from a client
with a small objecter_inflight_ops; the writes block if the budget
leaks.

Assisted-by: Claude
Signed-off-by: Ronen Friedman <[email protected]>
@jdurgin

jdurgin commented Oct 5, 2026

Copy link
Copy Markdown
Member

Nice straight-forward fix!

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath31-testing-20261006.075505-main.

@amathuria

Copy link
Copy Markdown
Contributor

@ronen-fr
ronen-fr merged commit 8b3bbd2 into ceph:main Oct 15, 2026
16 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.

5 participants