Skip to content

GH-40328: [C++][Parquet] Allow use of FileDecryptionProperties after the CryptoFactory is destroyed - #40329

Merged
pitrou merged 15 commits into
apache:mainfrom
adamreeve:keep_key_retriever_alive
Mar 21, 2024
Merged

pitrou merged 15 commits into
apache:mainfrom
adamreeve:keep_key_retriever_alive

Conversation

@adamreeve

@adamreeve adamreeve commented Mar 4, 2024 •

Copy link
Copy Markdown
Contributor

Rationale for this change

See #40328

What changes are included in this PR?

Changes FileKeyUnwrapper so it can hold a shared pointer to a KeyToolkit and remain usable after the CryptoFactory that created it is destroyed. Also changes CryptoFactory to store a shared pointer to a KeyToolkit instead of storing a KeyToolkit inline.

Are these changes tested?

Yes, I've added a new unit test for this

Are there any user-facing changes?

This changes functionality for users of the C++ API in a non-breaking way, allowing them to use the FileDecryptionProperties returned from a CryptoFactory without having to keep the CryptoFactory alive.

@adamreeve
adamreeve requested a review from wgtmac March 7, 2024 23:22
@adamreeve
adamreeve force-pushed the keep_key_retriever_alive branch from 115227a to 387e1f2 Compare March 20, 2024 23:37
@pitrou

pitrou commented Mar 21, 2024

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 387e1f2

Submitted crossbow builds: ursacomputing/crossbow @ actions-2e333fc810

Task Status
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-cpp GitHub Actions
test-ubuntu-20.04-cpp GitHub Actions
test-ubuntu-20.04-cpp-bundled GitHub Actions
test-ubuntu-20.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-20.04-cpp-thread-sanitizer GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions

@pitrou

pitrou commented Mar 21, 2024

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 7547c79

Submitted crossbow builds: ursacomputing/crossbow @ actions-67652940da

Task Status
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-cpp GitHub Actions
test-ubuntu-20.04-cpp GitHub Actions
test-ubuntu-20.04-cpp-bundled GitHub Actions
test-ubuntu-20.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-20.04-cpp-thread-sanitizer GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions

@pitrou

pitrou commented Mar 21, 2024

Copy link
Copy Markdown
Member

The duckdb test failures on R builds are unrelated.

@pitrou pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 @adamreeve , thanks for this improvement.

@mapleFU mapleFU left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, just few nits

std::shared_ptr<KmsClientFactory> kms_client_factory,
EncryptionConfiguration encryption_config) {
std::shared_ptr<CryptoFactory> crypto_factory = std::make_shared<CryptoFactory>();
crypto_factory->RegisterKmsClientFactory(kms_client_factory);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: should we use std::move for kms_client_factory?

std::shared_ptr<KmsClientFactory> kms_client_factory,
DecryptionConfiguration decryption_config) {
std::shared_ptr<CryptoFactory> crypto_factory = std::make_shared<CryptoFactory>();
crypto_factory->RegisterKmsClientFactory(kms_client_factory);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 54c4ced.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.

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.

4 participants