forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 1421c89 expanded the size of a zbookmark_t from 24 to 25 integers which causes any pool that has been resilvered subseqently to the patch to have a "scan" entry in the object directory with 25 integers and to become un-importable by ZFS implementations expecting only 24 integers. This patch is a work-in-progress first cut at a fix. It does two things: first, it creates a new structure, zbookmark_phys_t which represents the desired on-disk format of the bookmark within the directory's "scan" element. Second, it relaxes the size check during import to alow an EOVERFLOW which would otherwise cause the import to fail. A "broken" pool can be fixed by importing and then re-resilvering (scrub, etc.).
- Loading branch information
Showing
4 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
been resilvered subseqently to the patch
- does this mean: Created before the patch and then resilvered after the patch?c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I wasn't more clear, I was pressed for time when I wrote the message. What I meant to say is that pools are effectively broken if they were resilvered after the referenced commit which expanded the size of the bookmark structure.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. Does this also occurs if there is no resilver, only scrub(s)?
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Same thing. Anything that touches 'scan'.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanx for the clarifications.
Tried this commit, but it didn't help me unfortunately. I think my pool is further messed up. I get SPLErrors in the zfeature.c:spa_feature_is_active() function. So I had to hack it to return 0 if feature is async_destroy or empty_bpobj. I'm currently only interested in mounting it read only at this time, so this is ok.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dweeezil I'm glad this was caught. When Prakash and I put together that original patch it didn't occur to us that the zbookmark_t was an on disk structure. As you know most/all of the other on-disk structures include phys as part of their name. I'll take a close look at this one Monday, this needs to be a blocker for 0.6.3. We can't allow changes to the on-disk structure outside the feature flag framework.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dweeezil The phys_t suffix implies an on-disk structure. It would probably be best to rename the existing zbookmark_t to zbookmark_phys_t and then use a different name for what you are calling zbookmark_phys_t.
@behlendorf I agree completely. I am inclined to suggest that we revert the problem patch and bring it back into HEAD as a feature flag. However, we will need a solution to fix pools that have been potentially rendered unimportable by other implementations now that this has made it into HEAD. Doing that will require more than simply reverting, which would leave a number of people stranded.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@behlendorf Once this is fixed, it would be great if the LLNL test farm would try importing pools created by new commits with older ZoL versions to confirm backward compatibility. A few simple file creations, a snapshot and a scrub should be adequate to catch most issues in this category.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryao I've been thinking about this during the day (kind of rushed things earlier when I was pressed for time) and think that the proper solution would be to replace the ddt_bookmark_t and zbookmark_t structs in the dsl_scan_phys_t structure with their members. That would reinforce the notion that dsl_scan_phys is an on-disk structure but that the bookmark-related structures aren't. Then the rather small bits of code that manage the dsl_scan_phys_t structure should be re-worked to pack/unpack these members into their ddt_bookmark_t and zbookmark_t structs as necessary.
I'll re-work this patch in a bit to use this technique which seem to me should obviate the need for both a feature flag and for any new structs at all.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dweeezil That sounds good. However, once that is written, we will need to take it a step further by developing some way to repair pools that have been damaged by this unintended disk-format change. This has been in HEAD long enough that the repercussions of failing to repair the damaged pools would be detrimental to the ZoL project's credibility. I imagine that we will have a more in-depth discussion about this when @behlendorf is available on Monday.
With that said, I have multiple offline matters that require my attention tomorrow, so I will not be able to do much until Monday myself. Whatever you do with this before Monday will likely be the only work done on this until then.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on a patch that removes the zbookmark_t struct from dsl_scan_phys_t. The ddt_bookmark_t could also cause the same problem if it were changed but removing that struct is a pain in the butt.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just uploaded 10fe651 which has ONLY BEEN COMPILE TESTED. I'll be testing it tomorrow.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 10fe651 commit needed further refinement which I'm testing. I'll be posting the next version as a pull request in order to get it into the issue tracker.
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on a testpool, and yes i can import a repaired pool with 0.6.1. Looks ok. Are there more sideeffects on this issue?
c5223f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pyavdr Make sure you're using 2168d69 (from openzfs#2097) rather than one of the older ones. My second patch, 10fe651 didn't fully implement the compatibility shim (and would actually overwrite memory). You can use
zdb -dddd tank 1 | grep scan | sed -e 's;scan = ;;' | wc -w
(replace "tank" with your pool name) to tell whether your pool is broken. It should print 24. Broken pools will print 25.