There was an example video somewhere in the docs I remember where a member of the team forced a transaction abort.
Basically:
- Use the @upsert directive on a predicate to make it more likely to happen.
- start a transaction and update that value on a certain uid, do not commit the transaction yet.
- start a different transaction and update that value on the same uid, commit that transaction.
- commit original transaction, it should error with an abort.
On mobile atm so can’t find the video of the dgraph devs walking through this.
In general the pattern would be to retry the failed transaction in it’s entirety if it is aborted.