Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-15275

CLONE - Mixing of data in views

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.0
    • 2.2.0
    • view-engine
    • Security Level: Public
    • None
    • Untriaged
    • Unknown

    Description

      We were applying wrong rereduce function in views when we collect and merge the query result and apply the rereduce.In that rereduce function, we create a reduce context and store in erlang process table, but we were not deleting that context processing the query. So if the next query comes and mochiweb uses the same erlang process, the next query will find the context and use it. If both are queries are from different views, the reduce context applied to second query is wrong and the result will be wrong.To reproduce this issue, create following 2 view functions in different design doc:

      view1:

      map:

      function (doc, meta) {
        emit(["A", "B"], ["couch", "base"]);
      }
      

      reduce:

      function(keys, values, rereduce) {
        return ["couch", "base"];
      }
      

      view2:

      map:

       
      function (doc, meta) {
        emit(["A1", "B1"], ["couch1", "base1"]);
      }
      

      reduce:

      function(keys, values, rereduce) {
        return ["couch1", "base1"];
      }
      

      Now when we query view1 and view2 with group=true, we can see that in view2 result there is value from view1.

      Attachments

        Issue Links

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

          Activity

            People

              vmx Volker Mische
              nimish Nimish Gupta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty