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

server should check for index name length too long

    XMLWordPrintable

Details

    • 0

    Description

      When a Search index name is too long the index silently fails to ingest documents.  The UI or the underlying creation logic should reject names (including bucket and scope and other elements that are too long).

      The longest name I can create in an index definition is:
       "name": "myvector_bucket._default.GB0123456789b0123456789b0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789b0123456789a01234567",
      This "seems" to be 223 characters with the bucket and scope. After this point the index fails to build.

      I posit this is related to the Linux maximum length for a file name in Linux WIndows 10, and MacOS is 255 bytes - I looked briefly at the code but didn’t find the limiting factor. But looking at the files created in the file system I see the max size files like
       myvector_bucket._default.GB0123456789b0123456789b0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789a0123456789b0123456789a01234567_3e934756dc24570b_4c1c5584.pindex
      If I add one more character the index fails as the system can not create the underlying files in the storage area ./var/lib/couchbase/data/@fts so:

      bucket_name + scope_name + indexname must be <= 221 characters or <= 223 if we include the “.” separation characters (as we add “.” separators and “.pindex” suffix and a uuid like construct)

      According to the Couchbase documentation, [Create a Basic Search Index with the Web Console | Couchbase Docs|https://docs.couchbase.com/server/current/search/create-search-index-ui.html] ,the legal characters for a search index name are as follows:

      • The index name must start with an alphabetic character, which can be any letter from a to z or A to Z.
      • The rest of the index name can contain alphanumeric characters (letters and numbers, az, AZ, 09), hyphens (), or underscores (_)

      Attachments

        For Gerrit Dashboard: MB-59858
        # Subject Branch Project Status CR V

        Activity

          People

            sarthak.dua Sarthak Dua
            jon.strabala Jon Strabala
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty