Skip to content

--partitions wrong try to apply for skiped tables like system.*, and more infromative error message when table have incompatible PARTITION BY expression - #1548

Merged
Slach merged 3 commits into
masterfrom
fix/1547-partitions-skip-tables
Sep 11, 2026
Merged

--partitions wrong try to apply for skiped tables like system.*, and more infromative error message when table have incompatible PARTITION BY expression#1548
Slach merged 3 commits into
masterfrom
fix/1547-partitions-skip-tables

Conversation

@Slach

@Slach Slach commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Slach and others added 3 commits September 10, 2026 19:31
ConvertPartitionsToIdsMapAndNamesList applied tuple --partitions values to
every table returned by GetTables, including tables with Skip=true
(skip_tables, e.g. system.*). For system.metric_log this ended in
getPartitionIdWithTempTable and log.Fatal(), killing the API server.

Skipped tables are never backed up, so resolving partition_id for them is
pointless. Skip them before calling GetPartitionIdAndName.

Fixes part of #1547

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replace log.Fatal() in ConvertPartitionsToIdsMapAndNamesList with a
log.Error() that names the table, its PARTITION BY expression and the
--partitions value, and explains that the table is backed up without a
partition filter. A single unresolvable value (e.g. tuple with two values
against a PARTITION BY with one component) killed the whole API server.

Fixes #1547

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…resolved

ConvertPartitionsToIdsMapAndNamesList now returns an error naming the
table, its PARTITION BY expression and the offending --partitions value,
and every caller (create, download, dry-run, local table list, restore_cloud)
propagates it, so the operation fails with a clear message instead of
killing the API server or silently backing up the table without filter.

Fixes #1547

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coveralls

coveralls commented Sep 10, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34492104618

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.09%) to 66.996%

Details

  • Coverage decreased (-0.09%) from the base build.
  • Patch coverage: 28 uncovered changes across 6 files (36 of 64 lines covered, 56.25%).
  • 33 coverage regressions across 9 files.

Uncovered Changes

File Changed Covered %
pkg/backup/dry_run_download.go 8 2 25.0%
pkg/backup/table_pattern.go 8 2 25.0%
pkg/backup/restore_cloud.go 12 7 58.33%
pkg/partition/partition.go 24 19 79.17%
pkg/backup/download.go 8 4 50.0%
pkg/backup/create.go 4 2 50.0%

Coverage Regressions

33 previously-covered lines in 9 files lost coverage.

File Lines Losing Coverage Coverage
pkg/storage/gcs.go 15 54.46%
pkg/clickhouse/clickhouse.go 4 80.03%
pkg/partition/partition.go 3 67.42%
pkg/backup/backuper.go 2 77.8%
pkg/backup/create.go 2 74.49%
pkg/metadata/backup_metadata.go 2 71.43%
pkg/storage/general.go 2 69.57%
pkg/storage/structs.go 2 81.82%
pkg/backup/restore_cloud.go 1 20.71%

Coverage Stats

Coverage Status
Relevant Lines: 25906
Covered Lines: 17356
Line Coverage: 67.0%
Coverage Strength: 35474.46 hits per line

💛 - Coveralls

@Slach
Slach merged commit bc32b25 into master Sep 11, 2026
58 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants