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

   ### Purpose
   
   Under sustained concurrent publication, a compaction writer can exhaust 
snapshot retries even when its file changes remain compatible. Add optional 
REST commit leases so a writer can acquire a publication window before 
rebuilding a retried snapshot.
   
   `commit.lock-enabled` enables the table capability; `commit.lock-on-retry` 
enables the writer policy. Both default to false, and the first attempt remains 
optimistic. Lease contention waits within `commit.timeout` without consuming 
snapshot publication retries.
   
   The acquire and renew endpoints use the stable table UUID and the exact 
`commitUser`. A grant returns the authoritative snapshot head, and the client 
renews while preparing and publishing. The existing snapshot commit payload is 
unchanged: the server uses `snapshot.commitUser` to check ownership and 
atomically releases the lease on a new successful publication. Catalog 
implementations must enforce this admission check for all writers, including 
clients that never acquire leases, in the same transaction as publication.
   
   Aborted attempts stop renewal and expire automatically. There is no explicit 
unlock RPC, avoiding delayed unlock requests releasing a later lease after 
recovery reuses the same commit user. This is an owner admission lease, not a 
fencing token: requests sharing a commit user and authenticated caller share 
ownership, while snapshot UUID CAS and file conflict validation continue to 
provide correctness. Unsupported catalog implementations fail explicitly when 
locked retries are requested.
   
   ### Tests
   
   - `mvn -o -pl paimon-core -am -DfailIfNoTests=false -DwildcardSuites=none 
-Dtest=CatalogCommitLeaseTest,CommitLockProtocolTest,CatalogSnapshotCommitTest,FileStoreCommitTest
 test`
   - `mvn -o -pl paimon-docs -DwildcardSuites=none 
-Dtest=ConfigOptionsDocsCompletenessITCase test`
   - `node docs/scripts/validate-rest-openapi.js`
   
   Tests cover optimistic first attempts, granted-head reuse, renewal loss, 
owner/branch checks, lock contention and timeout, the REST wire contract, and 
preserving concurrent appends during a locked retry. The core configuration 
reference was regenerated with `paimon-docs`' `generate-docs` profile.
   


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