Repository navigation
Description
✅ 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
PENDINGexport 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, andKILL EXPORT PARTITIONcan no longer target them. - The old
partition_exportspart ref stays committed in the table's namespace untilDROP 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.6with a CAS disk (checked at7f385829bd3) - After:
antalya-26.8(checked at6b3224ca8c3)
Steps
- On 26.6.x, create a plain
MergeTreetable on a CAS disk and start a partition export. Stop the server while the export is stillPENDING, 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-
Stop every 26.6.x server, run
clickhouse-disks cas-migrate-pool, and start the 26.8 server. -
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.
MergeTreePartitionExportSchedulerstores them under<table>/partition_exports/(MergeTreePartitionExportScheduler.cpp, line 57). On 26.6.x,findPartDirComponent(ContentAddressed/Parts/PartPathParser.cpp) reserves onlydeduplication_logsafter the table UUID. So<uuid>/partition_exports/<key>.jsonbecomes a file of a part namedpartition_exports. The CAS whitelist inMergeTreeData::checkAlterPartitionIsPossibleallowsEXPORT_PARTITION, so the command runs. The CAS: ref-log owner Move for part renames (format generation 2) #2647 commit5a1ffb222adescribes this behaviour: "The CAS path parser took that directory for a part namedpartition_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), andparseTableFilePathnow treats the path as a table-level file.MergeTreePartitionExportScheduler::loadlistspartition_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.cppdoesn't mention it. The gtestCASWiringOps.PartitionExportDescriptorIsATableLevelFilecovers only new writes. - The version gate doesn't cover it. The pool's
min_reader_generationcovers 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
- No open or closed issue or PR mentions
partition_exportsmigration on CAS. - The open CAS PRs against
antalya-26.8(Stabilize CAS: fsck, GC liveness and S3 read fixes #2941, Antalya 26.8: Auto-prune expired empty fenced CAS mount slots via cas_auto_forget_fenced_empty_after_sec #2919, Clarify CAS orphan manifest sweep state and test pause and resume #2954, Batch conditional CAS GC blob deletes on S3 #2534, Antalya 26.8: Short-circuit idle CAS GC rounds, cache terminal mount ETags, and suppress idle heartbeats #2920, Antalya 26.8: Allow Suspended S3 bucket versioning via cas_allow_versioning_suspended #2918, Antalya 26.8: Honor remote_fs_execute_merges_on_single_replica_time_threshold on CAS disks and tolerate trailing whitespace in ServerUUID::load #2916, Antalya-26.8: Split TSan CAS stateless lane into 4 shards, move MSan CAS to the large runner #2926) don't touch this. Stabilize CAS: fsck, GC liveness and S3 read fixes #2941 editsCasMigratePool.cpp, but only an unrelated probe.
AI note: This issue was drafted by AI (Claude Opus 5.5) from a static code review.
Activity
filimonov commentedon Nov 25, 2026
Not a bug to fix. Closing as "won't fix".
EXPORT PARTITIONfrom a plainMergeTreetable on a CAS disk was never tested or guaranteed in 26.6.x. The tests for it are taggedno-cas-storagethere, so they did not run on CAS:05027_export_partition_merge_tree.sh05029_export_partition_key_collision_merge_tree.sh26.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.
ReplicatedMergeTreeis not affected: it keeps export state in Keeper.