This is an automated email from the ASF dual-hosted git repository.
yufei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new c07d23ba2 Core: Clarify the atomicity of BasePersistence methods
(#1274)
c07d23ba2 is described below
commit c07d23ba27c320c199fd34af1a2f32103ed40f49
Author: Yufei Gu <[email protected]>
AuthorDate: Wed Apr 2 10:28:22 2025 -0700
Core: Clarify the atomicity of BasePersistence methods (#1274)
---
.../java/org/apache/polaris/core/persistence/BasePersistence.java | 4 ++++
.../org/apache/polaris/core/persistence/IntegrationPersistence.java | 4 ++++
2 files changed, 8 insertions(+)
diff --git
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/BasePersistence.java
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/BasePersistence.java
index 45460eb46..75b18fb45 100644
---
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/BasePersistence.java
+++
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/BasePersistence.java
@@ -38,6 +38,10 @@ import
org.apache.polaris.core.policy.PolicyMappingPersistence;
* defining the internal data model for Polaris, and which defines the basis
for the RBAC model
* provided by Polaris.
*
+ * <p>Each method in this interface must be atomic, meaning that write
operations must either fully
+ * succeed with all changes applied, or fail entirely without partial updates.
Read operations must
+ * provide a consistent view of the data as it existed at the start of the
operation.
+ *
* <p>Note that APIs to the actual persistence store are very basic, often
point read or write to
* the underlying data store. The goal is to make it really easy to back this
using databases like
* Postgres or simpler KV store.
diff --git
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/IntegrationPersistence.java
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/IntegrationPersistence.java
index 92a66dbfa..c9374182b 100644
---
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/IntegrationPersistence.java
+++
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/IntegrationPersistence.java
@@ -31,6 +31,10 @@ import
org.apache.polaris.core.storage.PolarisStorageIntegration;
* persistence entities but which typically involve additional separate
external integrations
* related to identity/auth, kms/secrets storage, etc.
*
+ * <p>Each method in this interface must be atomic, meaning that write
operations must either fully
+ * succeed with all changes applied, or fail entirely without partial updates.
Read operations must
+ * provide a consistent view of the data as it existed at the start of the
operation.
+ *
* <p>Implementations should orchestrate any necessary multi-phase protocols
such as leasing an
* external resource before committing a reference to the external resource in
the Polaris
* persistence layer, etc.