Mike Kolesnik has posted comments on this change.

Change subject: core: macPool per DC, db changes
......................................................................


Patch Set 33:

(2 comments)

http://gerrit.ovirt.org/#/c/26795/33/packaging/dbscripts/upgrade/03_05_0720_add_mac_pool_ranges_to_storage_pool.sql
File 
packaging/dbscripts/upgrade/03_05_0720_add_mac_pool_ranges_to_storage_pool.sql:

Line 21:                       name,
Line 22:                       allow_duplicate_mac_addresses,
Line 23:                       description,
Line 24:                       default_pool)
Line 25: SELECT uuid_generate_v1(),
> you can store uuid_generate_v1() into a local variable and reuse it when is
It's plain SQL, how can this be done?

PG/PLSQL as an upgrade script is much worse than plain SQL, very hard to debug 
and execute manually..
Line 26:        'Default',
Line 27:        (SELECT option_value :: BOOLEAN
Line 28:         FROM   vdc_options
Line 29:         WHERE  option_name = 'AllowDuplicateMacAddresses'),


Line 34: INSERT INTO mac_pool_ranges (mac_pool_id,
Line 35:                        from_mac,
Line 36:                        to_mac)
Line 37: SELECT (SELECT id FROM mac_pools),
Line 38:        mac_range[1],
> +1, the mac pool range should have been validated when it was inserted into
Yes my original thinking was because this validation didn't exist for < 3.3 but 
then the engine wouldn't start so it makes 99% sense not to check this.

If for some reason one would be trying to update from a broken system then this 
update would fail, but that is a highly unlikely (albeit possible) case.
Line 39:        mac_range[2]
Line 40: FROM (SELECT   string_to_array(unnest(string_to_array(option_value, 
',')),'-') as mac_range
Line 41:         FROM   vdc_options
Line 42:         WHERE  option_name = 'MacPoolRanges') as mac_ranges;


-- 
To view, visit http://gerrit.ovirt.org/26795
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id30f3c384ecf933daaacdbdd6542e88afb98f7ca
Gerrit-PatchSet: 33
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to