-
Notifications
You must be signed in to change notification settings - Fork 50
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
Adopt the new user_id scheme for the Spanner backend #170
Comments
Additionally the db_tests should somehow setup non-legacy HawkIdentifiers when testing the spanner backend |
Is this value ever exposed? (Wondering if we could use an augmented time value or something since we may not have a central location to draw from.) |
Assuming you mean the legacy_id: various client implementations assume an integer user_id. We need to continue providing one for them and they'd continue using it for e.g. constructing the {uid} parameter in our sync storage urls. But underneath the Spanner impl. would use the new uuid-style id from the Hawk header for its user_id. (We currently have a centralized location to draw the legacy ids from -- the tokenserver -- but we want the tokenserver to eventually go away) |
So, there's one thing to be careful of which I'm not sure is clear from the discussion in mozilla-services/tokenserver#124, so I'm going to re-iterate it here just in case. The tokenserver currently changes the numeric uid for a user whenever their FxA encryption key changes. Because the current storage nodes index their storage by this numeric userid, the effect is that the user's storage gets "wiped" automagically when their encryption key changes - they start writing into a different bucket on the storage node that doesn't have any of the old data in it encrypted under the old key. There is also a background job on the tokenserver which periodically asks the storage nodes to delete data stored under numberic userids that have become obsolete. If we switch to indexing data storage by the (stable and immutable) fxa_uid instead, we'll need to make sure that we have some other way to:
I don't recall if we settled on a precise scheme for how to achieve those two things in a durable-storage world. The tokenserver sends an |
We've simply combined the 2 values to act as storage's userid: We should consider including fxa_kid as a separate column (but part of the primary key) instead, the Python version's concatenating of the values into userid was mostly for the sake of expediency |
Great, thanks you!
👍; since the |
FWIW I left a couple of notes in mozilla-services/tokenserver#124 about how the |
* May want to use alternate "sync_kid" db. DSN: spanner://projects/sync-spanner-dev-225401/instances/spanner-test/databases/sync_kid * switched over index to use "fxa_id" (kid), and pass HawkParameter when possible Issue #170
Mysql uses the "legacy" user_id (an autoincremented id from the token server). Spanner requires a non serial user_id primary key: (discussion).
Our HawkPayload hasn't stubbed these values out yet (fxa_uid/fxa_kid and we'll likely utilize hash_fxa_uid for metrics). They need to be added and the tests should be adjusted to include such values (if they don't already).
Finally Spanner should switch from legacy_id over to the new values.
The text was updated successfully, but these errors were encountered: