Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
2.1.0
-
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