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

Hash collision in mapreduce NIF

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.0.0
    • 4.1.0, 4.5.0
    • view-engine
    • None
    • Untriaged
    • No

    Description

      As per Aliaksey Artamonau comments on CBSE-2489

      Potential lock-up

      The core of the problem is here: http://src.couchbase.org/source/xref/4.1.0/couchdb/src/mapreduce/mapreduce.erl#53. This Ref value is then used in mapreduce_nif to index the contexts: http://src.couchbase.org/source/xref/4.1.0/couchdb/src/mapreduce/mapreduce_nif.cc#529. The problem is that phash2 is in no way collision-resistant. For example, here are two references that hash to the same value:

      Hash: 107046579
      Colliding refs: #Ref<0.0.0.23609> #Ref<0.0.0.19771>
      

      What this means is that there's a chance that some context will get lost and will not abide by the javascript execution timeout.

      Attachments

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

        Activity

          People

            harsha Harsha Havanur
            harsha Harsha Havanur
            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