Skip to content

os/bluestore: Support flock retry - #34566

Merged
tchaikov merged 1 commit into
ceph:masterfrom
X0Ken:master
Aug 28, 2020
Merged

tchaikov merged 1 commit into
ceph:masterfrom
X0Ken:master

Conversation

@X0Ken

@X0Ken X0Ken commented Apr 15, 2020 •

Copy link
Copy Markdown
Contributor

bluestore: Support flock retry

When the block changes, systemd-udevd will open the block,
read some information and close it. Then a failure occurs here.
So we need to try again here.

Fixes: https://tracker.ceph.com/issues/46124
Signed-off-by: wanghongxu [email protected]

Checklist

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

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@X0Ken X0Ken changed the title osd: Support flock retry bluestore: Support flock retry Apr 17, 2020
@ifed01 ifed01 changed the title bluestore: Support flock retry os/bluestore: Support flock retry Apr 20, 2020
@ifed01

ifed01 commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

@X0Ken - it would be nice to have a rationale for this fix attached to the commit.

@tchaikov

tchaikov commented May 1, 2020

Copy link
Copy Markdown
Contributor

@X0Ken ping?

@X0Ken

X0Ken commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

2020-04-16T21:11:35.389+0800 7f7e712d2bc0 -1 bluestore(/root/ceph/build/dev/osd2/block) _read_bdev_label failed to open /root/ceph/build/dev/osd2/block: (2) No such fil
e or directory
2020-04-16T21:11:35.390+0800 7f7e712d2bc0 -1 bluestore(/root/ceph/build/dev/osd2/block) _read_bdev_label failed to open /root/ceph/build/dev/osd2/block: (2) No such fil
e or directory
2020-04-16T21:11:35.390+0800 7f7e712d2bc0 -1 bluestore(/root/ceph/build/dev/osd2/block) _read_bdev_label failed to open /root/ceph/build/dev/osd2/block: (2) No such fil
e or directory

@X0Ken

X0Ken commented May 7, 2020

Copy link
Copy Markdown
Contributor Author

The systemd-dbus read device causes the osd fail to lock, try again here

@ifed01

ifed01 commented Jul 8, 2020

Copy link
Copy Markdown
Contributor

@X0Ken - I think this PR makes sense - I'm able to repro the issue and fix it with your patch.
Could you please rebase and add "Fixes: https://tracker.ceph.com/issues/46124" claim to both commit and PR descriptions.

Comment thread src/common/options.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.

May be make this default a bit higher, e.g. 1 sec?

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.

In my test, 0.1 seconds is enough, I don’t know how it is on your side.

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

This change just retries on the lock.

Please add an explanation why this is the correct thing to do.

In https://tracker.ceph.com/issues/46124 I do a detailed system call analysis and from that it isn't even clear why the problem arises (why EAGAIN occurs at all, given the access pattern). Further, it is unclear whether or not there should be contention.

Separately, if contention is expected, does it make sense to bound the number of retries to 3, or is it arbitrary? That seems like it would sometimes work, and sometimes not.

I would like to understand whether this is intended a proper fix of the underlying problem, or a "well just try 3 times to make my cluster work" workaround.

The answer to that should be as a comment in the code, and if it's just a workaround, it should says so explicitly, so that it's clear that https://tracker.ceph.com/issues/46124 should be kept open untlil the underlying problem is fixed. It should then also say that the added settings bdev_flock_retry_interval and bdev_flock_retry are temporary knobs likely to be removed in the future when the underlying problem is fixed.

(Just to be clear, I appreciate even a workaround like this for now, given that the bug blocks me from upgrading beyond Ceph 13, but the code should be clear on the workaround vs fix question.)

Comment thread src/blk/kernel/KernelDevice.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.

Why this correct, don't you need to save the errno value explicilty?

Unless I'm mistaken, derr << may reset the errno to some other value.

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.

@X0Ken i concur with @nh2 on this. errno could be reset before it is returned.

When the block changes, systemd-udevd will open the block,
read some information and close it. Then a failure occurs here.
So we need to try again here.

Fixes: https://tracker.ceph.com/issues/46124
Signed-off-by: wanghongxu <[email protected]>
@nh2

nh2 commented Sep 14, 2020

Copy link
Copy Markdown
Contributor

errno could be reset before it is returned.

@tchaikov From what I can tell, this was not addressed, but the PR was merged anyway. Is that correct?

Also, there was no discussion on whether this is now a real fix or a probabilistic workaround (#34566 (review)), and to me, just trying 3 times, is not a real fix. Yet the bug https://tracker.ceph.com/issues/46124 asking for a real fix was auto-closed by this PR.

@tchaikov

Copy link
Copy Markdown
Contributor

@nh2 hi Niklas, i agree with you. that comment was not addressed. and this is not desired.

and to me, just trying 3 times

hmm, this does not sound right to me.

@ifed01 , Igor, what do you think?

i will try to read your analysis tomorrow to understand this issue better. also i reopened https://tracker.ceph.com/issues/46124, just to make sure we get this issue addressed instead of get it covered.

@tchaikov

Copy link
Copy Markdown
Contributor

@nh2 after a second thought, i think this change does make sense, albeit not perfect in the sense of returning a wrong errno. i have a follow-up fix at #37153

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