Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: pageserver: updated detach API (enable doing ancestor detach on timelines that have more than one ancestor) #10310

Open
3 tasks
jcsp opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
c/storage/pageserver Component: storage: pageserver t/feature Issue type: feature, for new features or requests

Comments

@jcsp
Copy link
Contributor

jcsp commented Jan 8, 2025

Currently the timeline detach code can only run if a timeline has a single ancestor: it's harder to go gather layers from a stack of ancestors.

When archived branches are used like snapshots, it is important that after restoring from such a snapshot by creating a child branch, we can still detach it.

This is simplified a lot by the insight that the intervening snapshot branch is empty of writes, so all of the IO we do to copy layers can be sent to the ancestor.

When detaching such a branch, we also don't want to bring any children of the parent with us: this is different to when we're detaching a branch that was created via a PITR restore. This part's probably pretty simple, just skip doing it.

Tasks:

@jcsp jcsp added c/storage/pageserver Component: storage: pageserver t/feature Issue type: feature, for new features or requests labels Jan 8, 2025
@jcsp jcsp changed the title pageserver: enable doing ancestor detach on timelines that have more than once ancestor pageserver: enable doing ancestor detach on timelines that have more than one ancestor Feb 20, 2025
@jcsp jcsp changed the title pageserver: enable doing ancestor detach on timelines that have more than one ancestor pageserver: updated detach API (enable doing ancestor detach on timelines that have more than one ancestor) Mar 3, 2025
@jcsp jcsp changed the title pageserver: updated detach API (enable doing ancestor detach on timelines that have more than one ancestor) Epic: pageserver: updated detach API (enable doing ancestor detach on timelines that have more than one ancestor) Mar 3, 2025
@skyzh
Copy link
Member

skyzh commented Mar 6, 2025

On item 1: It makes sense to expand the detach ancestor code to handle some easy cases like this, it would be a quick patch.

On item 2: sounds like a quick patch as well.

On item 3: I think I'll start with making the current error code more meaningful (i.e., 50X as error, 50Y as detaching in progress), and in the future, it would make sense to have two APIs: start_detach (cplane calls once) and finish_detach (cplane polls until it returns 200). Tenant still remains accessible between start_detach and finish_detach versus cplane now blocks all operations once detach starts.

Anyways, all tasks sound lightweight and I think I can make some progress next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/storage/pageserver Component: storage: pageserver t/feature Issue type: feature, for new features or requests
Projects
None yet
Development

No branches or pull requests

2 participants