Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osdc/Objecter: no need null pointer check for op->session anymore #25230

Merged
merged 1 commit into from Dec 5, 2018

Conversation

runsisi
Copy link
Contributor

@runsisi runsisi commented Nov 23, 2018

9a5651b refactored the resend logic for linger op, op->session should be assigned by _recalc_linger_op_target if resend is needed

Signed-off-by: runsisi luo.runbing@zte.com.cn

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

@runsisi
Copy link
Contributor Author

runsisi commented Nov 23, 2018

@liewegas since _recalc_linger_op_target could not handle the paused case, i.e., LingerOp::target.paused never touched by anyone (see Objecter::_send_linger), then the following bug exists

  1. ceph osd pause
  2. rados watch -p pool oid
  3. ceph osd unpause
  4. then the linger op will be in a lost state, i.e., osd op cancelled and linger op never resend

but i don't know how to fix it properly :(

@runsisi
Copy link
Contributor Author

runsisi commented Nov 24, 2018

@liewegas i try to fix the bug described above in this pr: #25243, thanks :)

@tchaikov
Copy link
Contributor

retest this please

@@ -1328,15 +1328,6 @@ void Objecter::handle_osd_map(MOSDMap *m)
for (list<LingerOp*>::iterator p = need_resend_linger.begin();
p != need_resend_linger.end(); ++p) {
LingerOp *op = *p;
if (!op->session) {
Copy link
Member

Choose a reason for hiding this comment

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

So _recalc_linger_op_target() invokes _session_linger_op_assign(), but only if _get_session() had a different answer than previously — and one of the allowed answers is "homeless". It looks to me like a newly-homeless op can still be put on the need_resend_linger list?
Although since this code doesn't handle that either, maybe it's not the case. Can we at least add an assert(session);?

Copy link
Contributor Author

@runsisi runsisi Nov 27, 2018

Choose a reason for hiding this comment

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

_recalc_linger_op_target only gets called by Objecter::_scan_requests which assures the checked linger op always has a OSDSession associated with it, and in _recalc_linger_op_target if _get_session has a different answer then it will assign a different (non-null) session.

It looks to me like a newly-homeless op can still be put on the need_resend_linger list?

yes, it's perfectly valid, so in Objecter::handle_osd_map before resending the linger op we have a homeless check.

Can we at least add an assert(session);?

sure :)

@liewegas
Copy link
Member

@runsisi can you open a tracker ticket for this?

@runsisi
Copy link
Contributor Author

runsisi commented Nov 27, 2018

@liewegas this pr is just a cleanup, i do not have the pemission to change the pr's label from bugfix to cleanup :(

the related bugfix is in this pr: #25243, please review, thanks~
and i have created a ticket for it: http://tracker.ceph.com/issues/37398

@tchaikov tchaikov added cleanup and removed bug-fix labels Nov 27, 2018
9a5651b refactored the resend logic for linger op, op->session should be
assigned by _recalc_linger_op_target if resend is needed

Signed-off-by: runsisi <luo.runbing@zte.com.cn>
@tchaikov
Copy link
Contributor

@gregsfortytwo is this change good to merge?

Copy link
Member

@gregsfortytwo gregsfortytwo left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Greg Farnum gfarnum@redhat.com

@gregsfortytwo
Copy link
Member

Oh but the commit should be amended to include

Fixes: http://tracker.ceph.com/issues/37398

before we merge! :)

@tchaikov
Copy link
Contributor

tchaikov commented Dec 1, 2018

@runsisi @gregsfortytwo i think it's #25243 which addresses http://tracker.ceph.com/issues/37398, right?

@runsisi
Copy link
Contributor Author

runsisi commented Dec 2, 2018

@tchaikov yeah, this is pr is just a cleanup :)

and i will update the other one later~

@tchaikov
Copy link
Contributor

tchaikov commented Dec 3, 2018

@gregsfortytwo good to merge?

@gregsfortytwo
Copy link
Member

Yeah sorry for my confusion there.

@gregsfortytwo gregsfortytwo merged commit dca5001 into ceph:master Dec 5, 2018
@runsisi runsisi deleted the wip-cleanup-objecter branch December 6, 2018 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants