[MB-6922] ns_server should send 302 reply when view query hits node without any active vbuckets Created: 15/Oct/12  Updated: 23/Jul/13  Resolved: 16/Oct/12

Status: Closed
Project: Couchbase Server
Component/s: ns_server
Affects Version/s: 2.0
Fix Version/s: 2.0
Security Level: Public

Type: Bug Priority: Critical
Reporter: Aleksey Kondratenko Assignee: Aleksey Kondratenko
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File No_active_vbuckets_UI.png    
Issue Links:
Dependency
blocks CCBC-169 Handle 30x HTTP response code when ch... Closed
Duplicate
duplicates MB-7661 [Done, RN 2.1.0] View query on Rebala... Resolved

 Description   
Client's would like to cache list of bucket's nodes. Currently when node is rebalanced out there's period of time when it doesn't have any active vbuckets left. Our view merger cannot deal with that so we currently return 404.

But SDK folks would like us to handle it similarly to not-my-vbucket at memcached level. And they want to send back 302 with some random node with vbuckets in Location.

update: I think I wasn't clear enough. 404 is hard to interpret from client perspective. It may mean 'no such ddoc exist' or 'no such bucket exists' or currently 'you cannot query this node'. 302 instead of 404 for such condition would be much clearer signal to client.

 Comments   
Comment by Iryna Mironava [ 16/Oct/12 ]
verified on build 1854
change - http://review.couchbase.org/#/c/21657/

302 is returned.
iryna@test-ruby01:~/couchbase/testrunner$ curl -v 'http://10.3.121.105:8092/default/_design/view1/_view/view1?connection_timeout=60000&limit=10&skip=0'
curl: /usr/local/lib/libcurl.so.4: no version information available (required by curl)
* About to connect() to 10.3.121.105 port 8092 (#0)
* Trying 10.3.121.105... connected
* Connected to 10.3.121.105 (10.3.121.105) port 8092 (#0)
> GET /default/_design/view1/_view/view1?connection_timeout=60000&limit=10&skip=0 HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.21.4 OpenSSL/1.0.1 zlib/1.2.3.4
> Host: 10.3.121.105:8092
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: Couchbase Server 2.0.0-1854-rel-enterprise
< Pragma: no-cache
< Location: http://10.3.121.104:8092/default/_design/view1/_view/view1?connection_timeout=60000&limit=10&skip=0
< Date: Tue, 16 Oct 2012 08:54:52 GMT
< Content-Type: application/json
< Content-Length: 105
< Cache-Control: no-cache
<
* Connection #0 to host 10.3.121.105 left intact
* Closing connection #0
{"error":"no_active_vbuckets","reason":"Cannot execute view query since the node has no active vbuckets"}

But on UI error is not user-friendly: {"error":{"xhrStatus":"error","errMsg":""}}
attaching screenshot
Comment by Aleksey Kondratenko [ 16/Oct/12 ]
Thanks for pointing this out. We'll deal with that.
Comment by Farshid Ghods (Inactive) [ 16/Oct/12 ]
Iryna is going to file a seperate ticket for this issue
Generated at Sat Sep 20 09:10:37 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.