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

Make OP_MSG protocol class (Msg) comply with its interface

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            oleg.pudeyev Oleg Pudeyev
            Reporter:
            oleg.pudeyev Oleg Pudeyev
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: