You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several issues exist in the RBD snapshot metadata code path (ProcessMetadata / getRBDSnapID) that would cause incorrect behavior for certain snapshot configurations:
1. getRBDSnapID uses GetParent() which fails for non-clone snapshots
GetParent() only works for clone-based snapshots with a parent relationship. For regular RBD snapshots or flattened clones, GetParent() returns ErrNotFound. Should use GetSnapshotNames() which reliably lists all snapshots on the image regardless of clone/parent relationships.
2. SnapInfo field name mismatch: Id vs ID
The go-ceph SnapInfo struct uses the field name Id, not ID.
3. ProcessMetadata opens wrong image
ProcessMetadata opens the source volume via rbdSnap.open() (which uses RbdImageName = source volume name), but getRBDSnapID() returns the snapshot ID from the clone image (via toVolume()). This mismatch means SetSnapByID() applies a clone's snapshot ID to the source volume, resulting in either an error or iterating over wrong/empty data.
Context
These issues were discovered during investigation of empty GetMetadataAllocated streams. While the original symptom turned out to be a test-side device path mismatch (details), the code issues identified above are real bugs that should be fixed.
Problem
Several issues exist in the RBD snapshot metadata code path (
ProcessMetadata/getRBDSnapID) that would cause incorrect behavior for certain snapshot configurations:1.
getRBDSnapIDusesGetParent()which fails for non-clone snapshotsGetParent()only works for clone-based snapshots with a parent relationship. For regular RBD snapshots or flattened clones,GetParent()returnsErrNotFound. Should useGetSnapshotNames()which reliably lists all snapshots on the image regardless of clone/parent relationships.2.
SnapInfofield name mismatch:IdvsIDThe go-ceph
SnapInfostruct uses the field nameId, notID.3.
ProcessMetadataopens wrong imageProcessMetadataopens the source volume viarbdSnap.open()(which usesRbdImageName= source volume name), butgetRBDSnapID()returns the snapshot ID from the clone image (viatoVolume()). This mismatch meansSetSnapByID()applies a clone's snapshot ID to the source volume, resulting in either an error or iterating over wrong/empty data.Context
These issues were discovered during investigation of empty
GetMetadataAllocatedstreams. While the original symptom turned out to be a test-side device path mismatch (details), the code issues identified above are real bugs that should be fixed.Note
Responses generated with Claude