Repository navigation
fix(bigquery-jdbc): restrict auto-created LargeResultDataset ACLs to creator and enforce 1h minimum TTL - #15332
Open
keshavdandeva wants to merge 1 commit into
Conversation
This was referenced Dec 1, 2026
fix(bigquery-jdbc): validate LargeResult properties and use UUID temp tables with WRITE_EMPTY
#15257
Open
Open
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances security and concurrency handling when auto-creating destination datasets for large query results. Specifically, it ensures that auto-created datasets are restricted to creator-only OWNER access by stripping default project-wide group ACLs, and enforces a minimum default table lifetime of 1 hour. It also introduces JVM-wide synchronization to safely coordinate concurrent dataset creations and handles rollback deletions if ACL updates fail. Extensive unit and integration tests have been added to verify these behaviors. There are no review comments to address, so I have no additional feedback to provide.
keshavdandeva
force-pushed
the
jdbc/large-results-3-dataset-acls
branch
from
December 1, 2026 17:51
7d63e05 to
863e0a5
Compare
…creator and enforce 1h minimum TTL
keshavdandeva
force-pushed
the
jdbc/large-results-3-dataset-acls
branch
from
December 1, 2026 20:09
863e0a5 to
88ab641
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
b/584840569
Summary of Changes
LargeResultDestinations(LargeResultDestinations.java,BigQueryConnection.java,BigQueryStatement.java):LargeResultDatasetprovisioning out ofBigQueryStatementinto a dedicated package-private collaboratorLargeResultDestinationsowned byBigQueryConnection(keepingBigQueryStatementfocused on JDBC statement lifecycle; PR 3 touches only 26 lines inBigQueryStatement.java).LargeResultDataset(b/584840569):BigQueryConnection.resolveOwnerEmail()) and sets creator-onlyOWNERACL atomically ondatasets.insert(zero extra RPCs, no window of project-wide special-group exposure).projectOwners,projectWriters,projectReaders) viadatasets.patchbefore any query job writes to the dataset; fails closed and rolls back the empty dataset (wrapping bothBigQueryJdbcExceptionand unexpectedRuntimeException) if a creatorOWNERentry cannot be verified or the patch fails.409 Conflict, reloads the dataset; for non-service-account credentials, verifies the dataset does not retain default project-wide special groups without mutating ACLs on a dataset another actor may have created.defaultTableLifetimeclamp:defaultTableLifetimeto BigQuery's 1-hour minimum (3600000ms) with aLOG.warning(...)whenLargeResultsDatasetExpirationTimeis below 1 hour, preventing BigQuery400rejections on auto-create.USER_GUIDE.md,BigQueryConnectionTest,BigQueryStatementTest,ITStatementTest):ITStatementTest.Decisions Taken & Open Review Points
b/584840569so auto-created datasets do not inheritprojectReaders/projectWriters/projectOwnerslegacy primitive roles. Pre-existing datasets and BigQuery IAM roles (e.g.roles/bigquery.dataViewer) are unaffected; only deployments relying on legacy project-level primitive roles to share a driver-auto-created dataset see a behavior change. Please flag if you think a compatibility opt-out property is warranted.IN_FLIGHT_DATASET_CREATIONSlatch: Dropped static in-JVM serialization (CountDownLatch) because it blocked uncancellably onlatch.await()and only serialized within a single JVM (still failing on 409 across processes). Non-SA concurrent auto-creation now consistently hits the409fail-closed path with clear guidance to pre-create the dataset.datasets.getmetadata per connection with404invalidation (to remove the per-querydatasets.getRPC that also existed prior to this stack) is tracked separately inb/592250778.