kunwp1 opened a new pull request, #6426:
URL: https://github.com/apache/texera/pull/6426

   ### What changes were proposed in this PR?
   
   The dataset rename endpoint previously skipped both checks that dataset 
creation enforces: name validation and the per-owner duplicate-name check. A 
rename could therefore produce two datasets with the same `(owner, name)` pair, 
which breaks every lookup that resolves a dataset by `(owner email, dataset 
name)` — multipart uploads and workflow file reads fail with a 
`TooManyRowsException` for both datasets.
   
   This PR adds the missing guards to the backend rename endpoint, and a 
`UNIQUE (owner_uid, name)` constraint at the database level so that concurrent 
writes racing past the application-level check cannot reintroduce duplicates. 
The migration script `sql/updates/28.sql` deduplicates pre-existing duplicates 
before adding the constraint (the oldest dataset keeps its name; later ones get 
a `-<did>` suffix). The frontend rename input now applies the same name 
validation client-side and shows the detailed reason from the backend when a 
rename is rejected, instead of the generic "Update dataset name failed".
   
   ```
   Before:  rename "temp" -> "mydata" (duplicate) -> 200 OK -> any upload / 
workflow read of "mydata" -> TooManyRowsException -> 500
   After:   rename "temp" -> "mydata" (duplicate) -> 400 "Dataset with the same 
name already exists"
   ```
   
   ### Any related issues, documentation, discussions?
   
   Closes #6424
   
   ### How was this PR tested?
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code, Claude Fable 5
   


-- 
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]

Reply via email to