wohali opened a new pull request #2502: Fix node-specific shard access via HTTP
URL: https://github.com/apache/couchdb/pull/2502
 
 
   ## Overview
   
   In #2336 we removed node-local HTTP access and redirected all traffic 
through `/_node/{node-name}/...`. This sneakily routes a new MochiWeb request 
through to couch_httpd under the covers.
   
   Unfortunately, in the process we ended up URL-decoding the URL, meaning the 
passed-through URL couldn't include `%2F` for accessing individual shards.
   
   This reintroduces URL encoding to fix the problem.
   
   ## Testing recommendations
   
   ```
   dev/run -n 1 -a admin:password
   curl -X PUT http://admin:password@localhost:15984/abc
   curl -X PUT http://admin:password@localhost:15984/abc/_design%2ffoo -d 
'{"language":"javascript","views":{"all":{"map":"function(doc) { emit(doc._id, 
null);}"}}}'
   curl -X PUT http://admin:password@localhost:15984/abc/def -d '{}'
   curl -X PUT http://admin:password@localhost:15984/abc/qqq -d '{}'
   curl http://admin:password@localhost:15984/_node/_local/_all_dbs
   # substitute your timestamp code in the following lines...
   curl 
http://admin:password@localhost:15984/_node/_local/shards%2f00000000-7fffffff%2fabc.1580273428
   curl 
http://admin:password@localhost:15984/_node/_local/shards%2f00000000-7fffffff%2fabc.1580273428/def
   curl 
http://admin:password@localhost:15984/_node/_local/shards%2f00000000-7fffffff%2fabc.1580273428/qqq
   curl http://admin:password@localhost:15984/abc/_design/foo/_info
   curl http://admin:password@localhost:15984/abc/_design/foo/_view/all
   curl 
http://admin:password@localhost:15984/_node/_local/shards%2f80000000-ffffffff%2fabc.1580273428/_design/foo/_info
   ```
   
   ## Related Issues or Pull Requests
   
   Closes #2500 (mostly). I can't work out if we ever wired up the ability to 
look at individual view shard info stats thru 5986. If we did, it doesn't seem 
to be working; I can only see the view shard info for the shard corresponding 
to the ddoc's shard (here, `80000000-ffffffff`).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to