Skip to content

Commit ce1fd9a

Browse files
author
gitlab
committed
Merge branch 'fix/ZSTAC-82069' into '5.5.6'
<fix>[pciDevice]: fix orphan GpuDeviceSpecVO cleanup and query pagination See merge request zstackio/zstack!9143
2 parents f9af997 + 748c77a commit ce1fd9a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

conf/db/upgrade/V5.5.6__schema.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,18 @@ END$$
175175
DELIMITER ;
176176
CALL UpgradeApplicationDevelopmentServiceVersion();
177177
DROP PROCEDURE IF EXISTS UpgradeApplicationDevelopmentServiceVersion;
178+
179+
-- ZSTAC-82069: Clean up orphan GpuDeviceSpecVO records where parent spec type is not GPU
180+
-- Root cause: ZSTAC-81489 fixed GPU detection on Agent side, but didn't handle cleanup of
181+
-- stale GpuDeviceSpecVO records when device type changed from GPU to Generic.
182+
-- GpuDeviceSpecVO is a child table of PciDeviceSpecVO using @PrimaryKeyJoinColumn inheritance.
183+
-- Only GPU-type specs should have corresponding records in GpuDeviceSpecVO.
184+
DELETE g FROM GpuDeviceSpecVO g
185+
INNER JOIN PciDeviceSpecVO p ON g.uuid = p.uuid
186+
WHERE p.type NOT IN (
187+
'GPU_Video_Controller',
188+
'GPU_3D_Controller',
189+
'GPU_Processing_Accelerators',
190+
'GPU_Co_Processor',
191+
'GPU_Communication_Controller'
192+
);

0 commit comments

Comments
 (0)