240
ctx context.Context,
241
request *p.DeleteNexusEndpointRequest,
243
>
batch := s.session.NewBatch(gocql.LoggedBatch).WithContext(ctx)
244
>
245
>
// Table version update must be the first statement so it is returned as the first CAS result
246
>
// row. CAS result row ordering differs between Cassandra (clustering key order) and ScyllaDB
247
>
// (statement order), but placing the type=0 partition status first satisfies both.
248
>
batch.Query(templateUpdateTableVersion,
249
>
request.LastKnownTableVersion+1,
250
>
rowTypePartitionStatus,
251
>
tableVersionEndpointID,
252
>
request.LastKnownTableVersion)
253
>
254
>
batch.Query(templateDeleteEndpointQuery,
255
>
rowTypeNexusEndpoint,
256
>
request.ID)
257
>
258
>
previousPartitionStatus := make(map[string]any)
259
>
applied, iter, err := s.session.MapExecuteBatchCAS(batch, previousPartitionStatus)
260
>
261
>
if err != nil {
262
return gocql.ConvertError("DeleteNexusEndpoint", err)
263
}
264
266
>
if err != nil {
267
return gocql.ConvertError("DeleteNexusEndpoint", err)
268
}
269
271
currentTableVersion, err := getTypedFieldFromRow[int64]("version", previousPartitionStatus)
272
if err != nil {