Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2765

new driver session support breaks application that is not designed with session

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • None
    • 1.11.0
    • libmongoc
    • None

    Description

      Application using older c driver, e.g. 1.6, which does not support session is allowed to have following flow:

      1. using older version c driver api, get a client through client pool
      2. construct a find bson command
      3. issue the command using collectionCommandWithOpts
      4. bson containing cursor id information is returned
      5. construct a getMore bson command using the cursor id
      6. issue the command using collectionCommandWithOpts
      7. all batches are successfully returned

      However, using c driver with newer version, the above flow is broken. Server will sometimes returns error in step (6) - "Cannot run getMore on cursor ..., which was created in session ..."

      The followings are some points about the causes:

      • implicit session is implemented for cursor, however, its only implemented for mongoc_cursor_t returned api
      • session pool implemented in c driver will have chance to cause the getMore command in (6) to acquire a new session or reused another pooled session, which is not same as the session used by find command in (3)

      From the specification defined, with backward compatibility consideration, existing application is not required to make changes to run properly.

      Should we treat this issue as bug or should we change our application to adapt the driver session change?

      Attachments

        Activity

          People

            Unassigned Unassigned
            ben.prect Ben Cheong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: