Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-264

Post Upgrade "fails" in a cluster with no query nodes

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Unresolved
    • 2.1.0
    • 2.6.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 19
    • 5

    Description

      Since 2.1, we obviously have to check for obsolete GSI indexes as well as views on _post_upgrade, but we return any error we get from trying this as a failure, e.g. :

      http POST :4985/_post_upgrade
      HTTP/1.1 500 Internal Server Error
      Content-Length: 85
      Content-Type: application/json
      Date: Mon, 11 Mar 2019 19:46:33 GMT
      Server: Couchbase Sync Gateway/2.1 branch/HEAD(nobranch) commit/a036bd8
       
      {
          "error": "Internal Server Error",
          "reason": "Internal error: No available N1QL nodes."
      }
      

      2019-03-11T19:46:33.577Z [INF] HTTP:  #002: POST /_post_upgrade (as ADMIN)
      2019-03-11T19:46:33.587Z [INF] HTTP: #002:     --> 500 Internal error: No available N1QL nodes.  (10.3 ms)
      

      It's worth noting though, that as we check ddocs first, they do get processed but this isn't reported as we only return the error.

      Maybe the nicest thing to do here would be to try return the failure wrapped in the overall object:

      		postUpgradeResults[name] = PostUpgradeDatabaseResult{
      			RemovedDDocs:   removedDDocs,
      			RemovedIndexes: removedIndexes,
      		}
      

      That does raise a slight question about what the status code should be if only one fails, but that's probably overthinking it a bit

      Attachments

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

        Activity

          adamf Adam Fraser added a comment - - edited

          Lowering the priority, as there isn't a scenario without index/query nodes where post_upgrade actually needs to be run (see comments on CBG-265), but agree this should be improved to handle the error more gracefully.

          adamf Adam Fraser added a comment - - edited Lowering the priority, as there isn't a scenario without index/query nodes where post_upgrade actually needs to be run (see comments on CBG-265 ), but agree this should be improved to handle the error more gracefully.

          Build sync_gateway-2.6.0-3 contains sync_gateway commit 125b457 with commit message:
          CBG-264: Fix post_upgrade 'fail' when no query node (#4045)

          build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-3 contains sync_gateway commit 125b457 with commit message: CBG-264 : Fix post_upgrade 'fail' when no query node (#4045)

          Build sync_gateway-2.6.0-3 contains sync_gateway commit 125b457 with commit message:
          CBG-264: Fix post_upgrade 'fail' when no query node (#4045)

          build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-3 contains sync_gateway commit 125b457 with commit message: CBG-264 : Fix post_upgrade 'fail' when no query node (#4045)

          People

            jacques.rascagneres Jacques Rascagneres
            James Flather James Flather
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty