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

what mean about PG WANTEDGENERATION and PG CURRENTGENERATION #881

Open
jackin853 opened this issue Jul 5, 2022 · 2 comments
Open

what mean about PG WANTEDGENERATION and PG CURRENTGENERATION #881

jackin853 opened this issue Jul 5, 2022 · 2 comments

Comments

@jackin853
Copy link

I just learned the stolon framework, and I encountered some concepts that I don't understand very well, and I didn't find any relevant explanations in the relevant documents.
When I use the stolonctl status command to get the cluster status, I see the following two columns in the status of the keepers. I don't know what it means. The two values are sometimes the same, sometimes different. What does the same value mean? What's the difference?
PG WANTEDGENERATION PG CURRENTGENERATION

@viggy28
Copy link

viggy28 commented Aug 23, 2022

I agree, that it would be nice to improve the documentation around these internal concepts.

Let me explain what I understand.

When the db spec changes, sentinel increases the db.Generation by 1.

db.Generation++

If the keeper is healthy, then it would likely update the spec change and finally keeper sets local status with db.generation.

if err := p.saveDBLocalState(ndbls); err != nil {

Keeper reports the updated local state generation and sentinel updates db.status.currentGeneration with db.generation

db.Status.CurrentGeneration = dbs.Generation

Overall, why we doing all these is a way to identify that whether the databases (keepers) are converged or not. @sgotti feel free to correct me wherever I am wrong :)

@jackin853
Copy link
Author

@viggy28 Thanks,I got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants