-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
logging: log time taken for tablet initialization only once #14597
Conversation
Signed-off-by: deepthi <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
@rohit-nayak-ps WDYT?
|
So we don't want it to log for every transition, because the next few times are not actually "Init"s? Are these extra logs confusing and/or redundant information?
I think this location is fine. One thing that this location doesn't capture is the time taken for |
Yes. While debugging an issue in PlanetScale, this log made it seem like Initialization had been hanging for a long time, when in fact it was triggered by a change in primary.
This is the part that I was also not able to fully understand. In the
I would have expected this to print the total amount of time taken until |
This is because we run the example with |
I tried to move the logging to
So what we have right now is the best we can do. When we eventually call |
Signed-off-by: deepthi <[email protected]>
Description
Time taken for tablet init should be logged exactly once, and not every time the tablet goes through a state transition.
The way I have chosen to make this happen is by using
sync.Once
. However it is open to debate whether the log line should actually be moved to some other location in the code to ensure that it is called exactly once.With this change, even after running a PRS, no new log line appears of the form
Tablet Init took 17899ms
.Related Issue(s)
Fixes #14596
Checklist
Deployment Notes