Skip to content

Conversation

laithalzyoud
Copy link
Contributor

@laithalzyoud laithalzyoud commented Aug 7, 2025

Description

This PR fixes #26360

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

Copy link

cla-bot bot commented Aug 7, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Laith Alzyoud.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@github-actions github-actions bot added the iceberg Iceberg connector label Aug 7, 2025
@laithalzyoud laithalzyoud changed the title Don't Pass expected_parameter_key/value with Hive Locking Enabled Don't pass expected_parameter_key/value with Hive Locking enabled Aug 7, 2025
@ebyhr ebyhr requested review from electrum and ebyhr August 7, 2025 09:11
Copy link

cla-bot bot commented Aug 7, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Laith Alzyoud.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@laithalzyoud laithalzyoud marked this pull request as ready for review August 7, 2025 09:17
@laithalzyoud laithalzyoud force-pushed the fix-hms-environment-context-using-locks branch from 1a3fd52 to 82798cf Compare August 7, 2025 09:49
Copy link

cla-bot bot commented Aug 7, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@nineinchnick
Copy link
Member

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Aug 12, 2025
Copy link

cla-bot bot commented Aug 12, 2025

The cla-bot has been summoned, and re-checked this pull request!

Table updatedTable = tableUpdateFunction.apply(table, newMetadataLocation);

// it's redundant to pass metadata_location to environmentContext if Hive locking is enabled
Map<String, String> environmentContext = lockingEnabled ? ImmutableMap.of() : environmentContext(metadataLocation);
Copy link
Member

Choose a reason for hiding this comment

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

I don't know anything about this code, but is there a test we can update or add a new one?

@ebyhr ebyhr force-pushed the fix-hms-environment-context-using-locks branch from 82798cf to b38361b Compare August 12, 2025 12:03
ebyhr
ebyhr previously approved these changes Aug 12, 2025

Table updatedTable = tableUpdateFunction.apply(table, newMetadataLocation);

// Passing environment context causes redundant operations if Hive locking is enabled
Copy link
Contributor

@chenjian2664 chenjian2664 Aug 13, 2025

Choose a reason for hiding this comment

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

Could you give more details about the consequences that what is "redundant operations" in the comments?

@laithalzyoud
Copy link
Contributor Author

Hey @nineinchnick @chenjian2664! I added some explanation in the related issue #26360, basically this code was originally introduced in #25445 to allow committing to Iceberg tables without using Hive locks by passing the latest metadata file location to Hive, if this is passed to Hive then it will go through extra operations to confirm that the metadata location didn't change since the write/update operation started. In the case when Hive locking is enabled, there is no need to do this extra check on Hive side as Hive locking already guarantees the atomicity of the transaction, therefore it's only needed when Hive locking is disabled.

@nineinchnick
Copy link
Member

@laithalzyoud the #25445 added some tests. Can they be updated to cover this change? Thanks for adding the explanation in the issue, but it would be ideal to have a test that would also explain it.

@ebyhr ebyhr merged commit eb54b3c into trinodb:master Aug 20, 2025
41 of 43 checks passed
@github-actions github-actions bot added this to the 477 milestone Aug 20, 2025
@laithalzyoud
Copy link
Contributor Author

Thanks for merging @ebyhr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

Hive lock-free commits can break commits using existing Hive locking mechanism
4 participants