-
Notifications
You must be signed in to change notification settings - Fork 984
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
Feature/timelineid in clone section #1961
base: master
Are you sure you want to change the base?
Feature/timelineid in clone section #1961
Conversation
@@ -197,7 +197,8 @@ type CloneDescription struct { | |||
S3Endpoint string `json:"s3_endpoint,omitempty"` | |||
S3AccessKeyId string `json:"s3_access_key_id,omitempty"` | |||
S3SecretAccessKey string `json:"s3_secret_access_key,omitempty"` | |||
S3ForcePathStyle *bool `json:"s3_force_path_style,omitempty" defaults:"false"` | |||
S3ForcePathStyle *bool `json:"s3_force_path_style,omitempty" defaults:"false"` | |||
TimelineID string `json:"clone_target_timeline" defaults:"latest"` |
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.
Please use go.fmt for right code formatting. This is misaligned.
And type should better be int32
. I know it's used as an environment variable later but we can enforece users to only specify numbers here.
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.
The type has been changed and the formatting is corrected.
I think, we should not use the same name as the Spilo environment variable. We have also omitted the |
pkg/apis/acid.zalan.do/v1/crds.go
Outdated
@@ -211,6 +211,9 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ | |||
Type: "string", | |||
Format: "uuid", | |||
}, | |||
"clone_target_timeline": { | |||
Type: "string", |
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.
type should be integer
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.
Actually the timeline can be characters like A, B etc.. for eg C here: base_0000000C00000001000000A3
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.
But this is not the timeline ID
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.
@Sudeepta92 FxKu is right here. The actual ID can only be an integer. What you see in the WAL archive name is a hex value. So for instance 0000003400000000000000CD
would be timeline_id 52
. Nevertheless, one can also specify latest
or current
in the recovery.conf. Which is default if nothing is set.
So I think, you could use and int32
here.
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.
Oh yeahh its a hex value in the end. I will change to int32.
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.
@FxKu @thedatabaseme btw, on changing type to integer back from string it fails when no timeline id is passed as it can no longer receive "latest"/"current".
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.
Ok, so have removed the possibility for string value "latest" and in such a scenario it will calcuate the latest timeline id as integer. You may ignore my previous comment.
The parameter name has been changed to "wal_timeline_id" from "clone_target_timeline". And I am working on the docs. |
move to next milestone, because Spilo PR is still open |
Add timelineid in clone section in the cluster CRD.
In the cluster config we need timeline_id along with the existing possibility of timestamp and cluster name such as for eg: