Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2114

Make OP_MSG protocol class (Msg) comply with its interface

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.12.0.rc0
    • Affects Version/s: None
    • Component/s: Wire Protocol
    • Labels:
      None

      The Msg class is currently used to both send and receive OP_MSG payloads. However the data it stores is different depending on the side of the i/o - the sending side stores sections as specified in the OP_MSG specification, the receiving side stores a list of documents in the sections which violates not only the specification but also the API.

      This further leads to confusion with respect to the #documents method which aliases #sections - it only behaves correctly on the receiving side, where #sections does not actually have proper sections.

      The above discrepancy seems to have been made in order to support serialization and deserialization in the same class, but as far as I can tell deserialization of type 1 payloads won't work correctly since the rest of the driver assumes the payload is entirely contained in the first section.

      This ticket is to adjust implementation of Msg so that both sending and receiving Msg instances comply with the stated interface.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: