[SERVER-76420] SBE: improve stage debugPrint() output Created: 21/Apr/23 Updated: 09/May/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kevin Cherkauer | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Participants: |
| Description |
|
Current SBE debugPrint() output, which is also shown by explain(), is not interpretable without the source code. Example sbe::ScanStage::debugPrint() output: [0] scan s1 none none none none none [] @"<collUUID>" true false
In #1 the reader needs the source code to discover that after the "scan" keyword the next bunch of fields are telling either the SlotId of a slot that exists for some specific value, or "none" meaning the slot in that position does not exist. The position of a given slot is not consistent though as the first slot that might be printed, for the seek record ID, does not get "none" printed if it does not exist, so the positions of a later slot might be either N or N+1. E.g. the record slot might be either position 1 or 2, the recordId slot might be position 2 or 3, etc., and without the source code the reader does not have any information about which slot is in any position. In #2 the reader needs to know that the "true" means this is a forward scan and the "false" means the oplogTs slot does not exist. This ticket is to improve the debug output of all SBE stages that use this paradigm for identifying slots. A more readable output could be something like the following, reporting the same information as in the above example but in more easily understood form:
The approach here is based on the ideas of:
The only stage debugPrint() methods that currently print "none" (DebugPrinter::kNoneKeyword) are:
so these are the primary debug printers needing to be addressed. The other debug printers need to be checked for outputting unlabeled true/false values. There is already an implementation of these changes for ScanStage::debugPrint() in commit #40 of PR 10981 for https://github.com/10gen/mongo/pull/10981/commits/832fbc767fa9c81fd1c9004636b3f59090bf8438 However it was removed from this PR in commit #47 due to a desire to keep output consistent across stages, whereas the original PR is for a ticket that is only updating ScanStage. This will be a very quick project with big payoffs in developer productivity and could be triaged as a New Engineer ticket. Also, customers can see this "debug" output via explain() and without the source code, there is no way for them to understand the current output. This ticket will help improve the customer experience and potentially reduce Support tickets. FYI kyle.suarez@mongodb.com martin.neupauer@mongodb.com david.storch@mongodb.com amr.elhelw@mongodb.com |