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

fix: remember keys_changed_at when reallocating after node replacement. #173

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

rfk
Copy link
Contributor

@rfk rfk commented Feb 10, 2020

If a user's current storage node is decomissioned, they may end up
without an active users record in the db, and there is code to
handle this case by lazily recreating an active record on demand.

Previously, this code would only copy generation and client_state
fields, essentially forgotten any previously-seen value for the new
keys_changed_at field. This commit fixes things so that value is
also remembered.

I do not expect this bug to have caused any issues in practice, since
we already have a bunch of code to handle users for which we have
not yet seen a value of keys_changed_at. But we should remember it
when we can because it helps the server enforce that clients are
behaving correctly.

@rfk rfk requested a review from jrconlin February 10, 2020 06:47
@rfk
Copy link
Contributor Author

rfk commented Feb 10, 2020

Thanks @jrconlin! Weirdly, I don't seem to be able to merge this due to commit-signing, but AFAICT my commit is in fact signed. Not sure what's going on there...

@jrconlin
Copy link
Member

Yeah, I was wondering about that too, and yes, it appears verified to me as well. Looks like it's a problem for other PRs, too, so I have no idea aside from "weird github issue". Sadly, I don't have admin on this package so I can't force it.

@jrconlin
Copy link
Member

Submitted a help request with github to see what might be wrong here.

If a user's current storage node is decomissioned, they may end up
without an active `users` record in the db, and there is code to
handle this case by lazily recreating an active record on demand.

Previously, this code would only copy `generation` and `client_state`
fields, essentially forgotten any previously-seen value for the new
`keys_changed_at` field. This commit fixes things so that value is
also remembered.

I do not expect this bug to have caused any issues in practice, since
we already have a bunch of code to handle users for which we have
not yet seen a value of `keys_changed_at`. But we should remember it
when we can because it helps the server enforce that clients are
behaving correctly.
@rfk rfk force-pushed the remember-keyschangedat-after-node-replacement branch from a8f29aa to ee6c065 Compare February 11, 2020 03:46
@rfk
Copy link
Contributor Author

rfk commented Feb 11, 2020

I did a git commit --amend and force-pushed, let's see if that makes a difference...

@rfk
Copy link
Contributor Author

rfk commented Feb 11, 2020

Hooray, that seemed to work \o/

@rfk rfk merged commit 3256572 into master Feb 11, 2020
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