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

detached disks used in mount command #1422

Closed
phillxnet opened this Issue Aug 15, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@phillxnet
Member

phillxnet commented Aug 15, 2016

Thanks to @g6094199 in the forum for reporting this. It may be that we should simply skip all attempts to mount a 'detached' device by simply parsing it's name first and using the existing fail over mechanism of trying each of the other devices in a pool in turn. In the reporters circumstance this occurred after a 'btrfs device delete' command and the resulting pool was reported healthy. An NFS share creation via Web-UI was then attempted.

Please update the following forum thread with significant development on this issue:
https://forum.rockstor.com/t/error-running-a-command-cmd/1928

@schakrava schakrava added the bug label Mar 24, 2017

@schakrava schakrava added this to the Point Bonita milestone Mar 24, 2017

@phillxnet

This comment has been minimized.

Show comment
Hide comment
@phillxnet

phillxnet Jun 16, 2017

Member

An additional note here is that we already avoid mounting a pool by a detached device by first checking if the resulting dev path exists:
if (os.path.exists(mnt_device)):
However this is for pool mounts. We don't yet do the same for share mounts. Also note that the original reports in the referenced forum thread confirms this as the logged mount failure involving the detached devices is that used in fs/btrfs.py/mount_share, ie it constitutes a subvolume mount command.

It is proposed that we similarly filter out the detached devices when mounting a sub volume. This should also allow for sub volume mounts on degraded pools.

Member

phillxnet commented Jun 16, 2017

An additional note here is that we already avoid mounting a pool by a detached device by first checking if the resulting dev path exists:
if (os.path.exists(mnt_device)):
However this is for pool mounts. We don't yet do the same for share mounts. Also note that the original reports in the referenced forum thread confirms this as the logged mount failure involving the detached devices is that used in fs/btrfs.py/mount_share, ie it constitutes a subvolume mount command.

It is proposed that we similarly filter out the detached devices when mounting a sub volume. This should also allow for sub volume mounts on degraded pools.

@phillxnet

This comment has been minimized.

Show comment
Hide comment
@phillxnet

phillxnet Jun 24, 2017

Member

I am now looking into this issue's resolution.

Member

phillxnet commented Jun 24, 2017

I am now looking into this issue's resolution.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 25, 2017

custom Disk model manager to exclude detached disks #1422
Allows for Pool.disk_set.attached() to replace
Pool.disk_set.all() where detached disks are not appropriate.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 26, 2017

update disk state prior to pool state on bootstrap #1422
Extends CommandView class to enable
DiskMixin._update_disk_state() calls. Then we ensure
up-to-date disk info just prior to initial pool state
refresh.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 27, 2017

fix bug in parted dev snapshot rollback via Disk.target_name #1422
By using disk.name directly the snapshot mount will fail if
the first device in the pool is partitioned. Resolve by
using recent Disk.target_name model enhancement.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 27, 2017

use only attached dev for share, snap, and snap rollback #1422
Previously the first share/pool device was selected. Here we
constrain our use to attached devices only: contributing to
degraded pool mount functionality.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 27, 2017

exclude detached disks in pool mount function #1422
In part redundant as given detached disks have no dev
filesystem counterpart they would be excluded anyway.
But by excluding earlier we avoid now redundant os
calls. Basic log improvement also added.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 27, 2017

avoid detached device use in bootstrap #1422
Includes skipping pool/share update attempts on
pools with only detached devices as members. This
reduces false bootstrap retry attempts and enables
greater robustness on boot.
Logging added in cases where a pool mount is
circumvented (ie pools with no attached members).
Plus additional comments.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jun 28, 2017

add 'setup' delay for bootstrap APIWrapper #1422
On 2 sets of roughly 10 consecutive reboots, one set
pre and one set post patch, the prior arrangement (no
delay) took 2 'tries' to complete successfully on 100%
of the boots; ie always failed on the first attempt.
After the additional delay was introduced 100% of the
boots did not produce an exception: completing the
'try' block on the first attempt.

@schakrava schakrava closed this in #1745 Jun 29, 2017

schakrava added a commit that referenced this issue Jun 29, 2017

Merge pull request #1745 from phillxnet/1422_detached_disks_used_in_m…
…ount_command

detached disks used in mount command. Fixes #1422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment