Please update tokenserver config in production
Categories
(Cloud Services :: Operations: Miscellaneous, task, P1)
Tracking
(Not tracked)
People
(Reporter: rachel, Unassigned)
Details
Related to the change to allow tracking for node_type in Sync which went live with tokenserver 1.5.3, it looks like we also need to adjust the prod tokenserver config so the changes will work as intended:
We'll need the following added to the tokenserver prod config:
[tokenserver]
node_type_patterns =
mysql: '^.+-\d\.sync\.services\.mozilla\.com$'
spanner: '^.+-g\.sync\.services\.mozilla\.com$'
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Comment 1•5 years ago
|
||
Related issue tracking client side changes is here: 1582317
| Reporter | ||
Comment 2•5 years ago
|
||
:jrgm: - Do you think it'd be do-able to get this one applied in the next day or two? We're hoping to have this live ahead of the durable sync rollout (monday) so we can track sync usage more accurately.
Comment 3•5 years ago
|
||
So the commit for the node_type change is not in 1.5.3 (and yes, it's an overlapping set of branches in play at that time which makes the history hard to read). But it's in 1.5.4, which is on stage now. The above config could be added for that with 1.5.4 if testing of that build looks fine (i.e., beyond running the loadtest, if any is required).
Comment 4•5 years ago
|
||
mysql: '^.+-\d.sync.services.mozilla.com$'
Should that be \d+?
| Reporter | ||
Comment 5•5 years ago
|
||
(In reply to John Morrison [:jrgm] from comment #3)
So the commit for the node_type change is not in 1.5.3 (and yes, it's an overlapping set of branches in play at that time which makes the history hard to read). But it's in 1.5.4, which is on stage now. The above config could be added for that with 1.5.4 if testing of that build looks fine (i.e., beyond running the loadtest, if any is required).
Oooh, good catch. The dates for the merges got me. We're good with rolling this into 1.5.4; thank you!
| Reporter | ||
Comment 6•5 years ago
|
||
(In reply to John Morrison [:jrgm] from comment #4)
mysql: '^.+-\d.sync.services.mozilla.com$'
Should that be
\d+?
Nope, they're good as-is. We're matching against: sync-<id-number>-<gcp-region>-g.sync.services.mozilla.com (spanner) and sync-<id-number>-<aws-region>.sync.service.mozilla.com (mysql)
Comment 7•5 years ago
|
||
Ah, so valid paths might look like
mysql: sync-123-us-east-1.sync.service.mozilla.com
spanner: sync-123-us-west1-a-g.sync.services.mozilla.com
? (based off of Google and AWS docs)
AWS currently doesn't have more than three zones per region so single digit would work. Honestly, this could probably work with a simpler regex check like if re.match("\d-g\.sync", uri) since AWS will probably never adopt "1-g.sync1" as a valid AWS region.
| Reporter | ||
Comment 8•5 years ago
|
||
(In reply to JR Conlin [:jrconlin,:jconlin] from comment #7)
Ah, so valid paths might look like
mysql: sync-123-us-east-1.sync.service.mozilla.com spanner: sync-123-us-west1-a-g.sync.services.mozilla.com? (based off of Google and AWS docs)
AWS currently doesn't have more than three zones per region so single digit would work. Honestly, this could probably work with a simpler regex check like
if re.match("\d-g\.sync", uri)since AWS will probably never adopt "1-g.sync1" as a valid AWS region.
A simpler regex check right now would involve code changes which I'd like to try and avoid if possible given our timeline.
:eolson:, can you confirm the requested config will match against our current sync hosts?
Comment 9•5 years ago
|
||
The hostnames are chosen by us. We do not specify zones in the AWS based hostnames and I don't think we would do that in the GCP based hostnames either
Comment 10•5 years ago
•
|
||
So, looking at the patch from rfk, these are fnmatch style patterns, not regexes. (They get compiled into regexes[1], but the pattern can only be a simple match[2] like mysql:*sync*.services.mozilla.com. So what's an appropriate glob pattern to distinguish between the two?
[1] https://github.com/mozilla-services/tokenserver/pull/149/files#diff-9f91fcbd4f5f6bb2523792172be8014aR162
[2] https://github.com/mozilla-services/tokenserver/pull/149/files#diff-1dabea4ca2355fba94549b6c80fc560eR63-R64
Comment 11•5 years ago
|
||
Or did I read that wrong?
Comment 12•5 years ago
|
||
This may need to rely on precendence - https://github.com/mozilla-services/tokenserver/pull/149/files#diff-1dabea4ca2355fba94549b6c80fc560eR74-R82
i.e., 'spanner:-g.sync.services.mozilla.com' if hostname ends in -g, else 'mysql:.sync.services.mozilla.com'
Comment 13•5 years ago
|
||
Bugzilla helpfully removed my * globs from the above. So, take two:
i.e., 'spanner:*-g.sync.services.mozilla.com' if hostname ends in -g, else 'mysql:*.sync.services.mozilla.com'
| Reporter | ||
Comment 14•5 years ago
|
||
Yup, thanks :jrgm: - And after trying to compile locally (commenting out the tokenserver include in syncserver and replacing with a locally zipped tokenserver), we may not want the quotes either. So, something like this:
[tokenserver]
node_type_patterns =
spanner:*g.sync.services.mozilla.com
mysql:*
I think it might make sense to just keep the default case simple in order to make sure we catch everything else just in case. What do you think?
| Reporter | ||
Comment 15•5 years ago
|
||
:pjenvey: - can you confirm config values here?
Comment 16•5 years ago
|
||
This is live in production as of 20:30Z with 1.5.4 release and final node_type_patterns config:
(prod) - https://github.com/mozilla-services/cloudops-deployment/blob/c6e07327fa9324ec214bdf6656d1b3f97e230f9d/projects/tokenserver/puppet/yaml/app/tokenserver.prod.yaml#L5-L7
(stage) - https://github.com/mozilla-services/cloudops-deployment/blob/c6e07327fa9324ec214bdf6656d1b3f97e230f9d/projects/tokenserver/puppet/yaml/app/tokenserver.prod.yaml#L5-L7
Comment 18•5 years ago
|
||
Damn - this isn't being reported by the client :( I neglected to add node_type to https://searchfox.org/mozilla-central/source/services/common/tokenserverclient.js#360
Comment 19•5 years ago
|
||
(actually, in lines 372-378)
Description
•