Skip to content
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

Bump Nessie to 0.8.2 + related changes #2588

Merged
merged 5 commits into from
Jul 15, 2021
Merged

Conversation

snazy
Copy link
Member

@snazy snazy commented May 13, 2021

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

changes LGTM

@snazy
Copy link
Member Author

snazy commented May 19, 2021

Should worth to have projectnessie/nessie#1249 merged into Nessie first and use Nessie 0.6.1 in this PR then.

@rymurr
Copy link
Contributor

rymurr commented May 24, 2021

Looks like this needs a rebase. @snazy do you still want to update to 0.6.1?

@snazy snazy force-pushed the nessie-0.6 branch 2 times, most recently from a25ee34 to ebc441f Compare May 27, 2021 16:14
@snazy snazy changed the title Bump Nessie to 0.6.0 + add CommitStateUnknownException Bump Nessie to 0.6.1 + add CommitStateUnknownException May 27, 2021
@snazy
Copy link
Member Author

snazy commented May 27, 2021

Yup, updated this PR to bump Nessie to 0.6.1.

@rymurr
Copy link
Contributor

rymurr commented May 27, 2021

@snazy looks like the build failed for java8. Presumably its the recent chagne to nessie server to not support java8?

@snazy
Copy link
Member Author

snazy commented May 28, 2021

@snazy looks like the build failed for java8. Presumably its the recent chagne to nessie server to not support java8?

Oh yea, projectnessie/nessie#1245 broke the test runs. It's not that the Nessie Client in Iceberg is broken, it's "just" the server that cannot run. Reverting projectnessie/nessie#1245 doesn't make much sense, because Quarkus 2 drops support for Java 8 entirely.

I see these options here:

  1. Skip the Nessie tests with "Iceberg Java 8" for now (to get this one in)
  2. Change the :iceberg-nessie test setup to actually start the Nessie Server in a separate process using Java 11, preferably using the now published Nessie-Server uber-jar or, maybe easier, using test-containers.

I think, option 1 is a good workaround for now and then follow-up with option 2 within a short time. WDYT?

@rymurr
Copy link
Contributor

rymurr commented May 28, 2021

I see no rush to get this patch in. The only deadline is the 0.12.0 release. So lets fix the tests correctly.

Lets go with the uber-jar too. I don't want to complicate the CI and introduce another build dependency.

@snazy snazy force-pushed the nessie-0.6 branch 3 times, most recently from 2b6bbb5 to 53ab73a Compare July 9, 2021 10:47
@snazy snazy force-pushed the nessie-0.6 branch 2 times, most recently from 3e5c976 to 5e425d6 Compare July 13, 2021 11:18
@snazy snazy changed the title Bump Nessie to 0.6.1 + add CommitStateUnknownException Bump Nessie to 0.8.0 + related changes Jul 13, 2021
Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

LGTM, with one question

@snazy
Copy link
Member Author

snazy commented Jul 13, 2021

Tests pass locally w/ Java 11 + Java 8 against latest in-dev Nessie.

@snazy snazy changed the title Bump Nessie to 0.8.0 + related changes Bump Nessie to 0.8.2 + related changes Jul 15, 2021
Copy link
Contributor

@rymurr rymurr left a comment

Choose a reason for hiding this comment

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

I think there are two things:

  1. more documentation of the individual changes - some aren't clear
  2. separate into a few changes

@snazy snazy force-pushed the nessie-0.6 branch 2 times, most recently from 2badb38 to 8bd6f75 Compare July 15, 2021 16:48
snazy added 5 commits July 15, 2021 22:32
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)
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)
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.
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)
Copy link
Contributor

@rymurr rymurr left a comment

Choose a reason for hiding this comment

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

Thanks @snazy !!

@rymurr rymurr merged commit 2be228d into apache:master Jul 15, 2021
@snazy snazy deleted the nessie-0.6 branch July 16, 2021 06:37
minchowang pushed a commit to minchowang/iceberg that referenced this pull request Aug 2, 2021
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants