oVirt / vdsm

The Virtual Desktop Server Manager
GNU General Public License v2.0
160 stars 201 forks source link

Fix flapping disk info due to timing differences #369

Closed dupondje closed 1 year ago

dupondje commented 1 year ago

In commit 45903d01e142047093bf844628b5d90df12b6ffb there was code added to refresh the fs info earlier when a hotplug disk was added. Now this caused some side effect that when only that command was triggered, the info dict never contained 'disk.count', which caused us to change the diskMapping to the parsed data from fsinfo.

Some minutes later when the disk command needed to be refreshed, it changed the diskMapping again, because (sometimes) the disks call returns more disks in comparision to the fsinfo call (for ex unmounted disks).

Again a bit later, the fsinfo had to be refreshed, and the diskMapping was modified again.

This occurs continiously, causing the device hash to change every time, and causing an excessive amount of dumpxml's also due to that.

Fixed this by not setting the diskMapping when we have the _QEMU_DISKS_COMMAND in our caps. As this means somewhere else in time this command will refresh the disk info. Also refresh the disk info and not only fs info after a disk hotplug.

Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be Change-Id: I27a30e020a5221237d9d4ae7835a1cc4e69c0c59

dupondje commented 1 year ago

@nyoxi don't know if you want to check this also :)

nyoxi commented 1 year ago

Looks good to me.

dupondje commented 1 year ago

Fixed the test and lint :)

mz-pdm commented 1 year ago

@dupondje, please fix the problems reported by the CI.

mz-pdm commented 1 year ago

Ah, you were faster, great. :-)

mz-pdm commented 1 year ago

/ost

mz-pdm commented 1 year ago

/ost

mz-pdm commented 1 year ago

/ost

mz-pdm commented 1 year ago

Thanks for the fix!