-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CommitStatusUnknownException
for Nessie
#2515
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, My only comment is I think this is 2 PRs
@@ -48,6 +48,7 @@ | |||
import org.projectnessie.api.TreeApi; | |||
import org.projectnessie.client.NessieClient; | |||
import org.projectnessie.client.NessieConfigConstants; | |||
import org.projectnessie.client.http.HttpClientException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change to this file should be a different PR. Its cosmetic and unrelated to the bug we are fixing. It is a good cosmetic change and shoudl be done but imho not here,
In case the Nessie endpoint did not respond or some other network error that makes it impossible to detect whether the Nessie server got the request and, more importantly, get the response. This PR adds a `catch (org.projectnessie.client.http.HttpClientException)` and re-throws it as the new `CommitStateUnknownException`. Related to apache#2328
ae34ccf
to
d8ffba8
Compare
* Bump Nessie to 0.8.2 + replace Gradle plugin with new JUnit extension More changes in this PR in following commits. Replace Gradle plugin with new JUnit extension. See [Add JAX-RS tests and add JUnit/Jupyter extension](projectnessie/nessie#1566) * Changes required by Nessie-API changes Apply changes to Iceberg required by API changes in Nessie: * [Re-introduce wrapper classes for query params of CommitLog/Entries](projectnessie/nessie#1595) * [Server-side commit range filtering](projectnessie/nessie#1596) * [Add hashOnRef query param to support time travel on a named ref](projectnessie/nessie#1589) * [Only accept NamedRefs in REST API](projectnessie/nessie#1583) * Bugfix: must send the Contents.id of the existing table Nessie's `Contents.id` is a random ID generated when the `Contents.Key` is first used (think: CREATE TABLE) and must not be changed. This change addresses a bug in the Iceberg-Nesie code that caused a new id for every change. * Throw `CommitStateUnknownException` for `renameTable` as well Follow-up of #2515 * Fix race-condition & save one roundtrip to Nessie during "commit" When commiting a change, the Nessie-API now returns the hash of the commit for the change. This returned hash should then be used as the "expected hash" for the next commit. The previous approach was to commit the change to Nessie and then do another request to retrieve the new hash of HEAD. This old approach is prone to a race condition, namely when another commit happens after "this" commit but before retrieving the "new HEAD", so "this" instance would wrongly ignore the other commit's changes during conflict checks. See [Let VersionStore.create()+commit() return the current hash](projectnessie/nessie#1089)
* Bump Nessie to 0.8.2 + replace Gradle plugin with new JUnit extension More changes in this PR in following commits. Replace Gradle plugin with new JUnit extension. See [Add JAX-RS tests and add JUnit/Jupyter extension](projectnessie/nessie#1566) * Changes required by Nessie-API changes Apply changes to Iceberg required by API changes in Nessie: * [Re-introduce wrapper classes for query params of CommitLog/Entries](projectnessie/nessie#1595) * [Server-side commit range filtering](projectnessie/nessie#1596) * [Add hashOnRef query param to support time travel on a named ref](projectnessie/nessie#1589) * [Only accept NamedRefs in REST API](projectnessie/nessie#1583) * Bugfix: must send the Contents.id of the existing table Nessie's `Contents.id` is a random ID generated when the `Contents.Key` is first used (think: CREATE TABLE) and must not be changed. This change addresses a bug in the Iceberg-Nesie code that caused a new id for every change. * Throw `CommitStateUnknownException` for `renameTable` as well Follow-up of apache#2515 * Fix race-condition & save one roundtrip to Nessie during "commit" When commiting a change, the Nessie-API now returns the hash of the commit for the change. This returned hash should then be used as the "expected hash" for the next commit. The previous approach was to commit the change to Nessie and then do another request to retrieve the new hash of HEAD. This old approach is prone to a race condition, namely when another commit happens after "this" commit but before retrieving the "new HEAD", so "this" instance would wrongly ignore the other commit's changes during conflict checks. See [Let VersionStore.create()+commit() return the current hash](projectnessie/nessie#1089)
In case the Nessie endpoint did not respond or some other network error that makes it impossible
to detect whether the Nessie server got the request and, more importantly, get the response.
This PR adds a
catch (org.projectnessie.client.http.HttpClientException)
and re-throws it asthe new
CommitStateUnknownException
.Related to #2328