Skip to content

[Disk Manager] Snapshot migration may select random base snapshot ID due to Disk nil comparison bug #4742

@jkuradobery

Description

@jkuradobery

Summary
A bug in snapshot migration logic can result in snapshot created from urls receiving random base snapshot IDs, rather than the expected empty value. This happens because toSnapshotMeta() always returns a non-nil Disk struct, leading to mishandling during snapshot creation and base snapshot selection.

Root cause

  • toSnapshotMeta() always returns a Disk struct, even for image snapshots (see common.go#L66-L89)).
  • In migration (migrate_snapshot.go#L50-L85), the Disk from the source snapshot meta is used as-is.
  • During snapshot creation (storage_ydb_impl.go), if the meta Disk is not equal nil, the incremental table is queried by Disk.disk_id and zone_id, which are both empty strings, so the random record is taken

Impact

  • Migrated images expected to have empty baseSnapshotID sometimes have random values.
  • Records for some snapshots are missing from the incremental table.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdisk_managerAdd this label to run only cloud/disk_manager build and tests on PR

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions