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

Strongly Consistent Name Registration #163

Open
zicklag opened this issue Sep 6, 2024 · 2 comments
Open

Strongly Consistent Name Registration #163

zicklag opened this issue Sep 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@zicklag
Copy link
Collaborator

zicklag commented Sep 6, 2024

Right now, the way that we reserve usernames is built on Leaf's eventually consistent store.

This means that it's possible for one user to claim a username, think that it worked, and then, with very close timing, another user could claim the same name, and take it from the first user.

This window of time where it could be taken is probably in the milliseconds with a non-clustered Weird server, but with a clustered server, it could be prolonged if there was a network partition between the clustered servers.

The user would only find out that the username was taken by another user after the servers reconnected to each-other.

This is not that big a deal right now, but in the future, we should build some sort of strongly consistent layer on top of Leaf, possibly using multi-paxos or raft, to make sure that name registration is strongly consistent.

@zicklag zicklag added the enhancement New feature or request label Sep 6, 2024
@erlend-sh
Copy link
Contributor

erlend-sh commented Sep 6, 2024

This is not that big a deal right now, but in the future, we should build some sort of strongly consistent layer on top of Leaf, possibly using multi-paxos or raft, to make sure that name registration is strongly consistent.

Might there be a far more lo-fi solution for this in UI-space?

Storefronts for cinemas and travel companies have ~10min windows for reserving your seat.

Somewhat similarly, upon hitting save on the username, couldn’t we do a little load-animation for the 1-2 seconds we’d need to assure them the username is theirs?

I.e. we wouldn’t let new users finish the signup dialog before the username-availability has been confirmed.

@zicklag
Copy link
Collaborator Author

zicklag commented Sep 6, 2024

That's pretty much what Raft / Multi-Paxos is. The servers just vote on the new name to make sure that they all agree who gets it, and I think it could probably reserve a name in less than a second.

I think we can probably get an ultra simple version of it without much work, since all we're worried about is claiming a single username, instead of like a full database or something like that.

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

No branches or pull requests

2 participants