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

When a view fails to index it prevents other views in the same design document indexing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Critical
    • 4.0.0
    • 2.5.1
    • view-engine
    • Security Level: Public
    • Triaged
    • Unknown

    Description

      A customer reported that they had a view which was missing documents.
      The view was incredibly simple and it didn't have any errors reported in the logs so it didn't make sense. There were errors for other views so I suspected that having a failed view (emit too much data, key too large, etc) in a design document may cause the other views in the same design document to not get processed for a specific document

      I've setup a basic test that confirms what I suspect, the view engine will not attempt to index further views in a Design Document if a view has failed.

      I created a design document with 2 views,

      View A (longkey) emits a key which is too long (one of the errors you are seeing)

      function (doc, meta) {

      function addnumbers(str) {
      for (k = 0; k < 10000; k += 1)

      { str += k; }

      return str
      }
      foo = addnumbers(meta.id);
      emit(foo, null);
      }
      View B (list_docs) lists all documents by id

      function (doc, meta)

      { emit(meta.id, null); }

      When I run this design document, the view engine is failing to index the document in the first view and doesn't attempt to index the 2nd view. View B (list_docs) gives an empty result. When I remove the erroring View A (longkey) the index is regenerated and View B gives the desired result.

      Can we either log the fact that View B (list_docs) has been skipped or attempt to run View B (list_docs) even though View A (longkey) failed ?

      Attachments

        Issue Links

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

          Activity

            People

              cihan Cihan Biyikoglu (Inactive)
              ianmccloy Ian McCloy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty