If a DOI mint fails, eg for a providerMetadata validation exception then the DB record is rolled back, however, the file upload may have completed successfully. In the case of S3 this will leave orphaned objects which may cost money to host but be inaccessible. In these cases (for both mint and update operations), the file change needs to be registered in the transaction context somehow (or tracked manually) and on a rollback the uploaded file should be removed.
If a DOI mint fails, eg for a providerMetadata validation exception then the DB record is rolled back, however, the file upload may have completed successfully. In the case of S3 this will leave orphaned objects which may cost money to host but be inaccessible. In these cases (for both mint and update operations), the file change needs to be registered in the transaction context somehow (or tracked manually) and on a rollback the uploaded file should be removed.