Unverified Commit c33b642b authored by Fernando Takagi's avatar Fernando Takagi Committed by GitHub
Browse files

Ensure storage write ops return acks in the same order as inputs. (#813)

parent a5d95d2f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -458,9 +458,6 @@ WHERE
}

func StorageWriteObjects(ctx context.Context, logger *zap.Logger, db *sql.DB, authoritativeWrite bool, ops StorageOpWrites) (*api.StorageObjectAcks, codes.Code, error) {
	// Ensure writes are processed in a consistent order.
	sort.Sort(ops)

	var acks []*api.StorageObjectAck

	tx, err := db.BeginTx(ctx, nil)
@@ -503,6 +500,7 @@ func storageWriteObjects(ctx context.Context, logger *zap.Logger, tx *sql.Tx, au
		}
		acks = append(acks, ack)
	}

	return acks, nil
}