Skip to content

TTL Export and refactor of partition export into distributed part export - #2442

Open
arthurpassos wants to merge 10 commits into
antalya-26.6from
feature/antalya-26.6/export-partition-iterations
Open

arthurpassos wants to merge 10 commits into
antalya-26.6from
feature/antalya-26.6/export-partition-iterations

Conversation

@arthurpassos

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • New Feature

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

...

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T17:55:52.513498Z 0c4df47 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [0435e83]

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const StorageID destination_storage_id{descriptor_copy.destination_database, descriptor_copy.destination_table};

P1 Badge Refuse a replacement destination with a different UUID

When a plain MergeTree export remains pending while its destination is dropped and recreated under the same name, this reconstructs the destination from its name alone even though the persisted descriptor records destination_uuid. The task can therefore write and commit into the replacement table; for an EXPORT TTL, the UUID-keyed scheduler may then export the same ranges again under the new destination key, producing duplicate rows. Resolve or validate the recorded UUID before dispatch and commit, and fail the task when the named table has a different identity.

AGENTS.md reference: AGENTS.md:L153-L153

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@arthurpassos

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const StorageID destination_storage_id{descriptor_copy.destination_database, descriptor_copy.destination_table};

P1 Badge Honor the persisted destination UUID when resuming exports

For a plain MergeTree export, the descriptor persists destination_uuid, but this reconstructs the destination using only its database and table name, and the commit path performs the same name-only lookup. If the destination is dropped and recreated under the same name while a task is pending or while the server is down, the old task can write and commit its files into the replacement table instead of failing closed. Resolve or validate the destination against descriptor_copy.destination_uuid before exporting and committing.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +468 to +469
if (part->rows_count == 0)
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Advance retained zero-row parts through the export fence

When an active zero-row part is retained, for example with remove_empty_parts = 0, this branch leaves its range permanently in the NONE state. After another part in the partition is exported, ExportFence::checkCanMerge rejects merging the empty part with that neighbor because their export states differ, so even OPTIMIZE cannot consolidate the partition; a due delete TTL can also keep reporting the empty part as held. Record zero-row ranges as exported or otherwise exempt them from the fence instead of skipping them indefinitely.

Useful? React with 👍 / 👎.

@arthurpassos arthurpassos mentioned this pull request Sep 28, 2026
8 of 27 tasks
@arthurpassos arthurpassos changed the title wild and secret idea TTL Export and refactor of partition export into distributed part export Sep 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants