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

do not break refs to blobstorage files #7

Merged
merged 2 commits into from Oct 5, 2018
Merged

do not break refs to blobstorage files #7

merged 2 commits into from Oct 5, 2018

Conversation

frisi
Copy link
Member

@frisi frisi commented Oct 4, 2018

by skipping pickles for ZODB.blob.Blob objects in the rename/convert method blobs do not get broken when running zodbupdate --pack --convert-py3 --file Data.fs

as the record's oid stays the same, and also the old serial should be used when saving it back (see https://github.com/zopefoundation/zodbupdate/blob/1.0/src/zodbupdate/update.py#L84) i don't see why we need to skip them here at all.

i need some help with the test test_blob_pickles_are_left_untouched:

  • skipping/renaming module1.Factory does not work as the class_meta is persistent.mapping.PersistentMapping instead of module1.Factory
  • and i don't know how to prove the database record has not been touched.

by skipping pickles for ZODB.blob.Blob objects
@@ -299,6 +303,10 @@ def rename(self, input_file):

class_meta = self.__update_class_meta(class_meta)

if class_meta in SKIP_TYPES:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using ZODB.blob.is_blob_record as suggested by @jimfulton yesterday would require to obtain input_file data (input_file.seek(0); is_blob_record(input_file.read()))
to me it seems sufficient and more performant to check for the class here as it is already available.

@frisi
Copy link
Member Author

frisi commented Oct 4, 2018

ping @rbu

@thefunny42
Copy link
Member

I am implementing it. Your solution is not enough, there's many formats for the class_meta. The best is to catch when checking if we should rewrite the symbol.

@thefunny42
Copy link
Member

This should do the trick.

Copy link
Member

@icemac icemac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@icemac icemac merged commit 54233b1 into master Oct 5, 2018
@icemac icemac deleted the blobs branch October 5, 2018 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants