paimon icon indicating copy to clipboard operation
paimon copied to clipboard

[Bug] Branches Table created_from_snapshot field result error.

Open herefree opened this issue 1 year ago • 0 comments

Search before asking

  • [X] I searched in the issues and found nothing similar.

Paimon version

master

Compute Engine

flink

Minimal reproduce step

First case

  1. create empty branch.
  2. insert some data to this branch.
  3. select * from t$branches.

Second case

  1. create branch from tag.
  2. delete branch's tag.
  3. wait branch's first snapshot expire.
  4. select * from t$branches.

In above two case,created_from_snapshot both should be null.

What doesn't meet your expectations?

In branches table, if we can't find tag from branches table,we will choose the earliestSnapshotId of branch to be created_from_snapshot. 783a9571-21e7-4d6c-aeca-a7bc55bcf3f8 But if tag not exists,it's hard for us to know whether the earliestSnapshotId of branch is the main branch' snapshot.So I pull request #4159 to fix this issue. created_from_snapshot must from earliestTag of branch.

But it's also have some problem, it's hard for us to know tag is from main branch. For example, if we create empty branch,then insert one data to this branch. Then we create a tag base on this branch's snapshot. create_from_tag and create_from_snaphot both should be null.but we can't judge if this tag is the main branch's tag.

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

herefree avatar Sep 11 '24 06:09 herefree