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

We should skip the 'isjson' check in couch-kvstore.cc if we already know the datatype information.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • 3.0
    • 3.0
    • couchbase-bucket
    • Security Level: Public
    • None
    • Untriaged

    Description

      in couch-kvstore/couch-kvstore.cc we perform the following check in line 250 on every incoming value to see if it is valid JSON or not. Since, in 3.0 we also receive the datatype from 3.0 clients we can skip this check is we already know from the datatype field that it is not JSON. So, from the datatype field that is set in line 253 if the value indicates BINARY_COMPRESSED or JSON_COMPRESSED we can skip the check. However, couple of things to note:

      1)If the datatype is 0, we should still run the check since the doc might be coming from a 2.x client that is not flex metadata aware.
      2)We should answer the question of whether we should validate JSONness for JSON_COMPRESSED by uncompressing and checking.

      couch-kvstore/couch-kvstore.cc snippet:

      249 if (vlen) {
      250 isjson = isJSON(value);
      251 dbDoc.data.buf = const_cast<char *>(value->getData());
      252 dbDoc.data.size = vlen;
      253 datatype = it.getDataType();

      Attachments

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

        Activity

          People

            abhinav Abhi Dangeti
            venu Venu Uppalapati (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty