Skip to content

Add test for checkImmutableFieldsEquals in ObjectStorageQueueTableMetadata.cpp - #125286

Merged
alexbakharew merged 4 commits into
ClickHouse:masterfrom
clickgapai:covgap/05366_s3queue_metadata_mismatch_immutable_fields
Oct 16, 2026
Merged

alexbakharew merged 4 commits into
ClickHouse:masterfrom
clickgapai:covgap/05366_s3queue_metadata_mismatch_immutable_fields

Conversation

@clickgapai

@clickgapai clickgapai commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Test-only PR from the coverage agent. Review: is the gap real, is the test right.

Adds tests/queries/0_stateless/05366_s3queue_metadata_mismatch_immutable_fields, which executes code that no stateless test on master executes: checkImmutableFieldsEquals in src/Storages/ObjectStorageQueue/ObjectStorageQueueTableMetadata.cpp, lines 250-367 (source at dbc8c4fb8d2a). The function had 53 executable lines with 0 hits in the 4 LLVM coverage baselines of master (dbc8c4f, 1bc3e78, 839f7a8, 56ffbc1).

Why this test is needed: This test is needed because checkImmutableFieldsEquals guards SQL-reachable ObjectStorageQueue metadata checks and must reject immutable setting drift instead of silently accepting it.
What the test asserts: The test asserts that mismatched immutable ObjectStorageQueue metadata raises a visible METADATA_MISMATCH error for the conflicting setting.

Measured on the CI coverage build of dbc8c4fb8d2a. A line counts as uncovered only when it has 0 hits in all 4 baselines.

Check Result
Plain run on the release binary OK in 1.14 s on the plain binary
Coverage effect 48/53 target lines hit; expected missed []; new lines in file 59
Reruns, random and pinned settings {'reruns': {'random': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail': 0, 'slowest_s': 1.14, 'wall_s': 24.31}, 'pinned': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail'
Style check style check ok in 20 s
Duplicate statements in tests/queries/0_stateless 12 statements, no duplicate

The test was written by an AI agent (a Nerve worker on Claude) from a task of a deterministic census, verified by the gates above, and released under content hash 1dcb31b3d539. It was renumbered from 05353_s3queue_metadata_mismatch_immutable_fields at publication. The PR is a draft until a person has reviewed it. Replies to review comments come from the agent's owner, not from the agent.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...


Workflow [PR]
Sync PR [sync-upstream/pr/125286]

Version info

  • Merged into: 26.11.1.59-master (included in 26.11 and later)

…Metadata.cpp`

Test `05366_s3queue_metadata_mismatch_immutable_fields` for `checkImmutableFieldsEquals` in `src/Storages/ObjectStorageQueue/ObjectStorageQueueTableMetadata.cpp`; written by the coverage agent, verified against the master coverage baselines, release hash 1dcb31b3d539.
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 12, 2026
@alexbakharew alexbakharew added ci-force-all Do not skip any jobs when running can be tested Allows running workflows for external contributors labels Oct 13, 2026
@alexbakharew alexbakharew self-assigned this Oct 13, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [20a1146]

Summary: ✅

LLVM Coverage Report

Measured on commit 20a1146.

Metric Baseline Current Δ
Lines 88.50% 88.50% +0.00%
Functions 92.20% 92.20% +0.00%
Branches 80.10% 80.00% -0.10%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +305 lines in 70 files (-189 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 13, 2026
…review

Repair round of the coverage agent for PR ClickHouse#125286; verified again against the master coverage baselines, release hash 2e57c6dc8fd3.
…review

Repair round of the coverage agent for PR ClickHouse#125286; verified again against the master coverage baselines, release hash a87996affe64.
@clickgapai clickgapai changed the title Add test for checkImmutableFieldsEquals in ObjectStorageQueueTableMetadata.cpp [needs human] Add test for checkImmutableFieldsEquals in ObjectStorageQueueTableMetadata.cpp Oct 13, 2026
@alexbakharew alexbakharew added ci-llvm-coverage and removed ci-force-all Do not skip any jobs when running labels Oct 14, 2026
Rerun CI after the fix of the LLVM Coverage baseline lookup (ClickHouse PR 125987): the previous runs failed only in jobs or tests that are not from this test. Manual retrigger by the owner, not a CI attempt of the agent.

Same content as 275e2a1, pushed by the coverage agent so that CI runs the red jobs again against the current master.
@clickgapai clickgapai changed the title [needs human] Add test for checkImmutableFieldsEquals in ObjectStorageQueueTableMetadata.cpp Add test for checkImmutableFieldsEquals in ObjectStorageQueueTableMetadata.cpp Oct 15, 2026
@clickgapai
clickgapai marked this pull request as ready for review October 15, 2026 14:46
@alexbakharew
alexbakharew added this pull request to the merge queue Oct 16, 2026
Merged via the queue into ClickHouse:master with commit 0905853 Oct 16, 2026
179 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 16, 2026
@clickhouse-gh clickhouse-gh Bot added comp-s3queue S3Queue/AzureQueue engines (queue-based ingestion from object storage). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
NIKTONIKTO717 added a commit that referenced this pull request Nov 23, 2026
…rypick/26.10/129383

Conflicts:
- `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds;
  26.10 does not include `<Databases/IDatabase.h>`.
- `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`,
  like the other declarations in 26.10.
- `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case
  of 26.10 and add the `RESTORE` case of the PR.
- `05366_s3queue_metadata_mismatch_immutable_fields`: 26.10 does not have this test,
  which was added in #125286. Add it with
  the cases of the PR.

Related: #129383

Co-Authored-By: Claude Opus 5.5 <[email protected]>
NIKTONIKTO717 added a commit that referenced this pull request Nov 23, 2026
…ypick/26.9/129383

Conflicts:
- `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds;
  26.9 does not include `<Databases/IDatabase.h>`. 26.9 does not have
  `isReplayedTableDefinition` and `isSecondaryDDLReplay`, so `strict_metadata_check`
  uses the same conditions directly, as `registerStorageMergeTree.cpp` does in 26.9.
- `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`,
  like the other declarations in 26.9.
- `StorageObjectStorageConfiguration.h`: add only `initialized_from_named_collection`;
  `is_replayed_definition` is not in 26.9.
- `InterpreterAlterQuery.cpp` and `InterpreterAlterQuery.h`: add the `engine` argument
  to the 26.9 signature of `getRequiredAccessForCommand`. 26.9 does not have
  `run_as_submitting_user` for `Replicated` databases, so that part of the PR is not
  backported, and the comment of the `Replicated` case in
  `05441_s3queue_move_destination_access.sh` says that the initiator checks the grants.
- `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case
  of 26.9 and add the `RESTORE` case of the PR.
- `05366_s3queue_metadata_mismatch_immutable_fields`: 26.9 does not have this test,
  which was added in #125286. Add it with
  the cases of the PR.

Related: #129383

Co-Authored-By: Claude Opus 5.5 <[email protected]>
NIKTONIKTO717 added a commit that referenced this pull request Nov 23, 2026
…ypick/26.8/129383

Conflicts:
- `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds.
  26.8 does not have the `exclusive` mode, so the PR line that clears the path of an
  `exclusive` queue is not backported. 26.8 does not have `isReplayedTableDefinition`
  and `isSecondaryDDLReplay`, so `strict_metadata_check` uses the same conditions
  directly.
- `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`,
  like the other declarations in 26.8.
- `StorageObjectStorageConfiguration.h`: add only `initialized_from_named_collection`;
  `is_replayed_definition` is not in 26.8.
- `InterpreterAlterQuery.cpp` and `InterpreterAlterQuery.h`: add the `engine` argument
  to the 26.8 signature of `getRequiredAccessForCommand`. 26.8 does not have
  `run_as_submitting_user` for `Replicated` databases, so that part of the PR is not
  backported, and the comment of the `Replicated` case in
  `05441_s3queue_move_destination_access.sh` says that the initiator checks the grants.
  26.8 does not look up the table by name again after the access check, and the
  `ALTER` runs on the table that was checked, so the second check of the PR is not
  needed.
- `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case
  of 26.8 and add the `RESTORE` case of the PR.
- `05366_s3queue_metadata_mismatch_immutable_fields`: 26.8 does not have this test,
  which was added in #125286. Add it with
  the cases of the PR, without the case of the `exclusive` mode.

Related: #129383

Co-Authored-By: Claude Opus 5.5 <[email protected]>
NIKTONIKTO717 added a commit that referenced this pull request Nov 23, 2026
…ypick/26.3/129383

Conflicts:
- `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds.
  26.3 does not have the `s3_uri_style` setting, so `getQueueSource` parses the URL
  without user info with the default style, as 26.3 parses the URL of the table.
  `StorageAzureConfiguration` in 26.3 has `getNamespace` instead of `getContainer`.
  26.3 does not have the `exclusive` mode, so the PR line that clears the path of an
  `exclusive` queue is not backported. 26.3 does not have `isReplayedTableDefinition`
  and `isSecondaryDDLReplay`, so `strict_metadata_check` uses the same conditions
  directly.
- `Azure/Configuration.h`: 26.3 does not have `getSasKey`, so the new
  `getConnectionURLWithoutQuery` reads `connection_params.endpoint.sas_auth`.
- `StorageObjectStorageConfiguration.cpp` and `StorageObjectStorageConfiguration.h`:
  add only `initialized_from_named_collection`.
- `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`,
  like the other declarations in 26.3.
- `StorageObjectStorageQueue.cpp`: `alter` in 26.3 takes the mode from
  `getTableMetadata`, so the settings of the queue on this server come from it too.
- `InterpreterAlterQuery.cpp` and `InterpreterAlterQuery.h`: `getRequiredAccess` in
  26.3 does not take the table, so it takes the name of the engine, and
  `executeToTable` passes the engine of the table that is not a stand-in of a table
  that is not loaded yet. 26.3 does not have `run_as_submitting_user` for
  `Replicated` databases, so that part of the PR is not backported, and the comment of
  the `Replicated` case in `05441_s3queue_move_destination_access.sh` says that the
  initiator checks the grants. 26.3 does not look up the table by name again after
  the access check, and the `ALTER` runs on the table that was checked, so the second
  check of the PR is not needed.
- `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case
  of 26.3 and add the `RESTORE` case of the PR.
- `05366_s3queue_metadata_mismatch_immutable_fields`: 26.3 does not have this test,
  which was added in #125286. Add it with
  the cases of the PR, without the cases of the `exclusive` mode and of `s3_uri_style`.
- `test_storage_s3_queue/test_0.py`: the old version of the upgrade test is 25.10,
  because 26.7 is newer than 26.3.

Related: #129383

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors ci-llvm-coverage comp-s3queue S3Queue/AzureQueue engines (queue-based ingestion from object storage). pr-not-for-changelog This PR should not be mentioned in the changelog 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