<div dir="ltr"><div>Hello Balazs:</div><div><br></div><div>About the group_id, I see this is built using the port_id and the qos_rules. We have all of this in the DB and we can build it statically (I think so, maybe I'm very optimistic).</div><div><br></div><div>About the code, that was something I was thinking about after sending the last mail. For at least two releases, we need to support both RP formats in the DB. If we read only the UUID (old format), then we should convert it and store it in the new format.</div><div><br></div><div>About the migration, we don't support contract migrations anymore. But this is not true as we have done some migrations that have added new restrictions in the DB schema. In any case, this could be done as an expansion migration. If the code is in place, I don't see any problem of doing this migration with the server running. Each "ml2_port_bindings" register will be updated atomically, while the Neutron server will be able to handle both versions.</div><div><br></div><div>Regards.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 22, 2021 at 3:44 PM Balazs Gibizer <balazs.gibizer@est.tech> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On Tue, Sep 21 2021 at 06:30:46 PM +0200, Rodolfo Alonso Hernandez <br>
<<a href="mailto:ralonsoh@redhat.com" target="_blank">ralonsoh@redhat.com</a>> wrote:<br>
> Hello Balazs:<br>
> <br>
> Sorry for the late reply, I was on PTO.<br>
> <br>
> If I'm not wrong, now port['binding:profile']['allocation'] is a UUID <br>
> and you need it to be a list of UUIDs. Am I correct?<br>
<br>
It is a bit more complicated than that. The old value is a single RP <br>
UUID. the new value is a dict where the key is the group_id and the <br>
value is the RP UUID fulfilling that group. So the transformation needs <br>
to access to the group_id.<br>
The group_id is a stable UUID generated by neutron server as part of <br>
the port.resource_request value, but it is not persisted.<br>
<br>
> <br>
> To make this change in the DB you should use the Alembic migrations, <br>
> as you said. That should ensure all registers are translated. We <br>
> should also include a sanity check to ensure the DB migration was <br>
> done correctly.<br>
<br>
I'm not 100% sure but I think such data migration can only be done in <br>
the contract part as it needs to be done while the neutron server is <br>
down as the old code can only use the old data format while the new <br>
code can only use the new format. Is it OK to introduce a new contract <br>
migration in Yoga in neutron?<br>
<br>
Cheers,<br>
gibi<br>
<br>
<br>
> <br>
> Is that what you needed? Don't hesitate to ping me in IRC if needed.<br>
> <br>
> Regards.<br>
> <br>
> On Fri, Sep 10, 2021 at 6:06 PM Balazs Gibizer <br>
> <balazs.gibizer@est.tech> wrote:<br>
>> Hi Neutrinos!<br>
>> <br>
>> We found a technical challenge during implementing the<br>
>> port-resource-request-groups API extension[1]. That extension <br>
>> changes<br>
>> the format of the port.resoruce_request as well as the format of the<br>
>> port.binding:profile.allocation. The former is a calculated field on<br>
>> the port so that is easy. However the bindig:profile is persisted in<br>
>> the database so data migration is needed. What is the canonical way <br>
>> to<br>
>> do such DB data translation in Neutron? Can we translate the data in<br>
>> place during alembic migration? Or should we do some kind of online<br>
>> data migration when the data is translated by neutron when it is <br>
>> read<br>
>> from the db?<br>
>> <br>
>> cheers,<br>
>> gibi<br>
>> <br>
>> [1] <a href="https://review.opendev.org/c/openstack/neutron/+/805637/5" rel="noreferrer" target="_blank">https://review.opendev.org/c/openstack/neutron/+/805637/5</a><br>
>> <br>
>> <br>
>> <br>
<br>
<br>
</blockquote></div>