Robert Newson [Thu, 2 Apr 2015 10:46:35 +0000 (11:46 +0100)]
Accept is_r_met=true query parameter
COUCHDB-2655
Robert Kowalski [Fri, 13 Mar 2015 02:45:09 +0000 (03:45 +0100)]
add license file
Alexander Shorin [Thu, 26 Feb 2015 20:23:38 +0000 (23:23 +0300)]
Merge remote-tracking branch 'kxepal/rename-system-databases'
This closes #27
Alexander Shorin [Thu, 26 Feb 2015 18:55:25 +0000 (21:55 +0300)]
Rename "shard_db" option to "shards_db"
COUCHDB-2628
Alexander Shorin [Wed, 25 Feb 2015 21:39:45 +0000 (00:39 +0300)]
Add underscore prefix for dbs database name
That's how we name system databases and there should be no exceptions.
COUCHDB-2619
Robert Kowalski [Thu, 19 Feb 2015 20:21:25 +0000 (21:21 +0100)]
Remove _config route on cluster
In order to avoid users shooting themselves in the foot by using
`/_config/` on a clustered CouchDB with a loadbalancer in front,
we remove it on `15984` - it will be available for single-node-
mode on the backdoor port (`15986`) or for users that are feeling
lucky which want to fire curl requests to every node.
It also allows Fauxton to detect if it is running on a the backdoor
port. Fauxton will - if it gets a 200 instead of a 404 - show the
config-section to the user.
COUCHDB-2601 COUCHDB-2390 COUCHDB-2343
Jan Lehnardt [Sun, 8 Feb 2015 13:26:16 +0000 (14:26 +0100)]
add mango URL endpoints
Robert Kowalski [Wed, 19 Nov 2014 01:11:25 +0000 (02:11 +0100)]
Return ok:true on _bulk_doc update
Return `ok: true` on a successful _bulk_doc update like in
CouchDB 1.6.
Example success message on 2.0 (broken):
```
[{"id":"Brocket","rev":"6-
b6fa9e703c3eb92aa9c3a49cedf1e8c2"}]
```
Example error message on 2.0:
```
[{"id":"Blaggie-System","error":"conflict",
"reason":"Document update conflict."}]
```
Example success message on 1.x:
```
[{"id":"Brocket", "ok": true, "rev":"6-
b6fa9e703c3eb92aa9c3a49cedf1e8c2"}]
```
Finally closes COUCHDB-2462
Alexander Shorin [Thu, 5 Feb 2015 11:17:52 +0000 (14:17 +0300)]
Fix typo in config listener module name
Alexander Shorin [Wed, 4 Feb 2015 15:43:16 +0000 (18:43 +0300)]
Merge remote-tracking branch 'iilyak/2561-make-config-API-consistent'
This closes #21
COUCHDB-2561
ILYA Khlopotov [Fri, 30 Jan 2015 19:06:12 +0000 (11:06 -0800)]
Don't restart event handler on termination
COUCHDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 21:34:31 +0000 (13:34 -0800)]
config:get/3 is more strict now
The config:get/3 supports only following types for default argument
- atom `undefined`
- string (list)
- boolean
- float
- integer
COUCDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 21:33:57 +0000 (13:33 -0800)]
Update config_listener behaviuor
COUCHDB-2561
Will Holley [Mon, 2 Feb 2015 20:56:29 +0000 (20:56 +0000)]
Parse attachment-related parameters for /_changes
Match the way that couch_httpd_db:parse_changes_query handles attachment
related query parameters.
This closes #23
COUCHDB-2522
Signed-off-by: Alexander Shorin <kxepal@apache.org>
Will Holley [Sat, 31 Jan 2015 10:46:30 +0000 (10:46 +0000)]
Enable POST requests to /_changes in clustered CouchDB
Appropriate handling of a POST to _changes is already in place in
single node CouchDB. In clustered CouchDB, allow POST requests to pass
through to the underlying handler and existing logic will do the rest.
This closes #22
COUCHDB-2530
Signed-off-by: Alexander Shorin <kxepal@apache.org>
Alexander Shorin [Fri, 30 Jan 2015 07:39:23 +0000 (10:39 +0300)]
Merge remote-tracking branch 'iilyak/1145-_local_docs-handler'
Conflicts:
src/chttpd_db.erl
This closes #16
COUCHDB-1145
Will Holley [Thu, 29 Jan 2015 17:59:39 +0000 (17:59 +0000)]
Set view type before validating _all_docs parameters.
Matching couch_mrview, set view_type to "map" before validating query
parameters for _all_docs. This fixes a bug whereby validation fails
when specifying _all_docs?conflicts=true.
This closes #20
COUCHDB-2523
Signed-off-by: Alexander Shorin <kxepal@apache.org>
Will Holley [Thu, 29 Jan 2015 10:19:34 +0000 (10:19 +0000)]
validate _all_docs query parameters
Perform the same query parameter validation in the clustered interface
for /_all_docs requests as we do in the non-clustered interface.
This closes 19
COUCHDB-2523
Signed-off-by: Alexander Shorin <kxepal@apache.org>
Jan Lehnardt [Fri, 31 Oct 2014 14:53:10 +0000 (15:53 +0100)]
add setup
Alexander Shorin [Mon, 26 Jan 2015 04:07:43 +0000 (07:07 +0300)]
Use ADMIN_CTX macro from couch_db.hrl
Mike Wallace [Thu, 15 Jan 2015 15:31:09 +0000 (15:31 +0000)]
Convert {timeout, Error} errors to timeout
If chttpd got a {timeout, Error} error then it would return
that tuple to the client. Since Error is some internal specifics
this isn't particularly useful information to return to the client.
This commit converts it to our usual timeout response.
This closes #18
COUCHDB-2425
Signed-off-by: Alexander Shorin <kxepal@apache.org>
Alexander Shorin [Wed, 21 Jan 2015 01:40:05 +0000 (04:40 +0300)]
Merge remote-tracking branch 'kxepal/2538-revert-500-error-reason-changes'
This closes #17
Alexander Shorin [Fri, 9 Jan 2015 15:32:28 +0000 (18:32 +0300)]
Restore <<"unknown_error">> for HTTP 500 errors
This reverts changes made in
059229777 commit allowing chttpd to send
HTTP 500 errors in the same format as httpd does, e.g.:
{"error": "unknown_error", "reason": "function_clause", "ref": 100500}
COUCHDB-2538
Alexander Shorin [Wed, 21 Jan 2015 01:34:31 +0000 (04:34 +0300)]
Add tests for chttpd:error_info/1
ILYA Khlopotov [Fri, 19 Dec 2014 16:48:05 +0000 (08:48 -0800)]
Rename argument to reflect new semantic
ILYA Khlopotov [Fri, 19 Dec 2014 16:15:37 +0000 (08:15 -0800)]
Reuse _all_docs handler for _local_docs/_design_docs
ILYA Khlopotov [Thu, 18 Dec 2014 21:20:51 +0000 (13:20 -0800)]
Add _local_docs and _design_docs handlers
COUCHDB-1145
Paul J. Davis [Tue, 16 Dec 2014 20:57:06 +0000 (14:57 -0600)]
Merge branch '2517-open_revs=all-function_clause'
Fixes #15
ILYA Khlopotov [Mon, 8 Dec 2014 15:46:46 +0000 (07:46 -0800)]
Re-indent to reflect recent addtion of a case branch
COUCHDB-2517
ILYA Khlopotov [Mon, 8 Dec 2014 15:45:00 +0000 (07:45 -0800)]
Return error when open_revs=all and document doesn't exist
COUCHDB-2517
Paul J. Davis [Fri, 12 Dec 2014 20:33:34 +0000 (14:33 -0600)]
Merge branch '2491-refactor-couch-httpd-auth'
Fixes #13
Paul J. Davis [Thu, 4 Dec 2014 19:13:42 +0000 (13:13 -0600)]
Update chttpd_auth_cache for new couch_auth_cache
This updates the interface to chttpd_auth_cache to match the new
callback API expected by couch_httpd_auth. Specifically this allows for
the upgraded user documents to be written back to the correct user
database.
COUCHDB-2491
Robert Kowalski [Sat, 25 Oct 2014 02:45:07 +0000 (04:45 +0200)]
Fix location-header for documents with newlines in the name
Properly urlencode the Document-Id in the Location-field of the
header
Based on a patch from Sean Bartell <wingedtachikoma@gmail.com>
COUCHDB-708
Robert Newson [Thu, 9 Oct 2014 18:48:07 +0000 (19:48 +0100)]
fix filtered replication
Alexander Shorin [Wed, 24 Sep 2014 20:51:21 +0000 (00:51 +0400)]
Rebrand X-Cloudant-Stack-Hash header for CouchDB
Alexander Shorin [Wed, 24 Sep 2014 15:38:38 +0000 (19:38 +0400)]
Use couch_log instead of ?LOG_*
Russell Branca [Wed, 10 Sep 2014 22:20:40 +0000 (15:20 -0700)]
Add CORS headers to chttpd_external:send_external_response
COUCHDB-2328
Russell Branca [Wed, 10 Sep 2014 22:18:57 +0000 (15:18 -0700)]
Make parse_external_response work with binaries and lists
COUCHDB-2328
Robert Newson [Mon, 15 Sep 2014 23:20:36 +0000 (00:20 +0100)]
Send num_mp_writers to correct N
Robert Newson [Mon, 8 Sep 2014 17:11:00 +0000 (18:11 +0100)]
Forward-port caching and csp headers for _utils
Robert Newson [Thu, 4 Sep 2014 12:12:24 +0000 (13:12 +0100)]
Remove chttpd/couchdb stats split
The way that chttpd delegates to couch_httpd makes it difficult to
separate http states via 5984 vs 5986.
Robert Newson [Wed, 3 Sep 2014 18:23:12 +0000 (19:23 +0100)]
_all_dbs does not require admin
Robert Newson [Tue, 2 Sep 2014 16:53:53 +0000 (17:53 +0100)]
Add remaining status code stats
Robert Newson [Tue, 2 Sep 2014 15:24:57 +0000 (16:24 +0100)]
Move stats cfg to correct place
Robert Newson [Sat, 30 Aug 2014 10:52:24 +0000 (11:52 +0100)]
Decrement clients_requesting_changes in a timely fashion
The previous approach using process_tracker was flawed. If a client
reuses a connection, as is common, the clients_requesting_changes
metric will only be decremented when the connection is terminated,
even if the connection is not requesting changes.
Robert Newson [Fri, 29 Aug 2014 20:10:04 +0000 (21:10 +0100)]
Correctly collect stats by status code
Robert Newson [Fri, 29 Aug 2014 19:13:35 +0000 (20:13 +0100)]
Use a distinct namespace for chttpd stats
Robert Newson [Fri, 22 Aug 2014 18:10:13 +0000 (19:10 +0100)]
Switch to couch_stats application
Paul J. Davis [Sun, 17 Aug 2014 02:25:03 +0000 (21:25 -0500)]
Remove unused handle_restart_req
Paul J. Davis [Sun, 17 Aug 2014 02:24:51 +0000 (21:24 -0500)]
Be more restrictive when including a JSON stack
Paul J. Davis [Sun, 17 Aug 2014 02:24:39 +0000 (21:24 -0500)]
Added error_info for maintenance mode errors
Russell Branca [Mon, 30 Jun 2014 20:31:04 +0000 (13:31 -0700)]
Only use cassim:set_security if cassim is enabled
BugzId: 32070
Robert Newson [Wed, 30 Jul 2014 11:07:19 +0000 (12:07 +0100)]
Add cassim
Russell Branca [Wed, 9 Apr 2014 22:04:19 +0000 (15:04 -0700)]
Isolate update_doc logic from http logic
Russell Branca [Tue, 8 Apr 2014 22:42:22 +0000 (15:42 -0700)]
Separate update doc and sending the response in update_doc
Adam Kocoloski [Mon, 19 May 2014 20:52:01 +0000 (16:52 -0400)]
Log unexpected return value from att data fetch
BugzID: 30891
Brian Mitchell [Fri, 16 May 2014 19:57:53 +0000 (15:57 -0400)]
Be more careful when matching attachment data
This code was ported from a list comprehension which used
to properly ignore patterns which didn't match the Fd
tuple. This adds back the ability to ignore stub data
entries as this does come up in one case where att_since is
passed in via the API.
Russell Branca [Fri, 28 Mar 2014 17:33:43 +0000 (10:33 -0700)]
Add the request id and timing info in chttpd:send_response
Russell Branca [Fri, 28 Mar 2014 17:25:46 +0000 (10:25 -0700)]
Update chttpd_external with s/couch_httpd/chttpd/
Switch to using chttpd:send_{json,response} from chttpd_external so
that _show and _update functions are properly sending CORS headers.
Randall Leeds [Fri, 9 Sep 2011 00:23:50 +0000 (00:23 +0000)]
honor ?rev for PUT and validate against _rev/etag
Fixes COUCHDB-1268
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@
1166945 13f79535-47bb-0310-9956-
ffa450edef68
Robert Newson [Wed, 8 Jan 2014 18:05:57 +0000 (18:05 +0000)]
Honor max_document_size when receiving body in externals
BugzID: 26773
Brian Mitchell [Thu, 12 Dec 2013 04:09:54 +0000 (23:09 -0500)]
Move attachment code into couch_att
This is an attempt to isolate the attachment record and
some related code. This will allow seamless upgrades
over time.
Robert Newson [Wed, 30 Jul 2014 10:05:41 +0000 (11:05 +0100)]
Add CORS support
Paul J. Davis [Thu, 12 Dec 2013 18:42:53 +0000 (12:42 -0600)]
Add error_info clause for nodedown errors
BugzId: 26122
Paul J. Davis [Thu, 12 Dec 2013 18:38:10 +0000 (12:38 -0600)]
Improve HTTP error log formatting
The use of `~p` for binaries and stacks wasn't very useful. This just
changes things around as well as puts the stack on a new line indented
four spaces so that its readable.
BugzId: 26121
Paul J. Davis [Wed, 11 Dec 2013 17:11:52 +0000 (11:11 -0600)]
Fix JSON encoding for missing revisions
This is a super old bug from when we switched to Jiffy. Jiffy doesn't
support Erlang strings as object keys due to Unicode issues. This just
changes the "missing" string to a <<"missing">> binary.
BugzId: 26050
Robert Newson [Tue, 10 Dec 2013 00:44:04 +0000 (00:44 +0000)]
Improve logging of errors with traces
Robert Newson [Fri, 22 Nov 2013 16:44:56 +0000 (16:44 +0000)]
set module version to 1
Robert Newson [Sat, 16 Nov 2013 17:31:04 +0000 (17:31 +0000)]
Ensure result of send_delayed_error is always a #delayed_resp
BugzID: 25402
Robert Newson [Thu, 7 Nov 2013 19:36:33 +0000 (19:36 +0000)]
Don't return stacktraces, log them instead.
BugzID: 17674
Paul J. Davis [Tue, 22 Oct 2013 04:57:37 +0000 (23:57 -0500)]
Fix case_clause error with POST to _replicate
We were matching without specifying a default value. Rather than end up
causing other errors we just match on false and default true for all
other values.
BugzId: 24355
Paul J. Davis [Thu, 17 Oct 2013 21:09:42 +0000 (16:09 -0500)]
Avoid VM log messages about uncaught errors
We defer doc updates to a child process so that we avoid mixing fabric
messages together between HTTP requests. This just makes the defer
cleaner so that the VM doesn't log when we throw a conflict error.
BugzId: 24264
Adam Kocoloski [Thu, 17 Oct 2013 18:36:11 +0000 (14:36 -0400)]
Report pending count in _changes
BugzID: 24236
Adam Kocoloski [Wed, 16 Oct 2013 19:20:21 +0000 (15:20 -0400)]
Wrap decompression in a try/catch, report 400
BugzID: 24000
Adam Kocoloski [Wed, 16 Oct 2013 18:20:33 +0000 (14:20 -0400)]
Fix unused variable warning
Adam Kocoloski [Wed, 16 Oct 2013 17:23:14 +0000 (13:23 -0400)]
Try to cancel a replication everywhere
Cancelation requests sometimes omit source and target information in
favor of a replication ID. When that happens the logic that selects the
owner for the replication picks the wrong node, and the cancelation
fails with a not_found error. This patch causes the request to be
submitted to all nodes in the cluster. We report success if at least
one node reports success, otherwise we report (one of) the errors that
we received.
BugzID: 21976
Benjamin Anderson [Sat, 12 Oct 2013 02:29:23 +0000 (22:29 -0400)]
Add statistics for couch_db_updater message queues
BugzID: 24167
Adam Kocoloski [Wed, 9 Oct 2013 15:37:18 +0000 (11:37 -0400)]
Allows clients to send gzipped JSON bodies
A request with a Content-Encoding other than "gzip" or "identity" will
receive a 415 Unsupported Media Type response.
BugzID: 24000
Paul J. Davis [Fri, 4 Oct 2013 22:36:55 +0000 (17:36 -0500)]
Add error formatting for maintenance mode
If all nodes end up in maintenance mode we need to report that progress
isn't possible due to a "nodedown".
Adam Kocoloski [Wed, 2 Oct 2013 01:47:50 +0000 (21:47 -0400)]
Support "seq_interval" qs param on _changes
Supplying seq_interval=N will cause the changes feed to include a
sequence on every Nth row but set seq: null otherwise. It's a
performance hack until we can deploy a more efficient format.
BugzID: 23637
Benjamin Bastian [Sat, 21 Sep 2013 19:33:16 +0000 (12:33 -0700)]
Add boilerplate for global_changes
Benjamin Anderson [Fri, 16 Aug 2013 22:09:59 +0000 (15:09 -0700)]
Validate _bulk_docs POST bodies
This patch supplies some necessary input validation that
couch_doc:from_json_obj/1 can't provide. It eliminates spurious HTTP
500s and stacktraces from _bulk_docs POST bodies of the following
invalid formats:
{"docs": {"_id": "foo"}}
{"_id": "foo"}
BugzID: 21746
Benjamin Anderson [Fri, 16 Aug 2013 22:07:25 +0000 (15:07 -0700)]
Remove unnecessary pattern match and associated extraneous _rev check
The pattern match breaks when users submit _bulk_docs requests of the
format:
{"docs": [[{"_id": "foo"}]]}
couch_doc:from_json_obj/1 already performs the appropriate _rev logic,
so that check is unnecessary.
BugzID: 21746
Robert Newson [Thu, 15 Aug 2013 14:21:05 +0000 (15:21 +0100)]
Handle undefined result from process_info
BugzID: 21827
Benjamin Anderson [Fri, 2 Aug 2013 20:27:52 +0000 (13:27 -0700)]
Return stats for couch_file mailboxes in _system requests
Adam Kocoloski [Fri, 9 Oct 2009 01:54:48 +0000 (01:54 +0000)]
allow case-insensitive content-type from external, and other cleanup
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@823378
13f79535-47bb-0310-9956-
ffa450edef68
Adam Kocoloski [Fri, 7 Jun 2013 15:17:31 +0000 (11:17 -0400)]
Provide a dedicated NOLB mode
Setting [cloudant] maintenance_mode = nolb recovers the original
behavior of setting maintenance_mode to true; i.e., the node will not
participate in load balancing but is otherwise an active member of the
cluster.
BugzID: 18955
Adam Kocoloski [Thu, 6 Jun 2013 16:13:00 +0000 (12:13 -0400)]
Add _reload_query_servers, report stale proc count
BugzID: 19529
Mike Wallace [Fri, 24 May 2013 10:19:00 +0000 (11:19 +0100)]
Throw HTTP 413 is max_document_size is exceeded
BugzID: 19888
This is a backport of
Apache/CouchDB@
bf1eb135f2b46861474b9276dee02d8edb05fe3b
Michael Rhodes [Wed, 8 May 2013 14:52:31 +0000 (15:52 +0100)]
Throw 400 bad request not 500 for unrecognised _changes feed param
Robert Newson [Sun, 11 Sep 2011 10:50:11 +0000 (10:50 +0000)]
Reject large Range requests
Return a 200 response for any Range request that covers the entire entity
or that contains more than 10 byte ranges.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@
1168196 13f79535-47bb-0310-9956-
ffa450edef68
Russell Branca [Fri, 12 Apr 2013 20:47:20 +0000 (16:47 -0400)]
Add _shards db handler auth check
Adam Kocoloski [Thu, 11 Apr 2013 03:45:14 +0000 (23:45 -0400)]
Give fabric a string, not a number
Adam Kocoloski [Wed, 10 Apr 2013 16:24:13 +0000 (12:24 -0400)]
Allow write quorum control in POST body
BugzID: 18457
Michael Rhodes [Sun, 7 Apr 2013 01:54:47 +0000 (21:54 -0400)]
Add X-Couch-Update-NewRev and X-Couch-Id to _update response
This is porting commits from CouchDB:
ef7ab7e4e414d53fe5c12993d29b193ed3cdfd42
- allow client to get new _rev from _update via X-Couch-Update-NewRev
- I left out porting the JS test
98515bf0b990ca096ec5a47b9cd048427a0ec66c
- Return X-Couch-Id from show functions if doc is created
Michael Rhodes [Sun, 7 Apr 2013 01:52:58 +0000 (21:52 -0400)]
Remove trailing whitespace in chttpd_show
Mike Wallace [Tue, 2 Apr 2013 12:45:33 +0000 (13:45 +0100)]
Use couch_httpd_db:parse_copy_destination_header
Remove parse_copy_destination_header and use the function defined
in couch_httpd_db instead.
Requires cloudant/dbcore@
e9745834c164f6ef7f9e583bc4c36cdd83c415f4
so that parse_copy_destination_header is exported and has the
relevant backported code to throw an HTTP 400 if the COPY request
header does not have a Destination field.
BugzID: 18659
Robert Newson [Fri, 15 Mar 2013 18:09:59 +0000 (18:09 +0000)]
Allow ?deleted=true on doc GET's
Robert Newson [Mon, 11 Mar 2013 02:35:32 +0000 (21:35 -0500)]
Fix cancel by replication_id
BugzID: 17969
Robert Newson [Sat, 9 Mar 2013 21:45:40 +0000 (15:45 -0600)]
Honor "w" parameter for update handlers
BugzID: 17936