Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine: Fix duplicate VM backup entry error when creating incremental backup #948

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

BrooklynDewolf
Copy link
Contributor

@BrooklynDewolf BrooklynDewolf commented Jun 6, 2024

Fixes an issue that originates from ed023e5

Changes introduced with this PR

  • Fixes the following error when creating an incremental backup:
    ERROR [org.ovirt.engine.core.bll.storage.backup.HybridBackupCommand] (default task-1) [full_cold_vm_backup] Command 'org.ovirt.engine.core.bll.storage.backup.HybridBackupCommand' failed: CallableStatementCallback; SQL [{call insertvmbackup(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "vm_backups_pkey" Detail: Key (backup_id)=(1733241d-4a0b-4205-9e52-5383eb7a82f2) already exists.

Are you the owner of the code you are sending in, or do you have permission of the owner?

y

… backup

Fixes an issue that originates from oVirt@ed023e5

 The following error occured when trying to create an incremental backup:

 ------
 ERROR [org.ovirt.engine.core.bll.storage.backup.HybridBackupCommand] (default task-1) [full_cold_vm_backup] Command 'org.ovirt.engine.core.bll.storage.backup.HybridBackupCommand' failed: CallableStatementCallback; SQL [{call insertvmbackup(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "vm_backups_pkey"
   Detail: Key (backup_id)=(1733241d-4a0b-4205-9e52-5383eb7a82f2) already exists.
 -----

 This was caused by using vmBackupDao.save() instead of vmBackupDao.update(), because the backup already existed when the setVmBackupSnapshot method is executed.

Signed-off-by: Brooklyn Dewolf <contact@brooklyn.gent>
@sandrobonazzola
Copy link
Member

/ost

Copy link
Member

@dupondje dupondje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The save call tries to create a new one instead of updating it with the snapshotID.
update is the call to run indeed!

Thx @BrooklynDewolf

@sandrobonazzola sandrobonazzola merged commit 40a9a01 into oVirt:master Jun 6, 2024
3 checks passed
@BrooklynDewolf BrooklynDewolf deleted the fix/backup_failure branch June 6, 2024 13:54
@BrooklynDewolf BrooklynDewolf mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants