summaryrefslogtreecommitdiff
path: root/src/couchdb
AgeCommit message (Collapse)Author
2010-12-08Prefer values from old tree when merging, COUCHDB-968Adam Kocoloski
This commit represents a substantial refactor of the key tree merging logic, some of which is not strictly necessary for the resolution of COUCHDB-968. Two etap test cases checking the ability to merge in a non-linear tree are removed because the functionality is no longer supported. CouchDB only ever merged a linear revision history into an existing revision tree. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1043460 13f79535-47bb-0310-9956-ffa450edef68
2010-12-08Stem new rev tree before comparing with old one, COUCHDB-968Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1043459 13f79535-47bb-0310-9956-ffa450edef68
2010-12-07Merged revision 1043186 from trunk:Filipe David Borba Manana
Replicator improvement: send "unauthorized" error message instead of "db_not_found" when a remote endpoint can not be accessed due to authorization. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1043188 13f79535-47bb-0310-9956-ffa450edef68
2010-12-01Merged revision 1041103 from trunk:Filipe David Borba Manana
Proper verification of the accepted content types plus some code cleaning. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1041113 13f79535-47bb-0310-9956-ffa450edef68
2010-11-30Merged revision 1040603 from trunk:Filipe David Borba Manana
Missing cases for COUCHDB-949 (adding aliases start_key and end_key). git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1040605 13f79535-47bb-0310-9956-ffa450edef68
2010-11-28Merged revision 1039872 from trunk:Filipe David Borba Manana
Replicator DB listener: removed function clause not needed anymore. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1039873 13f79535-47bb-0310-9956-ffa450edef68
2010-11-25Merged revision 1039069 from trunk:Filipe David Borba Manana
Replicator DB: proper handling of the changes loop process. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1039070 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24Merged revision 1038665 from trunk:Filipe David Borba Manana
Replicator DB: added _replication_state_time (a unix timestamp value) to replication documents. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038666 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24Merged revision 1038660 from trunk:Filipe David Borba Manana
Replicator DB: fix a rare gen_server death case. Happened when the rep_db_created message is received before the changes loop dies. Also simplified a bit the handling of subprocesses exits. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038662 13f79535-47bb-0310-9956-ffa450edef68
2010-11-23Merged revision 1038181 from trunk:Filipe David Borba Manana
Corrected error message grammar. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038182 13f79535-47bb-0310-9956-ffa450edef68
2010-11-23Merged revision 1038176 from trunk:Filipe David Borba Manana
Replicator DB: stop all ongoing replications when the replicator DB is deleted or renamed (in the .ini config). Also updated the gen_server to stop when it receives unexpected calls. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038177 13f79535-47bb-0310-9956-ffa450edef68
2010-11-23Merged revision 1038172 from trunk:Filipe David Borba Manana
Replicator DB: added underscore prefix to the replication document fields that are meant to to be set/updated only by the replicator. This makes it more clear to end users that those fields are meant to be used internally by CouchDB. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038173 13f79535-47bb-0310-9956-ffa450edef68
2010-11-23Merged revision 1038067 from trunk:Filipe David Borba Manana
Replicator DB changes: - Added back the restriction that only the replicator can edit replication documents - this avoids lots of potential race conditions and confusion; - Added more tests; - More accurate log messages; - Don't ignore always replication documents already tagged with a replication_id property - this is necessary when replicating a replicator DB from one server to another server. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038068 13f79535-47bb-0310-9956-ffa450edef68
2010-11-21Merged revision 1037455 from trunk:Filipe David Borba Manana
Add proper validation of user_ctx.roles for replication documents. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037457 13f79535-47bb-0310-9956-ffa450edef68
2010-11-21Merged revision 1037448 from trunk:Filipe David Borba Manana
Proper verification of the roles property of a user document. Closes COUCHDB-790. Thanks Gabriel Farrell. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037450 13f79535-47bb-0310-9956-ffa450edef68
2010-11-19For absolute consistency, renamed aliases start_key_docid and end_key_docid ↵Filipe David Borba Manana
to start_key_doc_id and end_key_doc_id. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036818 13f79535-47bb-0310-9956-ffa450edef68
2010-11-19Add aliases start_key, end_key, start_key_docid and end_key_docid.Filipe David Borba Manana
Closes COUCHDB-949. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036813 13f79535-47bb-0310-9956-ffa450edef68
2010-11-19Make sure that after a local database compaction the old database reference ↵Filipe David Borba Manana
counters don't get unreleased forever because of a continuous (or long) replication is going on. Same type of issue as in COUCHDB-926. Thanks Adam Kocoloski for some suggestions. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036705 13f79535-47bb-0310-9956-ffa450edef68
2010-11-18Preserve user context when reopening a database.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036627 13f79535-47bb-0310-9956-ffa450edef68
2010-11-18Replicator DB: added one more useful log message.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036425 13f79535-47bb-0310-9956-ffa450edef68
2010-11-18Make sure that after compaction of the authentication database the old ↵Filipe David Borba Manana
reference counter is released. Same type of issue as in COUCHDB-926. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036407 13f79535-47bb-0310-9956-ffa450edef68
2010-11-18Make sure that after a database compaction the old database reference ↵Filipe David Borba Manana
counters don't get unreleased forever. Closes COUCHDB-926. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036294 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17Replicator DB: added 2 useful log messages.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035987 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17Replicator DB: removed some restrictions from the default document update ↵Filipe David Borba Manana
validation function and added some logging. 1) Now it's easier to replicate to the replicator DB and by default it's writable by any user (just like any user can POST to /_replicate/); 2) The logging in the document validation function allows us to see in the log, after a replication, why a document was not written to the target replicator DB. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035986 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17revert unwanted commitJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035981 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17Obvious parsing of the stale view parameter part 2.Jan Lehnardt
Thanks to Filipe for pointing this out to me. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035978 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17Add stale to parse_view_param/2 for consistency.Jan Lehnardt
Principle of least surprise. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035971 13f79535-47bb-0310-9956-ffa450edef68
2010-11-16Replicator: use the new builtin _doc_ids filter for the by doc IDs replication.Filipe David Borba Manana
This reduces code complexity and allows for continuous by doc IDs replication. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035780 13f79535-47bb-0310-9956-ffa450edef68
2010-11-16Some code simplifications to the couch_changes module.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035778 13f79535-47bb-0310-9956-ffa450edef68
2010-11-16Fix typo and grammar.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035694 13f79535-47bb-0310-9956-ffa450edef68
2010-11-16After authentication, redirect to the path the user requested, notJan Lehnardt
the one that is used internally. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035581 13f79535-47bb-0310-9956-ffa450edef68
2010-11-14Allow reduce=false parameter in map-only views.Jan Lehnardt
Patch by Jason Smith. Closes COUCHDB-881. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035097 13f79535-47bb-0310-9956-ffa450edef68
2010-11-13builtin changes filters fonctions: _doc_ids & _design. replace lastBenoit Chesneau
patch to get filtering on docids. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1034891 13f79535-47bb-0310-9956-ffa450edef68
2010-11-12Proper verification of the request's accepted media types. Uses the new ↵Filipe David Borba Manana
function mochiweb_request:accepts_content_type/1. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1034554 13f79535-47bb-0310-9956-ffa450edef68
2010-11-12Use lists:min/1 and lists:max/1 instead of erlang:min/2 and erlang:max/2. ↵Filipe David Borba Manana
The later are not available in earlier OTP releases. Closes COUCHDB-856. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1034380 13f79535-47bb-0310-9956-ffa450edef68
2010-11-11Micro optimization: when reading an iolist, read up to 8Kbs instead of the 4 ↵Filipe David Borba Manana
bytes length prefix only in the first file read operation. For reads of small terms/iolist (up to 8Kbs), this speeds up the whole operation. No impact on larger terms/iolists. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033790 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10Micro optimization: faster header reads (read the whole block at once, so ↵Filipe David Borba Manana
far headers are always smaller than a block). Read time is basically reduced to half. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033714 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10Support the keys parameter in GET requests.Paul Joseph Davis
You can now request a list of keys in the query string using a query string like: ?keys=["foo", "bar"] Your query string obviously needs to be properly escaped. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033676 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10COUCHDB-945 - ensure validation funs are still applied after compaction.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033640 13f79535-47bb-0310-9956-ffa450edef68
2010-11-09tidy up regex for compressible_att_typeAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033093 13f79535-47bb-0310-9956-ffa450edef68
2010-11-08shut down couch_view_group cleanly if no_db_fileAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032764 13f79535-47bb-0310-9956-ffa450edef68
2010-11-08Preserve attachment identity length when doing local to local replications.Filipe David Borba Manana
Closes COUCHDB-930. Patch by Juuso Väänänen. Thanks. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032673 13f79535-47bb-0310-9956-ffa450edef68
2010-11-07Bug fix: the separator for media types in the 'Accept' header is a comma. ↵Filipe David Borba Manana
The semicolon separates a media type from its parameters. A more complete solution, which takes into account Q values, was submitted upstream: https://github.com/mochi/mochiweb/issues/issue/21. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032391 13f79535-47bb-0310-9956-ffa450edef68
2010-11-07Allow the atts_since parameter to work together with the open_revs parameter.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032288 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06Fixed an error spotted by Filipe.Paul Joseph Davis
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031887 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05Don't choke on unknown configuration settings.Paul Joseph Davis
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031884 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05HTTP proxy handler.Paul Joseph Davis
The second of two new features to replace the _externals protocols. This allows users to configure CouchDB to proxy requests to an external HTTP server. The external HTTP server is not required to be on the same host running CouchDB. The configuration looks like such: [httpd_global_handlers] _google = {couch_httpd_proxy, handle_proxy_req, <<"http://www.google.com">>} You can then hit this proxy at the url: http://127.0.0.1:5984/_google If you add any path after the proxy name, or make a request with a query string, those will be appended to the URL specified in the configuration. Ie: http://127.0.0.1:5984/_google/search?q=plankton would translate to: http://www.google.com/search?q=plankton Obviously, request bodies are handled as expected. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031877 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05Enable CouchDB to manage OS process daemons.Paul Joseph Davis
This is a simple feature that allows useres to configure CouchDB so that it maintains a given OS level process alive. If the process dies for any reason, CouchDB will restart it. If the process restarts too often, then CouchDB will mark it has halted and not attempt to restart it. The default max restart rate is three times in the last five seconds. These parameters are adjustable. Commands that are started in this manner will have access to a simple API over stdio to request configuration parameters or to add log statements to CouchDB's logs. To configure an OS process as a CouchDB os_daemon, create a section in your local.ini like such: [os_daemons] daemon_name = /path/to/command -with args This will make CouchDB bring up the command and attempt to keep it alive. To request a configuration parameter, an os_daemon can write a simple JSON message to stdout like such: ["get", "os_daemons"]\n which would return: {"daemon_name": "/path/to/command -with args"} Or: ["get", "os_daemons", "daemon_name"]\n which would return: "/path/to/command -with args" There's no restriction on what configuration variables are visible. There's also no method for altering the configuration. If you would like your OS daemon to be restarted in the event that the configuration changes, you can send the following messages: ["register", $(SECTION)]\n When anyting in that section changes, your OS process will be rebooted so it can pick up the new configuration settings. If you want to listen for changes on a specific key, you can send something like: ["register", $(SECTION), $(KEY)]\n In this case, CouchDB will only restart your daemon if that exact section/key pair changes, instead of anything in that entire section. Logging commands look like: ["log", $(JSON_MESSAGE)]\n Where $(JSON_MESSAGE) is arbitrary JSON data. These messages are logged at the 'info' level. If you want to log at a different level you can pass messages like such: ["log", $(JSON_MESSAGE), {"level": $(LEVEL)}]\n Where $(LEVEL) is one of "debug", "info", or "error". When implementing a daemon process to be managed by CouchDB you should remember to use a method like checking the parent process id or if stdin has been closed. These flags can tell you if your daemon process has been orphaned so you can exit cleanly. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031875 13f79535-47bb-0310-9956-ffa450edef68
2010-11-04Replicator: set Content-Length header when posting to _ensure_full_commit. ↵Filipe David Borba Manana
Same reason as for COUCHDB-932. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031276 13f79535-47bb-0310-9956-ffa450edef68
2010-11-03We don't have MOVE requests. No need to track them.Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1030430 13f79535-47bb-0310-9956-ffa450edef68