Skip to content

CAS: EXPORT PARTITION descriptors written by 26.6.x are lost after upgrading to 26.8 #2957

Not planned

Description

@alsugiliazova

✅ I checked the Altinity Stable Builds lifecycle table, and the Altinity Stable Build version I'm using is still supported.

Type of problem

Bug report - something's broken

Describe the situation

On a CAS disk, 26.6.x stores a plain MergeTree table's EXPORT PARTITION descriptors as a part named partition_exports. #2647 made partition_exports/ a reserved table-level directory in 26.8, so 26.8 reads that path as table-level files instead. Nothing migrates the old part. After the upgrade, descriptors written under 26.6.x are not found, and nothing reports them missing.

The export scheduler uses these descriptors to resume work at startup, so after the upgrade:

  • A PENDING export started under 26.6.x is never resumed or committed. The destination can be left with exported files that were never committed.
  • Exports started under 26.6.x disappear from system.partition_exports, and KILL EXPORT PARTITION can no longer target them.
  • The old partition_exports part ref stays committed in the table's namespace until DROP TABLE.

Found by a static audit of #2647, confirmed against antalya-26.6 and antalya-26.8. Not yet reproduced at runtime.


How to reproduce the behavior

Environment

  • Before: antalya-26.6 with a CAS disk (checked at 7f385829bd3)
  • After: antalya-26.8 (checked at 6b3224ca8c3)

Steps

  1. On 26.6.x, create a plain MergeTree table on a CAS disk and start a partition export. Stop the server while the export is still PENDING, for example by making the destination unavailable.
CREATE TABLE src (p UInt8, x UInt64) ENGINE = MergeTree PARTITION BY p ORDER BY x
SETTINGS storage_policy = '<cas policy>';
INSERT INTO src SELECT 1, number FROM numbers(1000);
ALTER TABLE src EXPORT PARTITION ID '1' TO TABLE <destination>
SETTINGS allow_experimental_export_merge_tree_partition = 1;
SELECT status FROM system.partition_exports WHERE source_table = 'src';  -- PENDING
  1. Stop every 26.6.x server, run clickhouse-disks cas-migrate-pool, and start the 26.8 server.

  2. Check the export:

SELECT * FROM system.partition_exports WHERE source_table = 'src';

Expected behavior

The export started under 26.6.x is still listed after the upgrade, and a PENDING export resumes. Alternatively, the upgrade or migration refuses with a message naming the leftover descriptors.


Actual behavior

No row is returned, the export is not resumed, and no error or warning is logged.


Root cause analysis

  • 26.6.x writes the descriptors as a part. MergeTreePartitionExportScheduler stores them under <table>/partition_exports/ (MergeTreePartitionExportScheduler.cpp, line 57). On 26.6.x, findPartDirComponent (ContentAddressed/Parts/PartPathParser.cpp) reserves only deduplication_logs after the table UUID. So <uuid>/partition_exports/<key>.json becomes a file of a part named partition_exports. The CAS whitelist in MergeTreeData::checkAlterPartitionIsPossible allows EXPORT_PARTITION, so the command runs. The CAS: ref-log owner Move for part renames (format generation 2) #2647 commit 5a1ffb222a describes this behaviour: "The CAS path parser took that directory for a part named partition_exports, so the scheduler's tmp + replaceFile sequence ran as two part publications."
  • 26.8 reads the path differently. CAS: ref-log owner Move for part renames (format generation 2) #2647 added kPartitionExportsDirName (PartPathParser.h), and parseTableFilePath now treats the path as a table-level file. MergeTreePartitionExportScheduler::load lists partition_exports/ through that path and never sees the old part ref.
  • No migration. No code moves or detects a committed ref named partition_exports. ContentAddressed/Tools/CasMigratePool.cpp doesn't mention it. The gtest CASWiringOps.PartitionExportDescriptorIsATableLevelFile covers only new writes.
  • The version gate doesn't cover it. The pool's min_reader_generation covers ref-log and object formats, not this path layout change.

Suggested fix

Every 26.6.x pool already has to go through cas-migrate-pool with all servers stopped. In that step, or at mount, find a committed part ref named exactly partition_exports in each live table namespace. Then either rewrite its files as table-level files under <table>/partition_exports/, or refuse with a message that names the table and the command that wrote the files.

Suggested regression test

Commit a part ref named partition_exports containing a PENDING <key>.json, the shape 26.6.x writes. Run the migration or restart on 26.8, then assert that system.partition_exports lists the task and that the old part ref is gone.


Additional context

Related PRs

  • #2647 - CAS: ref-log owner Move for part renames (format generation 2). Reserved partition_exports/ without a migration.
  • #2917 - CAS: replace blob markers with deletion intents (format generation 4). Added cas-migrate-pool, the natural place for the fix.

Severity

Medium. No pool data is corrupted, but export task state is lost silently. CAS on 26.6.x is pre-release, so few pools are affected.

Checked before filing

AI note: This issue was drafted by AI (Claude Opus 5.5) from a static code review.

Activity

  1. added
    bug
    on Nov 24, 2026
  2. filimonov commented on Nov 25, 2026

    @filimonov
    Member

    Not a bug to fix. Closing as "won't fix".

    EXPORT PARTITION from a plain MergeTree table on a CAS disk was never tested or guaranteed in 26.6.x. The tests for it are tagged no-cas-storage there, so they did not run on CAS:

    26.8 has the correct behavior: partition_exports/ is a table-level directory (#2647), and these tests run on the CAS lanes.

    We will not add a migration for descriptors written by 26.6.x. ReplicatedMergeTree is not affected: it keeps export state in Keeper.

  3. added
    wontfix
    on Nov 25, 2026
  4. self-assigned this
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CASantalya-26.8bugwontfix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions