-
Notifications
You must be signed in to change notification settings - Fork 492
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
Remove timeline names from pageserver #1286
Conversation
@@ -0,0 +1,320 @@ | |||
//! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That used to be branches.rs
, so not all of the code was added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally in favour of this, +1.
This does make the CLI user experience much worse though. Previously, you would do this:
./target/release/zenith init
./target/release/zenith start
./target/release/zenith pg start main
That doesn't work anymore, you have to specify a timeline ID to the 'zenith pg start' command:
$ ./target/debug/zenith pg start main
command failed: No timeline id, use --timeline to specify one
You have to copy-paste the random timeline ID from the output of the 'zenith init' command. And the advise above isn't actually correct: there is no '--timeline' option:
$ ./target/debug/zenith pg start main --timeline 2d88ad2ce4591b9fa55223b6d28153b8
error: Found argument '--timeline' which wasn't expected, or isn't valid in this context
If you tried to supply `--timeline` as a value rather than a flag, use `-- --timeline`
USAGE:
zenith pg start [OPTIONS] <node> [timeline]
For more information try --help
The correct syntax is:
./target/debug/zenith pg start main 2d88ad2ce4591b9fa55223b6d28153b8
Anyway, I'd like to keep that developer experience nicer. Could we still have branch names, just for the CLI? They don't need to be stored in the page server, just keep them e.g. a json file in the .zenith directory and map from the branch name to the timeline ID in the CLI.
Something's wrong with the 'timeline create' or 'list' command:
The newly created timeline isn't visible in the list. |
Totally on board with the need to improve the UX, just not sure if branch names at its current form are good to use? Given that we already have to manipulate So, |
Fair enough. I agree it's a bit confusing.
Ok, I guess that's enough. And we can add more decorations later when we start to do more stuff with branches, if we need to. |
c89fd57
to
85b4ccf
Compare
eae0631
to
e1d1202
Compare
I should be fixing all (or close to that) tests now (including the list command), revamped the API, yet only now fully realized, that |
9d0c711
to
e672110
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I like these changes
As I mentioned in one of the comments we may even want to remove the create tenant flag from init and let the cli make needed api calls. It may be not so convenient for cli because then we have to start pageserver to make these calls as opposed to init which doesnt have to do so
+1 on a name->mapping for timelines, we can embed the table directly in cli's config file
aa420e6
to
222e935
Compare
Names had returned to Zenith CLI, all the feedback had been addressed or answered. The tests seem to pass either. Please have a look and tell me what you think, I'll prepare some digest on the broken APIs to discuss it in more detail. |
8a42a86
to
e137591
Compare
9d505ac
to
0990992
Compare
CI tests pass now in the corresponding console PR: https://github.com/zenithdb/console/pull/782
Console code shrinked too, yet the currently do not have names in the logic at all, compared to our Currently, I plan to merge this PR due to mostly general feedback before, after its console counterpart will be ready for merging. |
dcb5c13
to
4da977a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice!
I've left some minor comments
0015ca1
to
b9c0415
Compare
b9c0415
to
755fc52
Compare
Part of https://github.com/zenithdb/console/issues/693 and will require console adjustments.
Removes branch name, branch tag, related files and related code from pageserver's API, adjusting zenith and tests.
"Branch" concept is gone and now pageserver operates "timeline" only, yet the concept of "branching" is not removed itself: timelines still have ancestors and can branch off one from each other at given Lsn or from the end, as before.
Also, during API adjustment, "point in time" concept got removed, split into explicit "Lsn" and "ZTimelineId" parts.
One implicit advantage of the name removal is a more explicit separation between "postgres node name" and "branch name" that was used as the same entity in our tests when branching timelines.
This PR has a few tests failing, but most of them pass already, so it's time to consider, whether the approach is ok and if we want to go with it in general.