Skip to content

Conversation

@huaxingao
Copy link

This PR adds the persistence foundation for REST idempotency in Polaris:
Defines an idempotency_records table (Postgres) with key, binding, liveness, and finalization fields.
Introduces a storage‑agnostic IdempotencyRecord model and IdempotencyStore SPI in polaris-core.
Implements PostgresIdempotencyStore in polaris-relational-jdbc

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

public Optional<IdempotencyRecord> getExisting() { return existing; }
}

ReserveResult reserve(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add javadoc. This is a key interface, so describing API contracts is important, especially concurrency and consistency expectations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java doc added. Thanks!

* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.polaris.idempotency;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the obvious intention in this interface is to provide persistent storage for idempotency records, I suppose putting the new SPI interface into org.apache.polaris.core.persistence might be preferable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I have moved new SPI interface to org.apache.polaris.core.persistence

@dimas-b
Copy link
Contributor

dimas-b commented Dec 4, 2025

@huaxingao : Thanks for starting the implementation for idempoten retries in Polaris! Since this is a major new core feature, please mention this PR on the dev ML for visibility. I know it is part of the previous proposal, but some technical aspects of the new java code might need to be discussed in more depth than the current idempotency proposal doc.

@huaxingao
Copy link
Author

Thanks @dimas-b for the comments! I’ll send out a discussion email to the dev mailing list shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants