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

work around failure of udev to observe btrfs device add. Fixes #1606 #1607

Conversation

phillxnet
Copy link
Member

In some rare instances it is possible for udev and lsblk to fail to reflect the current state of a pools disk members. This was initially observed while testing btrfs in partition device members in issue #1494, however the same has now been reproduced using whole disk members.

Please see issue #1606 for examples of where this discrepancy was observed and the subsequent testing of 'udevadmin trigger' to cause udev and lsblk to again reflect the current state of btrfs pools. All proof was via command line to isolate any Rockstor mechanisms.

This pr creates a simple wrapper around 'udevadmin trigger' and calls this directly after a pool resize action is requested to add one or more devices. The call method mimics that of resize_pool() for consistency. Exception handling was tested by substituting a nonsense command, in this scenario a user visible error was returned.

Fixes #1606

This pr was made against current master and a fresh build was used for testing.

This was found to be required to ensure lsblk and udev info
was successfully updated after a btrfs device add command.
The failed state of stale info was only rarely observed but
was reproduced a number of times using both whole and
partition pool members.
@phillxnet
Copy link
Member Author

Ready for review.

@schakrava
Copy link
Member

Sorry for taking so long to test this. I am really impressed with the amount of detail in the issue and code. Nicely done @phillxnet

@schakrava schakrava merged commit 4e0f28b into rockstor:master Jan 15, 2017
@phillxnet phillxnet deleted the 1606_work_around_failure_of_udev_to_observe_btrfs_device_add branch January 15, 2017 17:28
@phillxnet
Copy link
Member Author

@schakrava Thanks and Cheers. Took a while to track this one down so at least we have the notes here if it ever need to be refined.

@schakrava
Copy link
Member

If there's anyone who can track down such things, it's you!

@phillxnet phillxnet mentioned this pull request May 15, 2017
phillxnet added a commit to phillxnet/rockstor-core that referenced this pull request May 19, 2017
Intermittent failure of udev to update fstype, label,
and uuid of dev after pool creation (1-2 times in 10)
was observed for a luks mapped device. After this
udev call no similar failures were observed. Also
prior to patch many mount by label fails were observed
with consequent fail-over mounts by dev, but with no
consequent dev info updates the pool was not recognized
by our UI. Where as after this patch no failures to mount
by label were observed in the test scenarios. This same
treatment has already been applied to adding disks to an
existing pool in pr rockstor#1607 commit:
0358560
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants