@@ -1128,16 +1128,30 @@ func (c *RestClient) startCloneSplitByNameAndStyle(ctx context.Context, volumeNa
11281128
11291129 params .SetInfo (volumeInfo )
11301130
1131- _ , volumeModifyAccepted , err := c .api .Storage .VolumeModify (params , c .authInfo )
1131+ volumeModifyOk , volumeModifyAccepted , err := c .api .Storage .VolumeModify (params , c .authInfo )
11321132 if err != nil {
11331133 return err
11341134 }
1135- if volumeModifyAccepted == nil {
1135+
1136+ if volumeModifyOk == nil && volumeModifyAccepted == nil {
11361137 return fmt .Errorf ("unexpected response from volume modify" )
11371138 }
11381139
1139- jobLink := getGenericJobLinkFromVolumeJobLink (volumeModifyAccepted .Payload )
1140- return c .PollJobStatus (ctx , jobLink )
1140+ // If there is explicit error, return the error
1141+ if volumeModifyOk != nil && ! volumeModifyOk .IsSuccess () {
1142+ return fmt .Errorf ("failed to start clone split; %v" , volumeModifyOk .Error ())
1143+ }
1144+
1145+ if volumeModifyAccepted != nil && ! volumeModifyAccepted .IsSuccess () {
1146+ return fmt .Errorf ("failed to start clone split; %v" , volumeModifyAccepted .Error ())
1147+ }
1148+
1149+ // At this point, it is clear that no error occurred while trying to start the split.
1150+ // Since clone split usually takes time, we do not wait for its completion.
1151+ // Hence, do not get the jobLink and poll for its status. Assume, it is successful.
1152+ Logc (ctx ).WithField ("volume" , volumeName ).Debug (
1153+ "Clone split initiated successfully. This is an asynchronous operation, and its completion is not monitored." )
1154+ return nil
11411155}
11421156
11431157// restoreSnapshotByNameAndStyle restores a volume to a snapshot as a non-blocking operation
@@ -6941,16 +6955,30 @@ func (c *RestClient) StorageUnitCloneSplitStart(
69416955
69426956 params .SetInfo (suInfo )
69436957
6944- _ , suModifyAccepted , err := c .api .San .StorageUnitModify (params , c .authInfo )
6958+ suModifyOk , suModifyAccepted , err := c .api .San .StorageUnitModify (params , c .authInfo )
69456959 if err != nil {
69466960 return err
69476961 }
6948- if suModifyAccepted == nil {
6949- return fmt .Errorf ("unexpected response from volume modify" )
6962+
6963+ if suModifyOk == nil && suModifyAccepted == nil {
6964+ return fmt .Errorf ("unexpected response from storage unit modify" )
69506965 }
69516966
6952- jobLink := getGenericJobLinkFromStorageUnitJobLink (suModifyAccepted .Payload )
6953- return c .PollJobStatus (ctx , jobLink )
6967+ // If there is explicit error, return the error
6968+ if suModifyOk != nil && ! suModifyOk .IsSuccess () {
6969+ return fmt .Errorf ("failed to start clone split; %v" , suModifyOk .Error ())
6970+ }
6971+
6972+ if suModifyAccepted != nil && ! suModifyAccepted .IsSuccess () {
6973+ return fmt .Errorf ("failed to start clone split; %v" , suModifyAccepted .Error ())
6974+ }
6975+
6976+ // At this point, it is clear that no error occurred while trying to start the split.
6977+ // Since clone split usually takes time, we do not wait for its completion.
6978+ // Hence, do not get the jobLink and poll for its status. Assume, it is successful.
6979+ Logc (ctx ).WithField ("storageUnitUUID" , suUUID ).Debug (
6980+ "Clone split initiated successfully. This is an asynchronous operation, and its completion is not monitored." )
6981+ return nil
69546982}
69556983
69566984func (c * RestClient ) StorageUnitListAllBackedBySnapshot (ctx context.Context , suName , snapshotName string ) ([]string ,
0 commit comments