Code review comment for lp:~dimitern/juju-core/300-lp-1174610-unit-ids-unique

Revision history for this message
Roger Peppe (rogpeppe) wrote :

On 2014/02/17 16:44:18, dimitern wrote:
> Please take a look.

Looks reasonable, but I'm concerned that it can't be applied
until we have mongo-schema-upgrade capability, which might be
a while off yet.

How about making the schema change backwardly compatible?

For example, when a service is created, we mark it with a "uses global
sequence numbering" flag
(this will be false in already existing services).
When a service is destroyed that doesn't have that flag set, we could
update the sequences collection
with the most recent unit number for that service.
When a unit is created, if allocates it from the service sequence number
unless the "uses global sequence" flag is set
in which case it allocates it using the sequences collection.

In that way, we can remain compatible with the old schema but update to
the new schema over time.

Eventually we can delete the flag and its associated logic when we don't
need to support 1.16
environments (assuming this fix goes into 1.18)

https://codereview.appspot.com/64890044/

« Back to merge proposal