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

Eventing writes to wrong keyspace if collection name is long

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.2.0
    • 7.0.0, 7.1.0, 7.2.0
    • eventing
    • Security Level: Public
    • Untriaged
    • 0
    • Unknown

    Description

      For Eventing we seem to only support a max of 30 characters for the collection component of the keyspace.

      If I create a bucket "a" scope "myscope" collection "collection-a123456789b123456789c123456789d123456789e123456789" the collection name is 62 character long (I should be able to make it 251 characters long as per https://docs.couchbase.com/server/current/learn/data/scopes-and-collections.html) 

      Now if I make an eventing function as follows:

      function OnUpdate(doc, meta) {
          log("Doc created/updated", meta.id, "writing 'new_doc'");
          src_col["new_doc"] = { "a": 1 };
      }

      With a bucket alias src_col set to the keyspace a.myscope.collection-a123456789b123456789c123456789d123456789e123456789 in r+w mode

      I then deploy the function and create one document in the keyspace KEY "trigger" with data 

      {"a": 1}

      The function erroneously writes the data to the wrong collection! 

      • a._default._default

      WORKS (longest collection name seems to be 30 characters).

      collection-a123456789b12345678

      FAILS

      collection-a123456789b123456789

      Attachments

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

        Activity

          People

            sujay.gad Sujay Gad
            santosh.hegde Santosh Hegde
            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