-
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
feat/SYNC-4244_stale #1546
feat/SYNC-4244_stale #1546
Changes from 8 commits
644b9b4
8233783
65b7805
4e1b563
4dd1aa0
36d20d4
2d12a7f
0b522e3
21e5a3d
d09eda0
433d735
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -389,14 +389,22 @@ impl TokenserverDb { | |||||||||||||||
let raw_user = raw_users[0].clone(); | ||||||||||||||||
|
||||||||||||||||
// Collect any old client states that differ from the current client state | ||||||||||||||||
let old_client_states = { | ||||||||||||||||
let old_client_states: Vec<String> = { | ||||||||||||||||
raw_users[1..] | ||||||||||||||||
.iter() | ||||||||||||||||
.map(|user| user.client_state.clone()) | ||||||||||||||||
.filter(|client_state| client_state != &raw_user.client_state) | ||||||||||||||||
.collect() | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
if !old_client_states.is_empty() { | ||||||||||||||||
info!( | ||||||||||||||||
"Tokenserver user has old client states"; | ||||||||||||||||
"uid" => raw_user.uid, | ||||||||||||||||
"count" => old_client_states.len() | ||||||||||||||||
) | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a pretty normal situation, is even more common with the current state of the purge script so I don't see it being that useful?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of the things that was discussed prior was that we didn't have a clear idea how many users were being impacted by the a user client state change. Once the purge script runs, I would suspect that there would be less clients with that potential state. While normal, we don't really know how common it is. I'm fine specifying this as a metric instead, if that might be useful. If this is a very common occurrence or we have other ways to address the concern about users with excessive old client states, then I'm fine dropping this as well. I'd also be fine setting a reporting threshold of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding was we wanted to know how many users were affected by https://bugzilla.mozilla.org/show_bug.cgi?id=1892904 triggered by
Once the purge script catches up the only |
||||||||||||||||
// Make sure every old row is marked as replaced. They might not be, due to races in row | ||||||||||||||||
// creation. | ||||||||||||||||
for old_user in &raw_users[1..] { | ||||||||||||||||
|
@@ -463,7 +471,11 @@ impl TokenserverDb { | |||||||||||||||
// The most up-to-date user doesn't have a node and is retired. This is an internal | ||||||||||||||||
// service error for compatibility reasons (the legacy Tokenserver returned an | ||||||||||||||||
// internal service error in this situation). | ||||||||||||||||
(_, None) => Err(DbError::internal("Tokenserver user retired".to_owned())), | ||||||||||||||||
(_, None) => { | ||||||||||||||||
let uid = raw_user.uid; | ||||||||||||||||
warn!("Tokenserver user retired"; "uid" => &uid); | ||||||||||||||||
Err(DbError::internal("Tokenserver user retired".to_owned())) | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth having a different metric (or preferably tag, but we don't have
ReportableError::tags
in this codebase yet which let's you do that) for the specific "Unacceptable client-state value stale value" issue in question.Though I suppose we can alternatively look at the warn log messages for a count of those 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's hold off on adding a tag for that. I see that there's already a ticket for that work.
In any case, I'll add a different ticket to do that and we can add the tag once that lands.