Currently, the data export marks data sets as exported in a chunk. It does that by relying on the data set creation timestamp. If a donation payment is being confirmed by an external payment provider while the exporter is running, it may happen, that its data set is being marked as exported, although it never was. This race condition needs to be prevented.
During execution, the exporter selects data sets to be exported using several conditions (status, creation timestamp, export timestamp). After writing the export file, the exact same conditions are used for setting the export timestamp. If a data set gets confirmed by external payment providers during the process, the conditions are true for UPDATE, although they have not been true for data set selection.
Acceptance Criteria
- Investigate how the export works.
- Data set export is wrapped in a transaction might be a solution.
Notes
- The described workflow only applies to donations. Other data set types are already marked on a per-data-set level.