leaves12138 opened a new pull request, #11145:
URL: https://github.com/apache/paimon/pull/11145

   ### Purpose
   
   REST commit scopes currently stop local renewal without actively returning 
the server-side lease. If preparation fails before publication, other writers 
remain blocked until the lease expires.
   
   This change:
   - Adds an idempotent release endpoint and a per-acquisition `leaseId`, 
propagated through acquire, renewal, and release. Delayed cleanup or renewal 
from an older scope cannot affect a later scope belonging to the same writer.
   - Attempts remote cleanup on success, empty work, exceptions, errors, 
interrupted operations, lost acquisition responses, and failures while 
initializing a granted lease. Cleanup preserves the original operation outcome; 
lease expiry still protects against process termination, network partitions, 
and failed cleanup.
   - Renames the writer option to `rest.commit.retry-acquire-lock` (default 
`false`). When enabled, the first publication attempt remains optimistic; only 
conflict retries acquire a lease. The next logical commit starts optimistically 
again.
   - Propagates retry state through ordinary commits, manifest compaction, and 
row-ID reassignment without changing non-REST lock semantics. The separate 
server capability `rest.commit.lock-enabled` remains unchanged.
   - Updates the REST specification and generated configuration reference. 
Existing acquire/renew request constructors and REST API overloads remain 
available for legacy clients. The old writer configuration key is intentionally 
not retained as an alias.
   
   The server must support acquisition identities and release before these 
clients are rolled out. Active release cannot be guaranteed if the process is 
killed or the server is unreachable; TTL remains the final fallback.
   
   ### Tests
   
   132 targeted tests passed (zero failures or errors):
   - `RESTCatalogLockTest` (45)
   - `CommitLockProtocolTest` (5)
   - `RESTCommitLockIntegrationTest` (12)
   - `LockTest` (9)
   - `SnapshotCommitTest` (4)
   - `DataEvolutionRowIdReassignerTest` (57)
   
   Coverage includes optimistic first attempts, conflict-triggered acquisition, 
subsequent optimistic commits, rollback paths, renewal/release identity, 
release failures, interrupted cleanup, empty work, and acquisition-response 
loss.
   
   Commands:
   ```
   mvn -B -pl paimon-api,paimon-core -am -Pfast-build 
-Dtest=RESTCatalogLockTest,CommitLockProtocolTest,RESTCommitLockIntegrationTest,LockTest,SnapshotCommitTest,DataEvolutionRowIdReassignerTest
 -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false install
   mvn -B -pl paimon-api,paimon-core -am -DskipTests validate spotless:check
   git diff --check
   ```
   


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