Ticket #1068 (closed defect: fixed)
Build history pickles are perpetually re-upgraded
| Reported by: | exarkun | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.8.3 |
| Version: | 0.8.2 | Keywords: | |
| Cc: |
Description
Whenever an out of date build history pickle is loaded, if it isn't the latest version, it is upgraded. Unfortunately, if nothing about the state is changed (as is frequently the case), the upgraded version is discarded and the upgrade is re-done the next time that pickle is loaded.
Instead, if the state is upgraded, the pickle should be re-written with the upgraded state. This can be done by marking upgraded objects using a simple flag, set to True by any upgradeToVersionN method, and then checked after styles.doUpgrade is called. If and only if the flag is set, the object was upgraded and should be rewritten. Additionally, adding the flag to the persistenceForgets tuple on the Versioned subclass will cause it to be discarded when the object is re-serialized.
Change History
comment:1 Changed 2 years ago by dustin
- Type changed from undecided to defect
- Milestone changed from undecided to 0.8.3
comment:2 Changed 2 years ago by Dustin J. Mitchell
- Status changed from new to closed
- Resolution set to fixed
detect when Versioned objects are upgraded, and re-write pickle
This should cut down on the number of log messages about pickles being upgraded. Fixes #1068
Changeset: 95f33ad1bd65b5fa06e0fc4614830b1cb04d52db
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
as for knowing that sub-objects have been updated: