Martin Betak has posted comments on this change. Change subject: backend: Add HostDev passthrough support ......................................................................
Patch Set 10: (2 comments) http://gerrit.ovirt.org/#/c/35892/10/packaging/dbscripts/host_device_sp.sql File packaging/dbscripts/host_device_sp.sql: Line 11: v_vm_id UUID) Line 12: RETURNS VOID Line 13: AS $procedure$ Line 14: BEGIN Line 15: SET CONSTRAINTS ALL DEFERRED; > why do you need that ??? As described in the *DRAFT STATUS* comment this line (and others in update/delete procedures) is absolutely essential for reasonably performant updates of devices from host. All it does is to deferr the check of foreign key constrains to the end of transaction. This is done because when we do RefreshHostDevicesCommand we can have some devices changed, some devices newly created and some devices removed. We handle this update in DB by running transaction { saveAllInBatch(newDevices); updateAllInBatch(changedDevices); removeAllInBatch(removedDevices); } But as we get new devices from VDSM in a hash map the order is not defined and doing this straightforward save/update/delete would cause violation of foreign key on first device being inserted before its parent device (or parent removed before child). Alternative to this would be to do expensive topological sort before each DB call on the engine side, but since the DB has to perform the checks anyway we just deferr them to the end of transaction when all updates had already been made, i.e devices && their parents are persisted which passes the foreign key constraint. Line 16: INSERT INTO host_device( Line 17: host_id, Line 18: device_name, Line 19: parent_device_name, http://gerrit.ovirt.org/#/c/35892/10/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql File packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql: Line 251: select fn_db_add_config_value('HostDevicePassthroughSupported','false','3.2'); Line 252: select fn_db_add_config_value('HostDevicePassthroughSupported','false','3.3'); Line 253: select fn_db_add_config_value('HostDevicePassthroughSupported','false','3.4'); Line 254: select fn_db_add_config_value('HostDevicePassthroughSupported','false','3.5'); Line 255: > please replace all the above with Done Line 256: -- by default use no proxy Line 257: select fn_db_add_config_value('SpiceProxyDefault','','general'); Line 258: Line 259: --Handling Install virtualization software on Add Host -- To view, visit http://gerrit.ovirt.org/35892 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5575c0db797d7d04339c4b309bb4325e853ffed Gerrit-PatchSet: 10 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Betak <[email protected]> Gerrit-Reviewer: Alona Kaplan <[email protected]> Gerrit-Reviewer: Arik Hadas <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Martin Betak <[email protected]> Gerrit-Reviewer: Martin Polednik <[email protected]> Gerrit-Reviewer: Shahar Havivi <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
