Repository navigation
fix(bigquery-jdbc): clamp LargeResultsDatasetExpirationTime to 1h minimum and handle 409 races - #15332
Conversation
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.
7d63e05 to
863e0a5
Compare
863e0a5 to
88ab641
Compare
88ab641 to
417addc
Compare
|
Removed all dataset ACL restrictions and This PR is now trimmed down to just the non-ACL
|
…imum and handle 409 races
417addc to
08fc921
Compare
|
Updated per @logachev's review:
|
Part 2 of 2 in the
LargeResultDatasethardening stack (b/584840569), stacked directly on #15257:temp_table_<epochMs>_<uuid>+WRITE_EMPTY, clientJobId, internal statement isolationLargeResultsDatasetExpirationTimeclamp during parameter parsing,409 Conflictauto-create handling, and dataset error wrapping(#15331 was decoupled as a standalone draft PR under
b/593045100; broader BigQuery API / ephemeraldestinationTablecapabilities are tracked inb/592582350and #15333/#15334 are closed.)Summary of Changes
LargeResultsDatasetExpirationTimeclamp at parameter parsing (BigQueryJdbcUrlUtility,DataSource):BigQueryJdbcUrlUtility.MIN_DESTINATION_DATASET_EXPIRATION_TIME_VALUE = 3600000L.DataSource.setDestinationDatasetExpirationTime(long), positive values below 1 hour are clamped to3600000ms with aLOG.warning(...)during URL/setter parsing (0continues to fall back to the 1h default without warning for compatibility with existing=0URLs), preventing BigQuery HTTP400rejections ondatasets.insert.409 Conflictconcurrent creation race handling & error wrapping (BigQueryStatement):checkIfDatasetExistElseCreate(String), treats HTTP409 Conflict/"duplicate"ondatasets.insertas success so concurrent queries racing to auto-create the sameLargeResultDatasetproceed cleanly.BigQueryExceptionfromgetDataset/createintoBigQueryJdbcExceptionand sanitizesdatasetNamein auto-create logs (replacing the misleading"Creating a hidden dataset"message).USER_GUIDE.md,DataSourceTest,BigQueryStatementTest):>= 1hpreservation,409race handling, and dataset RPC error wrapping.Follow-Up Issues
b/592582350— BigQuery API /LargeResultDatasetephemeral destination-table design (multi-user ACL isolation, native per-query TTL, lifecycle cleanup).b/592250778— Per-connectiondatasets.getcaching with404invalidation.Verification
make lint(fmt:2.29), Checkstyle (0violations)