Question about requestID field in OP_MSG wire protocol


In the mongo wire protocol I see there is a field requestID which is the identifier for the packet. How is this requestID 32 bit value generated? Will this value be re-used in a later (but unrelated) packet?

Thank you!

Hey @Kartik_Pattaswamy1 ,

Though it’s typically just an auto-incremented integer there aren’t really any requirements as to its generation. Since currently only a single operation can occur per connection the requestID generated by the client will just be reflected in the responseTo from the server.

A requestID wouldn’t be reused for any purpose other than a client being restarted and the value generation being reset.