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

Should Prepare statement auto regenerate if the plan is no longer valid?

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Resolved
    • Major
    • None
    • 4.1.1, 4.5.0
    • query
    • Security Level: Public
    • None

    Description

      Problem

      The user drops an index which in turns means that the prepare statement using that index no longer works. A meaningful message is returned:

          "errors": [
              {
                  "code": 12016,
                  "msg": "Index Not Found - cause: queryport.indexNotFound"
              }
          ],
      

      However the application server will stop working until it is restarted. It worth noting that even if the index is recreated with the same name the prepared statement will still not work, i assume the plan uses the index id.

      In some use cases there are as many as 1000 application servers, so restarting the application servers can be expensive.

      Another option in 4.5 is for the user to delete the prepare statements and the SDK will automatic regenerate them.

      Solution

      I normally do not like suggesting solution to engineering but I do want to highlight some potential problems.

      It would be nice if the prepare statements are auto regenerated on failure however I do understand that the new plan could be more expenses (full bucket scan) which in turn could put more load on the system.

      If we decide against auto regenerate then it would be useful if "select * from system:prepareds" had a field saying if the prepare statement was still valid. Further more it would be great if the UI could display invalid prepared statements.

      Attachments

        Issue Links

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

          Activity

            People

              Donald.haggart Donald Haggart
              pvarley Patrick Varley (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty