Add support to ignore MongoDB handshaking frames #1776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: When end to end testing MongoDB tracing, the parser encountered
OP_MSG
handshaking frames and was not able to parse them. This was due to the old parser searching for a CRUD command in theOP_MSG
frame's top level key in the payload andOP_MSG
handshaking frames not containing a key the old parser could interpret.This PR adds support to parse top level handshaking keys and discards those frames at stitching time. It also correctly prefixes
const
variables in thetypes.h
file.The motivation to parse these frames instead of immediately ignoring them at parsing time is to account for the different possibilities of responses for a handshaking request. A handshaking request could lead to a
more_to_come
response where each frame in themore_to_come
response may not be identifiable as a handshaking frame. It's also possible that the response of a handshaking request may contain anok
key which can be misidentified as a non handshaking response and left stale in the map of response deques. Identifying all of the handshaking request/response frames at stitching time but not inserting it to the records would ensure that all handshaking frames are cleared from the map and not pushed to the data table.Related issues: #640
Type of change: /kind bug
Test Plan: Added a stitcher test