JingsongLi opened a new pull request, #11177:
URL: https://github.com/apache/paimon/pull/11177
### Purpose
Replace the boolean `firstCommit` lock parameter with `Lock.AcquireMode`,
allowing callers to explicitly choose `REQUIRED` or `OPTIMISTIC_ALLOWED`
instead of encoding lock policy as commit-attempt state.
Update all callers while preserving the existing acquisition behavior: REST
commits may use optimistic concurrency on their initial attempt, retries and
maintenance operations require the configured lock, and nested operations reuse
the outer scope. Forward the mode through `SnapshotCommit` for both explicit
scope acquisition and callback execution.
### Tests
Added coverage for optimistic scope inheritance and cleanup through both
acquisition APIs, followed by a required acquisition. Extended nested lease
tests to verify that allowing optimistic execution does not bypass validation
of an existing lease.
Passed 63 focused tests on JDK 8, including `LockTest`,
`SnapshotCommitTest`, `RESTCatalogLockTest`, and
`RESTCommitLockIntegrationTest`. Checkstyle, Spotless, and Enforcer passed
without `fast-build`.
After packaging the codegen runtime:
```shell
mvn -o -B -ntp -pl paimon-core -am \
-DwildcardSuites=none -DfailIfNoTests=false \
-Dtest=LockTest,SnapshotCommitTest,RESTCatalogLockTest,RESTCommitLockIntegrationTest
test
```
--
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]