-
Notifications
You must be signed in to change notification settings - Fork 138
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
Config restore: samba share exports not consistently restored #2847 #2864
Config restore: samba share exports not consistently restored #2847 #2864
Conversation
…ckstor#2847 Account for Share ID native transform requirement re SMB share export. Cross-references, within config-backup file, Share ID used in each SMB export to retrieve prior Share name. Share name is then used to retrieve native DB Share ID for SMB share export restore process. Assumes Share name continuity across config-backup/restore process. Includes: - Incidental additions of more type hinting. - Additional docstrings.
Testing"Backup current config" was used on a system with two SMB shares exported. This restored (replayed) find on the same system as expected. The config backup file was then downloaded, unzipped, and edited to change the ID of one of the associated SMB export shares (both it's canonical storageadmin.share, and its associated storageadmin.sambashare entries) so that it no longer tallied to the local DB instance: BeforeSMB export
Shares
After (Share ID 3 to 13 change)SMB export
Shares
The resulting file was then uploaded and re-played after both SMB share exports were first deleted:
N.B. from the above debug log, the 3 to 13 Share ID (by-hand edit) is evident as we maintain the original field of "share" as the SMB export creation itself only looks to the transitioned Share ID (by name match to target system) within the new field (type list) dictionary entry of N.B. we currently enforce install wide unique Share.name; irrespective of Pool/Pools. |
Here we focus on the restore of the SMB exports, the Rock-on element of the restore mentioned in the associated issue has not been addressed. Changing the PR name accordingly. |
Testing continuedAn rpm was build from the product of this PR. The prior install was used to create multiple shares and associated SMB exports. That install did not have the ROOT pool imported, so had no `home' share (the default for newer installs). A config-back file was created and downloaded from this prior install. On the resulting new/fresh 5.0.11-2864 rpm derived install the ROOT pool was imported before the data pool (which had the prior SMB exported shares): ensuring share ID's would be inconsistent between the prior installs DB dump (config-backup file contents) and the new -2864 rpm derived install DB. Although specific share import order could also affect these. Debug mode was enabled on the new install:
and the prior config-backup file was uploaded: but not yet applied. The test restore of the SMB exports was successful,however the debug log indicated no actual share ID transitions were requiried:
I.e. all The above test was repeated after a hard-reset to wipe the prior DB and this time the ROOT pool was not imported first. We then have the following restore debug log relevant to this issue:
In this second restore test we have succeeded in forcing a DB share ID disparity re prior dump and native import.
|
@phillxnet,
I'm still looking into whether this is the result of improper testing on my end, though... |
That's what it was: a failure to properly test on my end. I fixed my errors and now I can confirm it all restores as it should on my end too. Sorry for the noise and thank you for the fix, @phillxnet! |
@FroggyFlox Thanks for the review. And yes, the testing for this can be tricky: my first (documented) attempt ended up with no transform required. That was a surprise. We are a little corner case on this one, but it looks like that corner is now a little less dark :). I'll merge this ready to begin on the next issue/fix. |
Account for Share ID native transform requirement re SMB share export. Cross-references, within config-backup file, Share ID used in each SMB export to retrieve prior Share name. Share name is then used to retrieve native DB Share ID for SMB share export restore process.
Assumes Share name continuity across config-backup/restore process.
Includes:
Fixes #2847