Project

General

Profile

Bug #24368

Fix import of degraded pool

Added by Sean Vetter almost 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Important
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

vmware

ChangeLog Required:
No

Description

Version: Freenas 11-RC3
Problem:
If a volume is degraded it does't seem like the gui will allow you to import things.
Below is the repro steps I did in a vm. You can import the volume using the cli but
who wants to mess with that nonsense. ;)
Setup: all using the old gui
------
1. Create a raidz1 volume
2. Offline one of the disks and wipe it using the gui just to be sure
3. detach the volume using the gui
4. in the gui select import volume
5. the current volume does not populate the selection box for importing.

[root@freenas ~]# zpool import
pool: tank2
id: 15029607845106397866
state: DEGRADED
status: One or more devices are offlined.
action: The pool can be imported despite missing or damaged devices. The
fault tolerance of the pool may be compromised if imported.
config:

tank2                                           DEGRADED                                                                    
raidz1-0 DEGRADED
gptid/d8e9012e-4a32-11e7-af8f-000c29422bce ONLINE
gptid/da57ff3a-4a32-11e7-af8f-000c29422bce ONLINE
9009757885668294807 OFFLINE
[root@freenas ~]# zpool import tank2
[root@freenas ~]# zpool status tank2
pool: tank2
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: none requested
config:
NAME                                            STATE     READ WRITE CKSUM                                                  
tank2 DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
gptid/d8e9012e-4a32-11e7-af8f-000c29422bce ONLINE 0 0 0
gptid/da57ff3a-4a32-11e7-af8f-000c29422bce ONLINE 0 0 0
9009757885668294807 OFFLINE 0 0 0 was /dev/gptid/db87b16b-4a32-11e7-af8f-000c29422
bce

errors: No known data errors

Associated revisions

Revision b86dbf64 (diff)
Added by William Grzybowski almost 4 years ago

fix(notifier): getting path should not be fatal if pool is not imported This fixes importing degraded pools. Ticket: #24368

Revision 1e78f384 (diff)
Added by William Grzybowski almost 4 years ago

fix(notifier): getting path should not be fatal if pool is not imported This fixes importing degraded pools. Ticket: #24368 (cherry picked from commit b86dbf64172a4e98f069a27c7ee570be100a9481)

Revision 92e98e29 (diff)
Added by William Grzybowski almost 4 years ago

fix(notifier): getting path should not be fatal if pool is not imported This fixes importing degraded pools. Ticket: #24368

History

#1 Updated by William Grzybowski almost 4 years ago

  • Status changed from Unscreened to Screened
  • Priority changed from No priority to Important
  • Target version set to 11.0-U1

#2 Updated by Rickard von Essen almost 4 years ago

A quick and dirty patch that allows you to import degraded volumes:

diff --git a/gui/middleware/zfs.py b/gui/middleware/zfs.py
index 1ef1f6cb1..e1250f030 100644
--- a/gui/middleware/zfs.py
+++ b/gui/middleware/zfs.py
@@ -398,12 +398,13 @@ class Dev(Tnode):
             elif self.status == 'ONLINE':
                 log.warn("It should be a valid device: %s", self.name)
                 self.disk = self.name
-            elif self.name.isdigit():
+            elif self.name.isdigit() and self.status != 'OFFLINE':
                 pool = self
                 while getattr(pool, 'parent', None):
                     pool = pool.parent
                 # Lets check whether it is a guid
                 vdev = libzfs.ZFS().get(pool.name).vdev_by_guid(int(self.name))
+
                 if vdev:
                     self.path = vdev.path

(No guarantees...)

#3 Updated by Vaibhav Chauhan almost 4 years ago

  • Target version changed from 11.0-U1 to 11.0-U2

#4 Updated by William Grzybowski almost 4 years ago

  • Status changed from Screened to Needs Developer Review
  • Assignee changed from William Grzybowski to Suraj Ravichandran

#5 Updated by Vaibhav Chauhan almost 4 years ago

  • Target version changed from 11.0-U2 to 11.0-U3

#6 Updated by Suraj Ravichandran over 3 years ago

  • Status changed from Needs Developer Review to Reviewed by Developer
  • Assignee changed from Suraj Ravichandran to William Grzybowski
  • % Done changed from 0 to 100

Reviewed this and looks good, but request testing on this.

Also, @RE this is prior to new releng process so please treat as the same.

Thanks.

#7 Updated by Vaibhav Chauhan over 3 years ago

please publish your changes in a PR which will be merged against stable branch, also please let us know here when you have PR ready.

#8 Updated by Vaibhav Chauhan over 3 years ago

  • Status changed from Reviewed by Developer to 47

please disregard my earlier request, I am using FIX branch.

#9 Updated by Dru Lavigne over 3 years ago

  • Subject changed from Can't import a degraded volume to Fix import of degraded pool

#10 Updated by Joe Maloney over 3 years ago

  • Assignee changed from William Grzybowski to Bonnie Follweiler

#11 Updated by Bonnie Follweiler over 3 years ago

We will not be able to test this until https://bugs.freenas.org/issues/25714 is addressed

#12 Updated by Bonnie Follweiler over 3 years ago

  • Status changed from 47 to Ready For Release
  • Assignee changed from Bonnie Follweiler to William Grzybowski
  • Needs QA changed from Yes to No
  • QA Status Test Passes added
  • QA Status deleted (Not Tested)

#13 Updated by Dru Lavigne over 3 years ago

  • Status changed from Ready For Release to Resolved

Also available in: Atom PDF