-
Notifications
You must be signed in to change notification settings - Fork 9
Structure, refactor and clean up trace messages #751
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
Conversation
ff9b0df
to
0abae6b
Compare
We give the trace message datatypes more structure (see the `$traces` Haddock section), and we add few new messages. In the process, we apply some minor refactorings to tracer calls and surrounding code.
The idea is to cover as much of the public API as possible to trace most (if not all) unique trace messages at least once. The trace output is useful in two ways: * By using golden tests based on the trace output we can help to ensure that trace datatypes and their printing do not change unexpectedly. * The trace output serves as an example that can be manually inspected to see whether the trace messages are printed correctly and whether they are useful.
This helps troubleshoot golden test failures that can't be reproduced locally. For example, if a golden test fails on a Windows machine, then I can not reproduce it locally on an Ubuntu machine.
0abae6b
to
22d4997
Compare
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.
Looks good, including the CI action to upload golden test outputs.
There's just one bit I don't get, see below.
, sessionTracer :: !(Tracer m LSMTreeTrace) | ||
sessionState :: !(RWVar m (SessionState m h)) | ||
, lsmTreeTracer :: !(Tracer m LSMTreeTrace) | ||
, sessionTracer :: !(Tracer m SessionTrace) |
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.
Why do we add the sessionTracer
here, separate from the LSMTreeTrace
one? Below we don't seem to use it, we pass in a tr
and locally construct a sessionTracer
, like
where
sessionTracer = TraceSession (SessionId dir) `contramap` tr
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.
We use lsmTreeTracer
in duplicate
, for example. We can't trace a TableTrace
given a Tracer m SessionTrace
, we need the Tracer m LSMTreeTrace
See the commit messages
I'm unsure whether 0abae6b is useful, so let me know if we should include it or not.