Skip to content

Record still left in snapshot_store_ref after primary storage has been removed causing 530 when listSanpshots is called #7093

Closed

Description

@davidjumani
ISSUE TYPE
  • Bug Report
COMPONENT NAME

Storage

CLOUDSTACK VERSION

4.17.2 (maybe before as well)

OS / ENVIRONMENT

VMware 6.7.3

SUMMARY

When a primary storage is deleted, the corresponding record in the snapshot_store_ref table is not deleted
Noted specifically in VMware

STEPS TO REPRODUCE
  • Take ROOT volume snapshot(This primary storage is Storage1.)
  • Migrate ROOT volume to other storage(as Storage2) with the API - migrateVirtualMachine -
  • Confirm the snapshot has two entries in cloud.snapshot_store_ref - one for primary and one for image.
  • Then remove Storage1.
  • Confirm that two entries remain in cloud.snapshot_store_ref.
  • Do a listSnapshots API call against the snapshot and observe Error:(HTTP 530, error code 9999) - Due to an NPE in the DB record refering to the deleted storage pool
EXPECTED RESULTS

The record in the table pointing to the now deleted primary storage is still present

ACTUAL RESULTS

The DB record is deleted

Similar to #3264

Activity

  1. weizhouapache commented on Jan 27, 2023

    @weizhouapache
    Member

    @davidjumani
    the issue with snapshot_store_ref might have been fixed by #6057

  2. weizhouapache commented on Jan 30, 2023

    @weizhouapache
    Member

    I am able to reproduce the issue in 4.15.2, but not in 4.17.2 it seems to be fixed by #6057 .

    For those who have problem caused by the bug, please refer to what @andrijapanicsb said in #3264 (comment)

    DELETE FROM snapshot_store_ref WHERE store_role="Primary" AND store_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL);

  3. moved this to 👀 Review in ACS Backlogon Jan 30, 2023
  4. DaanHoogland commented on Feb 20, 2023

    @DaanHoogland
    Contributor

    @davidjumani , please verify #7205.

  5. added this to the 4.18.0.0 milestone on Feb 20, 2023
  6. moved this from 👀 Review to Wei's List in ACS Backlogon Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions