Skip to content

feat(query): support experimental table branch#19551

Draft
zhyass wants to merge 2 commits intodatabendlabs:mainfrom
zhyass:feat_refactor_tag
Draft

feat(query): support experimental table branch#19551
zhyass wants to merge 2 commits intodatabendlabs:mainfrom
zhyass:feat_refactor_tag

Conversation

@zhyass
Copy link
Member

@zhyass zhyass commented Mar 15, 2026

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

Summary

Tests

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

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):

This change is Reviewable

@zhyass zhyass requested a review from drmingdrmer as a code owner March 15, 2026 14:04
@zhyass zhyass marked this pull request as draft March 15, 2026 14:04
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Mar 15, 2026
Copy link

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

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: d9a61930b6

ℹ️ 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 on lines +642 to +646
let tags = catalog
.list_table_tags(ListTableTagsReq {
table_id: self.get_id(),
include_expired: true,
})

Choose a reason for hiding this comment

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

P1 Badge Protect branch snapshots before purging base history

This purge protection path only enumerates table tags, so active branch references are never added to protected_segments/snapshot_files_to_gc. Branch snapshots are created from base snapshots and can still reference older base-table segments, so running purge/vacuum on the base table can delete files that a live branch still needs, causing branch reads to fail after cleanup.

Useful? React with 👍 / 👎.

Comment on lines +372 to +378
// Protect tags on base table as well.
let catalog = ctx.get_catalog(self.get_table_info().catalog()).await?;
let tags = catalog
.list_table_tags(ListTableTagsReq {
table_id: self.get_id(),
include_expired: false,
})

Choose a reason for hiding this comment

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

P1 Badge Include branch refs in orphan-file reachability scan

The referenced-segment collection used by orphan GC now unions root snapshots with tags but still omits branch refs, yet downstream cleanup treats this set as authoritative when deleting orphan segments/blocks. After introducing table branches, this can incorrectly purge files that remain reachable from a branch snapshot (for example in do_gc_orphan_files), breaking branch queries post-vacuum.

Useful? React with 👍 / 👎.

@zhyass zhyass force-pushed the feat_refactor_tag branch 2 times, most recently from 0ce4207 to 3ce87cc Compare March 17, 2026 18:00
@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

🤖 CI Job Analysis

Workflow: 23408292903

📊 Summary

  • Total Jobs: 86
  • Failed Jobs: 2
  • Retryable: 0
  • Code Issues: 2

NO RETRY NEEDED

All failures appear to be code/test issues requiring manual fixes.

🔍 Job Details

  • linux / test_unit: Not retryable (Code/Test)
  • linux / sqllogic / ee (parquet): Not retryable (Code/Test)

🤖 About

Automated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed).

@zhyass zhyass force-pushed the feat_refactor_tag branch from 3ce87cc to b1a380e Compare March 17, 2026 18:27
zhyass added 2 commits March 21, 2026 02:17
update

update

update

fix test

fix test

fix test

update

update

update

fix test

fix test

fix test

update

update

fix

fix

update
fix

fix

update

update

update

fix

update

update

update

update

update

update

fix

fix

update

update
@zhyass zhyass force-pushed the feat_refactor_tag branch from b1a380e to 8690b60 Compare March 22, 2026 17:18
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