Repository navigation
Upgrade check: judge a row policy only on tables that can be read without it - #126895
Conversation
…hout it The stress phase can leave a database-level policy (`ON test_1.* USING 1`, from an interrupted 02703) over a database where another test left a data lake table without files (04894 deletes them in an `EXIT` trap). The row-policy check stopped on that table with `Code: 107 FILE_DOESNT_EXIST`, which is not a filter error, and wrote a false `Cannot check whether the row policies can be applied` FAIL row (seen on ClickHouse#126223). The batched check of all covered tables stays the fast path. When it fails with an analysis error or 107, the tables are checked one by one, with and without the filter: a table that fails the same way without the filter is logged to `unreadable_row_policy_tables.txt` and skipped, a filter that fails on a readable table is classified as before, anything else is a FAIL row. A `DeltaLakeLocal` table without files fails with `Code: 742 DELTA_KERNEL_ERROR` instead of 107 and is handled the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review in 2 rounds by an independent model (engine: codex; 2 findings in round 1, 0 in round 2) plus my own cold review (1 major, 2 nits).
Also checked by code reading on 26.9: a Delta Lake table made with |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261020-072500 |
|
cc @fm4v, could you review this and add the |
|
Workflow [PR], commit [0b11081] Summary: ✅ AI ReviewSummaryThe upgrade check now distinguishes row-policy filter failures from failures of the covered table and excludes parameterized views from these probes. No actionable findings in Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
`03322_view_over_parameterized_view` leaves the parameterized view `test_1.v` and an interrupted `02703_row_policy_for_database` leaks `ON test_1.* USING 1`. A parameterized view has no columns until its parameters are given, so `SELECT 1 FROM v` fails the access check for any user (Code 497), and a filter naming a column fails with an unknown identifier, which dropped a valid policy. Red on ClickHouse#126880 and ClickHouse#127094. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review of 0b11081: adjudication log (click to expand)Pre-publication review of the added commit in 1 round by an independent model (engine: codex; 0 findings) plus my own cold review (2 nits, PR text only).
Also checked by code reading: a parameterized view is the only table kind without stored columns ( |
|
Added |
There was a problem hiding this comment.
🟢 Approval recommended
The focused change preserves policy classification and unexpected-error reporting, with no unresolved findings.
No open issues 🎉
What changed in this PR
This PR refines the upgrade check introduced in #126169 so unreadable leftover tables do not cause false row-policy failures.
Changes:
- Excludes parameterized views from row-policy checks.
- Preserves the batched fast path, then compares filtered and unfiltered checks after selected failures.
- Logs unreadable tables while retaining invalid-filter detection and unexpected-error reporting.
| File | Description |
|---|---|
tests/docker_scripts/upgrade_runner.sh |
Adds per-table comparison and diagnostics to distinguish table failures from invalid row-policy filters. |
Review effort: Balanced
Related: #126169
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Upgrade check (amd_release)gave a falseCannot check whether the row policies can be appliedFAIL row with the filter1:Code: 107 ... The metadata file for Iceberg table ... doesn't existon #126223 (report),Code: 497 ... grant SELECT for at least one column on test_1.von two other PRs (report, report).Root cause. An interrupted
02703_row_policy_for_database.shleavesON test_1.* USING 1in the stress database, where04894_iceberg_partition_transform_names.shleavesIcebergLocaltables whose files itsEXITtrap deleted, and03322_view_over_parameterized_view.sqlleaves the parameterized viewv. A parameterized view has no columns until its parameters are given:SELECT 1 FROM vfails the access check for any user, and a filter naming a column fails with an unknown identifier, which dropped valid policies. The check added in #126169 ran only with the filter, so it could not tell a table's failure from the filter's.Change. Parameterized views are not checked. The batched check stays the fast path. When it fails with an analysis error or the error of a data lake table without files (107 for Iceberg, 742 for Delta Lake), each table is checked with and without the filter. A table that fails the same way without the filter is logged to
unreadable_row_policy_tables.txtand skipped; a filter that fails on a readable table is classified as before; anything else is still a FAIL row.Validation. Locally on 26.9.19.9, each CI case gives the FAIL row before the change and none after, and a valid column filter next to a parameterized view is kept. A broken filter next to such a table or view is still dropped, in every table order. The #126169 cases give the same 32 dropped and 20 kept policies. 300 tables: +0.5 s, or 19 s when one has no files.
Workflow [PR]
Sync PR [sync-upstream/pr/126895]
Version info
26.11.1.502-master(included in26.11and later)