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

make peruser resumable #872

Open
janl opened this issue Oct 7, 2017 · 0 comments
Open

make peruser resumable #872

janl opened this issue Oct 7, 2017 · 0 comments

Comments

@janl
Copy link
Member

janl commented Oct 7, 2017

(via #756 (comment))

couch_peruser doesn’t handle the case of the node it being run on failing and restarting. This is less an issue, if Problem No. 1 isn’t solved yet, as in a typical cluster there are at least two more instances of this module running that could create the database.

But say we fix Problem No. 1 (as outlined in #756 (comment)) so that each user creation will only ever result in a single attempt to create the associated database. Then Now, what should happen if in between picking up the notification to create the database and doing the DB creation, the current node becomes unavailable?

The module currently opens _changes on startup and asserts all user/db creations corresponding to the _users db. That is, if there are 100k users, on startup, the module will try to create 100k databases, even if they already exist.

A solution to this would be to add per-node high-watermark _local/ docs, so we can more efficiently resume.

@janl janl changed the title make peruser reasonable make peruser resumable Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant