kunwp1 opened a new pull request, #8875:
URL: https://github.com/apache/texera/pull/8875
### What changes were proposed in this PR?
Root cause. `createDatasetVersion` builds the name `v{N} - {description}`
and commits to LakeFS first, then inserts the `dataset_version` row
(`DatasetResource.scala`). `dataset_version.name` is `VARCHAR(128)`, so a long
description makes the insert fail after the commit, and the commit is outside
the DB transaction. The request returns a 500, the staged files are already
committed with no version row, and the dataset page then shows neither a
pending change nor a version until the next version is created.
Fix. `createDatasetVersion` now rejects a name longer than 128 characters
with a 400 before it creates the LakeFS commit, using the same check
`createModelVersion` already has. The length is counted in code points rather
than UTF-16 code units, since `VARCHAR(n)` counts characters and an emoji would
otherwise be rejected early. The staged files stay pending, so the user can
shorten the description and submit again. The frontend already shows the
message from the response, so it needs no change.
```
Before: Submit -> LakeFS commit -> INSERT dataset_version fails -> 500,
files committed, no version row
After: Submit -> name over 128 characters -> 400 "Version name is too
long: ..." -> files stay pending
```
### Any related issues, documentation, discussions?
Closes #8873
### How was this PR tested?
Added five tests to `DatasetResourceSpec`: version naming (null, empty and
non-empty description), a name of exactly 128 characters (accepted), a name of
129 characters (rejected with a 400, nothing committed, and a retry succeeds),
a 128-character name made of emoji (accepted) and a 129-character one
(rejected), and the existing no-staged-changes 400. Before the fix, the
over-long test failed with `org.jooq.exception.DataException` from the insert.
A first version of the guard that used `String.length` failed the emoji test,
which is why the length is counted in code points.
`sbt "FileService/testOnly *DatasetResourceSpec"` gives 157 passed, 0
failed, and `scalafixAll` and `scalafmtAll` change nothing. This ran locally
with a MinIO container in place of the RustFS image, which could not be pulled
on that machine, so CI is the run against RustFS. It was not exercised through
the UI.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code, Claude Sonnet 5.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]