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

Generate safekeeper unique IDs. #1081

Closed
wants to merge 2 commits into from
Closed

Generate safekeeper unique IDs. #1081

wants to merge 2 commits into from

Conversation

arssher
Copy link
Contributor

@arssher arssher commented Jan 3, 2022

Immediate goal is to distinguish neighbours in peer-to-peer communication, but
this is generally useful.

@arssher
Copy link
Contributor Author

arssher commented Jan 10, 2022

@lubennikovaav Please review the second patch.

Immediate goal is to distinguish neighbours in peer-to-peer communication, but
this is generally useful.
Timeline is active whenever there is at least 1 connection from compute or
pageserver is not caught up. Currently 'active' means callmemaybes are being
sent; later it would also manage gossip.

Fixes race: now suspend condition checking and callmemaybe unsubscribe happen
under the same lock.
@LizardWizzard
Copy link
Contributor

Some time ago we discussed introducing ids to pageservers too. Maybe worth it to share some code (at least keep that in mind).

Also I think it is ok to use ids created in console, i e when new safekeeper is added to control plane it is being assigned an id and for ease of debugging we can use this id. Thoughts?

I think it is preferable to keep this id in config for simplicity and to avoid unsafe.

@arssher
Copy link
Contributor Author

arssher commented Jan 11, 2022

Sure, code can be reused for pageserver, perhaps with edits.

Yes, assigning from console sounds handy, but I'd still keep the code for generating it internally for tests and development.

Well, keeping it in config means config must be passed everywhere, I wouldn't call it simpler. But would work too.

@LizardWizzard
Copy link
Contributor

keep the code for generating it internally for tests and development

Agree, something like generating the id if it is missing.

means config must be passed everywhere

I think there wouldn't be too many places. Just like with no-sync option. Also I think this is cleaner because this way we keep everything config like in config.

Another way to avoid unsafe is to use lazy_static or once_cell (or Box::leak as it is done for config in pageserver)

@arssher
Copy link
Contributor Author

arssher commented Feb 6, 2022

Superseded by #1228

@arssher arssher closed this Feb 6, 2022
@bayandin bayandin deleted the sk_peers branch May 19, 2023 13:06
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

Successfully merging this pull request may close these issues.

2 participants