Page MenuHomePhabricator

revision retention policy schema migration
Closed, ResolvedPublic


With the completion of T94524 it is possible to specify a schema-defined retention policy for MVCC revisions. Before this change can be applied to production however, it must first be possible to migrate this aspect of schema.


In this iteration, an integer version attribute will be introduced to schema. Existing schemas, those that do not explicitly specify a version, will be treated as version 0. Any new schema migration will depend upon an explicitly defined version that is greater than or equal to 1. Subsequent versions must have a version number that is monotonically increasing.


Currently, a hash of the normalized schema is compared to the persisted copy to determine if any change has occurred, and an exception is raised if it has. This will be altered to make an attribute-by-attribute comparison, and for each differing attribute, an attribute-specific handler will be invoked. These handlers will accumulate schema changes, and the full schema will be validated before applying it as a single update of the persisted copy.

For this iteration, only a revision retention policy migration handler will be implemented, the remaining attributes will continue to require strict equality; Handlers for other migrations (attributes, secondary indexes, etc), are out of scope for this issue.