As part of solving #1427104, the constraints between snapshots and base_disks regarding the memory volumes were removed. This was needed to solve a transaction deadlock in RestoreAllSnapshotsCommand. In newer version of Postgres, the locking mechanism will allow this flow to succeed. The constraints to be restored. SELECT fn_db_create_constraint('snapshots', 'fk_snapshots_metadata_disk_id', 'FOREIGN KEY (memory_metadata_disk_id) REFERENCES base_disks(disk_id) ON DELETE SET NULL'); SELECT fn_db_create_constraint('snapshots', 'fk_snapshots_dump_disk_id', 'FOREIGN KEY (memory_dump_disk_id) REFERENCES base_disks(disk_id) ON DELETE SET NULL');
Tal, just to confirm - this is still relevant after your recent work on disk content types, right?
(In reply to Allon Mureinik from comment #1) > Tal, just to confirm - this is still relevant after your recent work on disk > content types, right? Indeed, it is not relevant for that change, we should still go on with restoring the contraints
Tested with the following code: -------------------------------- ovirt-engine-4.2.0-0.6.el7.noarch vdsm-4.20.9-1.el7ev.x86_64 Tested with following scenario: -------------------------------- Run the following on the engine: psql -U postgres engine -c '\d snapshots' Table "public.snapshots" Column | Type | Modifiers -------------------------+--------------------------+------------------------ snapshot_id | uuid | not null vm_id | uuid | not null snapshot_type | character varying(32) | not null status | character varying(32) | not null description | character varying(4000) | creation_date | timestamp with time zone | not null app_list | text | vm_configuration | text | _create_date | timestamp with time zone | default now() _update_date | timestamp with time zone | memory_volume | character varying(255) | memory_metadata_disk_id | uuid | memory_dump_disk_id | uuid | vm_configuration_broken | boolean | not null default false Indexes: "pk_snapshots" PRIMARY KEY, btree (snapshot_id) "idx_snapshots_memory_dump_disk_id" btree (memory_dump_disk_id) "idx_snapshots_memory_metadata_disk_id" btree (memory_metadata_disk_id) "idx_snapshots_snapshot_type" btree (snapshot_type) "idx_snapshots_vm_id" btree (vm_id) Foreign-key constraints: "fk_snapshot_vm" FOREIGN KEY (vm_id) REFERENCES vm_static(vm_guid) "fk_snapshots_dump_disk_id" FOREIGN KEY (memory_dump_disk_id) REFERENCES base_disks(disk_id) ON DELETE SET NULL "fk_snapshots_metadata_disk_id" FOREIGN KEY (memory_metadata_disk_id) REFERENCES base_disks(disk_id) ON DELETE SET NULL Referenced by: TABLE "vm_device" CONSTRAINT "vm_device_snapshot_id_fkey" FOREIGN KEY (snapshot_id) REFERENCES snapshots(snapshot_id) ON DELETE CASCADE Moving to VERIFIED
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.