mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rbd: fix resync issue
During the Demote volume store the image creation timestamp. During Resync do below operation * Check image creation timestamp stored during Demote operation and current creation timestamp during Resync and check both are equal and its for force resync then issue resync * If the image on both sides is not in unknown state, check last_snapshot_timestamp on the local mirror description, if its present send volumeReady as false or else return error message. If both the images are in up+unknown the send volumeReady as true. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
4016876c9d
commit
e013cfed15
@ -1558,6 +1558,19 @@ func (rv *rbdVolume) setImageOptions(ctx context.Context, options *librbd.ImageO
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetImageCreationTime returns the creation time of the image. if the image
|
||||
// creation time is not set, it queries the image info and returns the creation time.
|
||||
func (ri *rbdImage) GetImageCreationTime() (*timestamppb.Timestamp, error) {
|
||||
if ri.CreatedAt != nil {
|
||||
return ri.CreatedAt, nil
|
||||
}
|
||||
if err := ri.getImageInfo(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ri.CreatedAt, nil
|
||||
}
|
||||
|
||||
// getImageInfo queries rbd about the given image and returns its metadata, and returns
|
||||
// ErrImageNotFound if provided image is not found.
|
||||
func (ri *rbdImage) getImageInfo() error {
|
||||
|
Reference in New Issue
Block a user