Repository navigation
Support azure datalake storage gen2 writer - #105406
Conversation
|
Workflow [PR], commit [52d8c3f] Summary: ❌
AI ReviewSummaryThis PR adds an ADLS/OneLake write/delete path for Azure object storage by routing selected Fabric endpoints through PR Metadata
Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block Minimum required actions: fix the unsafe rollback behavior for existing-object rewrites, preserve the existing Azure write durability/accounting controls on the ADLS branch, and add focused coverage for the new writer path. |
| LOG_TRACE(log, "Flushed ADLS Gen2 file `{}` ({} bytes)", blob_path, bytes_appended); | ||
| } | ||
|
|
||
| void WriteBufferFromAzureDataLakeStorage::finalizeImpl() |
There was a problem hiding this comment.
WriteBufferFromAzureDataLakeStorage ignores RequestSettings::check_objects_after_upload.
The Blob/S3 paths perform a post-finalize existence check when this flag is enabled, but the ADLS path always returns success after Flush without verifying object visibility. That silently weakens an existing durability check users explicitly opt into.
Please carry this setting into the ADLS writer and run a post-finalize GetProperties/GetProperties-equivalent check (throw on NotFound) the same way as WriteBufferFromAzureBlobStorage.
| if (to_append == 0) | ||
| return; | ||
|
|
||
| ensureCreated(); |
There was a problem hiding this comment.
WriteBufferFromAzureBlobStorage and WriteBufferFromS3 both apply write_settings.remote_throttler to account/limit outbound bytes, but this ADLS path never does. As written, the isAdlsGen2Endpoint branch bypasses configured write throttling entirely.
Please apply throttling before each upload chunk (for example, in appendBufferedData, throttle to_append before Append).
| LOG_INFO(log, "ADLS Gen2 {} attempt {} for `{}`", what, attempt, blob_path); | ||
| try | ||
| { | ||
| op(); |
There was a problem hiding this comment.
runWithRetries executes ADLS network operations without the write ResourceGuard used by the Blob path (WriteBufferFromAzureBlobStorage::execWithRetry).
That means isAdlsGen2Endpoint uploads bypass write_settings.io_scheduling.write_resource_link accounting/limits, so ADLS writes are no longer governed by configured I/O scheduling controls.
Please apply the same ResourceGuard around these operations (at least Append with byte cost, and Create/Flush with zero cost) to preserve scheduler semantics.
|
|
||
| auto hint_path = filename_generator.generateVersionHint(); | ||
| if (!writeMetadataFileAndVersionHint( | ||
| if (!catalog && !writeMetadataFileAndVersionHint( |
There was a problem hiding this comment.
We don’t need to update both the metadata on storage and the catalog metadata, since the catalog updates the metadata on storage by itself
We also don’t need to use the version hint file as a synchronization point, since the catalog does CAS
The test was occasionally returning two rows from the per-iteration SELECT against `system.query_log` instead of one, observed as a spurious extra `1` in the diff before the expected `7` for `max_threads = 7` iterations across multiple unrelated PRs (ClickHouse#101143, ClickHouse#105406, ClickHouse#102308, ClickHouse#100752, ClickHouse#104473, ClickHouse#98779, ClickHouse#97302) and on master. The original filter accepted any `type != 'QueryStart'` row matching the iteration's `query_id`. Under randomized CI settings a second `query_log` entry can match the same `query_id` (subquery, distributed sub-fragment, or non-`Insert` follow-up), giving the test two rows. Tighten the filter to require the successful initial INSERT only: `type = 'QueryFinish' AND is_initial_query = 1 AND query_kind = 'Insert'`. This matches the well-known sibling test `02871_peak_threads_usage`, which already filters on `type = 'QueryFinish'`. Verified locally that the new filter correctly suppresses a duplicate log row sharing the same `query_id` while still returning exactly one row for the real INSERT. CI report (one of the recent failures): https://s3.amazonaws.com/clickhouse-test-reports/101143/ Co-Authored-By: Claude Opus 4.8 <[email protected]>
asya-ch
left a comment
There was a problem hiding this comment.
Looks good -- please do address the bot comment about adding the next() flush inside of finalizeImpl().
| blob_storage_log->local_path = object.local_path; | ||
| if (isAdlsGen2Endpoint(connection_params.endpoint)) | ||
| { | ||
| return std::make_unique<WriteBufferFromAzureDataLakeStorage>( |
There was a problem hiding this comment.
This branch adds a new ADLS/OneLake writer, but the PR does not add or enable a test that actually writes through it. The existing OneLake INSERT e2e test is still xfail, so endpoint selection, auth/SAS handling, prefix handling, finalize/cancel, and delete cleanup can regress without CI coverage.
Please add the smallest focused test that exercises this branch end to end, or un-xfail/adapt the OneLake insert test so the new writer is covered.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 23/193 (11.92%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
cdea425
|
Hi @scanhex12 — a couple of suggestions to make this PR easier for reviewers and the changelog reader. Description (currently
Ignore this if the current title/body is intentional. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support writing into such storage https://learn.microsoft.com/en-us/training/modules/introduction-to-azure-data-lake-storage/2-azure-data-lake-gen2