You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kernel/kernel-defaults/src/test/scala/io/delta/kernel/defaults/internal/expressions/ExpressionSuiteBase.scala
Copy file name to clipboardExpand all lines: protocol_rfcs/managed-commits.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ are responsible to define the commit atomicity and backfill protocols which the
143
143
144
144
At a high level, the `commit-owner` needs to provide:
145
145
- API to atomically commit a version `x` with given set of `actions`. This is explained in detail in the [commit protocol](#commit-protocol) section.
146
-
- API to retrieve information about the recent commits on the table. This is explained in detail in the [getting un-backfilled commits from commit-owner](#getting-un-backfilled-commits-from-commit-owner) section.
146
+
- API to retrieve information about the recent commits and the latest ratified version on the table. This is explained in detail in the [getting un-backfilled commits from commit-owner](#getting-un-backfilled-commits-from-commit-owner) section.
147
147
148
148
### Commit Protocol
149
149
@@ -161,7 +161,14 @@ Even after a commit succeeds, Delta clients can only discover the commit through
161
161
have no way to determine which file in `_delta_log/_commits` directory corresponds to the actual commit `v`.
162
162
163
163
The commit-owner is responsible to implement an API (defined by the Delta client) that Delta clients can use to retrieve information about un-backfilled commits maintained
164
-
by the commit-owner. Delta clients who are unaware of the commit-owner (or unwilling to talk to it), may not see recent un-backfilled commits and thus may encounter stale reads.
164
+
by the commit-owner. The API must also return the latest version of the table ratified by the commit-owner (if any).
165
+
Providing the latest ratified table version helps address potential race conditions between listing commits and contacting the commit-owner.
166
+
For example, if a client performs a listing before a recently ratified commit is backfilled, and then contacts the commit-owner after the backfill completes,
167
+
the commit-owner may return an empty list of un-backfilled commits. Without knowing the latest ratified version, the client might incorrectly assume their listing was complete
168
+
and read a stale snapshot.
169
+
170
+
Delta clients who are unaware of the commit-owner (or unwilling to talk to it), may not see recent un-backfilled commits and thus may encounter stale reads.
171
+
165
172
166
173
## Sample Commit Owner API
167
174
@@ -176,7 +183,7 @@ interface CommitStore {
176
183
* @param version The version we want to commit.
177
184
* @param actions Actions that need to be committed.
178
185
*
179
-
* returns CommitResponse which has details around the new committed delta file.
186
+
* @return CommitResponse which has details around the new committed delta file.
180
187
*/
181
188
def commit(
182
189
version: Long,
@@ -191,13 +198,16 @@ interface CommitStore {
191
198
* Note that the first version returned by this API may not be equal to the `startVersion`. This
192
199
* happens when few versions starting from `startVersion` are already backfilled and so
193
200
* CommitStore may have stopped tracking them.
201
+
* The returned latestTableVersion is the maximum commit version ratified by the Commit-Owner.
202
+
* Note that returning latestTableVersion as -1 is acceptable only if the commit-owner never
203
+
* ratified any version i.e. it never accepted any un-backfilled commit.
194
204
*
195
-
* @return a list of `Commit` which are tracked by commit-owner.
196
-
*
205
+
* @returnGetCommitsResponse which contains a list of `Commit`s and the latestTableVersion
206
+
* tracked by the commit-owner.
197
207
*/
198
208
def getCommits(
199
209
startVersion: Long,
200
-
endVersion: Long): Seq[Commit]
210
+
endVersion: Long): GetCommitsResponse
201
211
202
212
/**
203
213
* API to ask the commit-owner to backfill all commits <= given `version`.
0 commit comments