Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-241

Paginator object doesn't move onto next "page" correctly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: 1.1.6
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None
    • Sprint:
      Sprint 1 - CW 19 & 20

      Description

      Customer found his own issue:
      I had a look at the source code for the java driver and found the error there. It is in:

      com.couchbase.client.protocol.views.Paginator.getNextPage()

      Right after calculating the number of "remaining" keys, it sets the limit of the query to the remaining number of keys and re-runs the query. What is missing here is:

      q.setSkip(totalDocs);

      To actually start from the entry after the last entry on the current page. I have tried this and it works. But there is more code in this method and it is not very easy to follow so important to make sure that this fits.

      I am enclosing a diff.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        perry Perry Krug created issue -
        perry Perry Krug made changes -
        Field Original Value New Value
        Description Customer found his own issue:
        I had a look at the source code for the java driver and found the error there. It is in:

        com.couchbase.client.protocol.views.Paginator.getNextPage()

        Right after calculating the number of "remaining" keys, it sets the limit of the query to the remaining number of keys and re-runs the query. What is missing here is:

            q.setSkip(totalDocs);

        To actually start from the entry after the last entry on the current page. I have tried this and it works. But there is more code in this method and it is not very easy to follow so important to make sure that this fits.

        Got response containing: 50
        Done iterating through page, #missing keys: 51
        Got response containing: 50
        Done iterating through page, #missing keys: 1
        Got response containing: 1
        Done iterating through page, #missing keys: 0

        I am enclosing a diff.
        Customer found his own issue:
        I had a look at the source code for the java driver and found the error there. It is in:

        com.couchbase.client.protocol.views.Paginator.getNextPage()

        Right after calculating the number of "remaining" keys, it sets the limit of the query to the remaining number of keys and re-runs the query. What is missing here is:

            q.setSkip(totalDocs);

        To actually start from the entry after the last entry on the current page. I have tried this and it works. But there is more code in this method and it is not very easy to follow so important to make sure that this fits.


        I am enclosing a diff.
        perry Perry Krug made changes -
        Link This issue depends on CBSE-394 [ CBSE-394 ]
        daschl Michael Nitschinger made changes -
        Fix Version/s 1.1.3 [ 10496 ]
        Priority Major [ 3 ] Blocker [ 1 ]
        daschl Michael Nitschinger made changes -
        Planned Start (set to new fixed version's start date)
        Planned End (set to new fixed version's start date)
        ingenthr Matt Ingenthron made changes -
        Assignee Michael Nitschinger [ daschl ] Matt Ingenthron [ ingenthr ]
        ingenthr Matt Ingenthron made changes -
        Planned End (re-schedule end date based on new assignee)
        ingenthr Matt Ingenthron made changes -
        Assignee Matt Ingenthron [ ingenthr ] Michael Nitschinger [ daschl ]
        ingenthr Matt Ingenthron made changes -
        Planned End (re-schedule end date based on new assignee)
        daschl Michael Nitschinger made changes -
        Fix Version/s 1.1.4 [ 10514 ]
        Fix Version/s 1.1.3 [ 10496 ]
        daschl Michael Nitschinger made changes -
        Planned Start (set to new fixed version's start date)
        Planned End (set to new fixed version's start date)
        daschl Michael Nitschinger made changes -
        Fix Version/s 1.1.5 [ 10515 ]
        Fix Version/s 1.1.4 [ 10514 ]
        daschl Michael Nitschinger made changes -
        Planned Start (set to new fixed version's start date)
        Planned End (set to new fixed version's start date)
        daschl Michael Nitschinger made changes -
        Fix Version/s 1.1.6 [ 10531 ]
        Fix Version/s 1.1.5 [ 10515 ]
        daschl Michael Nitschinger made changes -
        Rank Ranked higher
        daschl Michael Nitschinger made changes -
        Rank Ranked higher
        daschl Michael Nitschinger made changes -
        Sprint Sprint 1 - CW 19 & 20 [ 13 ]
        daschl Michael Nitschinger made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        daschl Michael Nitschinger made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        ingenthr Matt Ingenthron made changes -
        Workflow jira [ 24446 ] Couchbase SDK Workflow [ 38521 ]

          People

          • Assignee:
            daschl Michael Nitschinger
            Reporter:
            perry Perry Krug
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile

                Gerrit Reviews

                There are no open Gerrit changes