Skip to content

feat(query): support experimental table branch - #20403

Draft
zhyass wants to merge 3 commits into
databendlabs:mainfrom
zhyass:pr_branch
Draft

feat(query): support experimental table branch#20403
zhyass wants to merge 3 commits into
databendlabs:mainfrom
zhyass:pr_branch

Conversation

@zhyass

@zhyass zhyass commented Aug 27, 2026

Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This PR brings the previously reviewed and merged table-branch implementation from #19551 to main.

The feature adds experimental table branches for FUSE tables: lightweight writable forks with independent snapshot histories and copy-on-write sharing of existing segments and blocks. It includes branch metadata and lifecycle APIs, branch-qualified table resolution, branch-safe vacuum/GC behavior, and protection for files still referenced by active branches or tags.

Implementation notes

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Validation performed:

  • make lint
  • Targeted cargo check for meta app/API/proto conversion/schema test suite, SQL, Fuse storage, and enterprise query crates
  • Meta branch key tests: 5 passed
  • Ref API tests: 14 passed
  • Proto conversion tests passed
  • Schema API single-node integration test passed, including branch GC and undrop retention coverage

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

Review context

The feature implementation was already reviewed in #19551 before being merged into feat_branch. Reviewers can focus this round on the adaptation to current main and any integration changes since that review.

AI assistance

  • AI usage: An AI coding agent assisted with merging current main, resolving API compatibility issues, running validation, and drafting this PR summary. The responsible human reviewed the feature previously through feat(query): support experimental table branch #19551 and owns this submission.
  • Responsible human: @zhyass
  • The responsible human has read every line of this diff and can explain each change

This change is Reviewable

zhyass added 2 commits May 18, 2026 22:27
* support table branch

fix

fix

fix

fix

fix

* remove HistoryTableBranchMeta

* fix

* fix review comments

* fix review comments

* fix

* fix review comments

* fix

* fix review comments

* fix

* fix

* fix

* fix test

* fix test

* resolve conflict

* fix review comments
@zhyass
zhyass requested a review from drmingdrmer as a code owner August 27, 2026 17:06
@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label Aug 27, 2026
@zhyass
zhyass marked this pull request as draft August 27, 2026 17:07

@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

Here are some automated review suggestions for this pull request.

Reviewed commit: 70a7f8f7b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/ee/src/storages/fuse/operations/vacuum_table_v2.rs
@zhyass

zhyass commented Aug 28, 2026

Copy link
Copy Markdown
Member 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

Here are some automated review suggestions for this pull request.

Reviewed commit: eee055f662

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/ee/src/table_ref/handler.rs
Comment thread src/meta/api/src/api_impl/ref_api.rs
fix(vacuum): serialize branch final gc

fix(vacuum): preserve expired branch retention origin

test(vacuum): check exact branch storage paths

fix

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

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant