Skip to content

Azure: fix listObjects dropping the endpoint prefix on pages after the first - #112872

Merged
arsenmuk merged 4 commits into
masterfrom
arsenmuk/az-listobjects-prefix
Aug 10, 2026
Merged

arsenmuk merged 4 commits into
masterfrom
arsenmuk/az-listobjects-prefix

Conversation

@arsenmuk

@arsenmuk arsenmuk commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Series: #112872 (this), #112871, #112873, #112874, #112875, #112876

Problem. On a prefixed-endpoint Azure disk, listObjects returns wrong blob names on every page after the first: the client wrapper strips the endpoint prefix, but the SDK's MoveToNextPage() refetches pages 2..N directly and leaves the raw Azure prefix on their names. Failure scenario:

listObjects(prefixed endpoint, >1 page):
  page 1  = client wrapper ListBlobs()  -> names prefix-stripped (correct)
  page 2+ = response.MoveToNextPage()    -> names keep the raw prefix (wrong paths)

Fix. Paginate with the continuation token, re-entering the wrapper each page so every page's names are stripped.

Changes.

  • Disks/…/AzureBlobStorage/AzureObjectStorage::listObjects: drive pagination via ContinuationToken instead of MoveToNextPage.

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed listObjects on a prefixed-endpoint Azure Blob Storage disk returning wrong blob names on every page after the first, because pagination bypassed the client wrapper that strips the endpoint prefix. Pagination now re-enters the wrapper via the continuation token so every page's blob names are correct.

@clickhouse-gh

clickhouse-gh Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dd77f30]

Summary: ✅


AI Review

Summary

This PR fixes AzureObjectStorage::listObjects for prefixed Azure endpoints by paginating via the continuation token so each page is fetched through ContainerClientWrapper, and it adds an Azurite regression test for the multi-page metadata_type=plain path that previously lacked coverage. I did not find any remaining correctness, safety, or test-coverage issues in the current code.

Final Verdict

✅ No new findings.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.50% 86.50% +0.00%
Functions 91.80% 91.90% +0.10%
Branches 78.70% 78.70% +0.00%

Changed lines: Changed C/C++ lines covered: 14/14 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh

clickhouse-gh Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.50% 86.50% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 78.70% 78.70% +0.00%

Changed lines: Changed C/C++ lines covered: 14/14 (100.00%) · Uncovered code

Full report · Diff report

Attaches a MergeTree table read-only from a metadata_type=plain Azure disk with a prefixed endpoint and list_object_keys_size=1, so reading it back lists blobs across more than one page via MetadataStorageFromPlainObjectStorage::listDirectory -> AzureObjectStorage::listObjects. Fails on master (pages after the first keep the raw endpoint prefix, so the parts are unreadable and SELECT returns 0 rows); passes with the fix.
The flaky check runs the module on several xdist workers at once; they raced on the shared _gen/disk_storage_conf.xml, so one worker's server could read another worker's azurite port and get persistent connection refusals. Name the generated config per worker, and route the azurite-touching queries through azure_query for the known transient error classes.
@arsenmuk
arsenmuk force-pushed the arsenmuk/az-listobjects-prefix branch from 7882ff9 to dd77f30 Compare August 5, 2026 06:40
@arsenmuk
arsenmuk marked this pull request as ready for review August 5, 2026 06:41
@SmitaRKulkarni SmitaRKulkarni self-assigned this Aug 5, 2026

@SmitaRKulkarni SmitaRKulkarni 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.

LGTM

@arsenmuk
arsenmuk added this pull request to the merge queue Aug 10, 2026
Merged via the queue into master with commit b5e682f Aug 10, 2026
353 of 354 checks passed
@arsenmuk
arsenmuk deleted the arsenmuk/az-listobjects-prefix branch August 10, 2026 17:37
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants