tanishqgandhi1908 opened a new issue, #9335:
URL: https://github.com/apache/texera/issues/9335
### What happened?
POST /api/dataset/create creates the dataset’s LakeFS repository
(dataset-<did>) before it checks the contributors. If a contributor is invalid
(missing name, invalid or duplicate email, a field over 256 characters), the
request correctly fails with 400. The database transaction then rolls back the
dataset row, but the LakeFS repository is not deleted.
Each rejected attempt leaves one more empty repository that no dataset
refers to. The dataset id is not reused on retry, so these repositories are
never cleaned up. Today the code only removes the repository when creating the
repository itself fails, not when a later step fails.
Expected: a rejected create leaves nothing behind in LakeFS. Contributors
should be checked before the repository is created, and the repository should
be removed if a later step fails.
### How to reproduce?
1. Count the dataset-* repositories in LakeFS (GET /api/v1/repositories).
2. As a logged-in user, send:
```
POST /api/dataset/create
{"datasetName":"orphan-demo","datasetDescription":"","isDatasetPublic":false,"isDatasetDownloadable":true,
"contributors":[{"name":"Ada","email":"not-an-email"}]}
```
The response is 400 Invalid contributor email: not-an-email.
3. Count again: there is one more dataset-<did> repository, and no dataset
row with that did.
### Version/Branch
1.4.0-incubating-SNAPSHOT (main)
### Commit Hash (Optional)
_No response_
### What browsers are you seeing the problem on?
_No response_
### Relevant log output
```shell
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]