[ZODB-Dev] Support for graceful ZODB Class renaming

Barry A. Warsaw barry@zope.com
Sun, 19 Jan 2003 12:45:15 -0500


>>>>> "JH" == Jeremy Hylton <jeremy@zope.com> writes:

    JH> Another possibility is to allow lazy upgrades that happen at
    JH> load time.  The storage would need to keep a record of
    JH> register translations: class X.Y.Z is now A.B.C.  The database
    JH> would track those registrations and convert classes on the fly
    JH> when they were loaded.  If a particular storage did reference
    JH> counting on classes, it could delete registrations when all
    JH> instances had been upgraded.

In my experience, these kinds of lazy upgrades never do effectively
garbage collect the conversion snippets.  For example, do you feature
test or version test?  Version tests are simpler ("okay, I renamed
these three classes and added these seven attributes in v9.3") but
then there's always someone who's running a production server on a
beta version that's only got half those changes.  Feature tests are
more exact ("oh, you're still called x.y.z -- let's change that"), but
then it's hard to know when it's safe to remove that upgrade snippet.

In all, I think it's more manageable to have an upgrade script that
makes the changes in one fell swoop.  Yes, this has disadvantages,
like taking the database off-line for the upgrade, but then, it might
be a good thing to have to think twice about doing an upgrade. ;)

There's no perfect solution though.
-Barry