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.