tarantool / crud

Easy assess to data stored in vshard cluster
BSD 2-Clause "Simplified" License
40 stars 14 forks source link

Consider reworking batch operations info #421

Closed DifferentialOrange closed 5 months ago

DifferentialOrange commented 9 months ago

*_many operations errors have operation_data field to help identify which exact records had errors. This info is used to automatize these processes: for example, in tt-ee tt crud import.

But matching input and error output is complicated:

Matching input and success output is also can be complicated, if triggers or sequences are used on the storage.

On the other hand, if response had the structure similar to the following one:

crud.insert_many({{1, box.NULL, "val"}, {0, box.NULL, "val"}, {3, box.NULL, "val"}})
- rows:
    - id: 1 
      data: [1, 123, "val"]
- errors:
   - id: 2
     data: [0, box.NULL, "val"]
     err: duplicate_key
   - id: 3
     data: [3, box.NULL, "val"]
     err: rolled back

with explicit "input row N has been successfully inserted, result after inserting is X" and "input row M has failed due to the following reason", it would simplify things like tt crud import.

DifferentialOrange commented 9 months ago

Such rework is likely to break compatibility and drop the performance, so we should decide carefully.

DifferentialOrange commented 5 months ago

Duplicate of #396