summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep.erl
AgeCommit message (Collapse)Author
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-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-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-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-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-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-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-10-20checkpoints reuse session_id. Patch by tilgovi. COUCHDB-704Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1025573 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16Replicator: fix issues when a peer is accessible via SSL.Filipe David Borba Manana
Closes COUCHDB-491. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1023274 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30Removing ?getv macros.Filipe David Borba Manana
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities. (Only allowed in R13B04 and R14). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29Add missing expression to close the database (COUCHDB-892 related).Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1002810 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28Replicator fix: for a filtered replication, the replication ID should take ↵Filipe David Borba Manana
into account the filter function's code and not only its name. Closes COUCHDB-892. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1002259 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27Replacing calls to couch_util:get_value with ?getvFilipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001879 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22Replicator: avoid percent encoding the slashes of design and local document IDs.Filipe David Borba Manana
This avoids receiving and following redirect responses from the peer. It also removes the eventual need of special rules in proxies (like Apache httpd). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1000140 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13Replicator changes:Filipe David Borba Manana
1) avoid badmatch exceptions when there's a failure opening a single document from a remote source; 2) add error log messages describing which remote documents couldn't be opened and why; 3) when replications errors can't be encoded as json, convert and send them as json strings git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@996492 13f79535-47bb-0310-9956-ffa450edef68
2010-08-04Add replicator DB (_replicator).Filipe David Borba Manana
Part of ticket COUCHDB-776. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@982330 13f79535-47bb-0310-9956-ffa450edef68
2010-08-01Add missing clause to the case expression to avoid a case_clause Erlang ↵Filipe David Borba Manana
exception. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@981343 13f79535-47bb-0310-9956-ffa450edef68
2010-07-30Add support for replication through an HTTP/HTTPS proxy.John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@980985 13f79535-47bb-0310-9956-ffa450edef68
2010-07-23Corrected misleading parameter name (Logs => DbList) and removed unnecessary ↵Filipe David Borba Manana
tuple parameter extraction and reconstruction. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@967262 13f79535-47bb-0310-9956-ffa450edef68
2010-07-23Removed bogus log error message.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@967251 13f79535-47bb-0310-9956-ffa450edef68
2010-07-20require application/json content-type in the remaining places where a POST ↵John Christopher Anderson
has side-effects git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@965700 13f79535-47bb-0310-9956-ffa450edef68
2010-07-19remove unguarded atom creation to prevent DOS attacks. closes COUCHDB-829John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@965667 13f79535-47bb-0310-9956-ffa450edef68
2010-07-19COUCHDB-810: Adds port to replication checkpoints.Robert Newson
New replication checkpoints now include the port number, which allows for efficient replication between multiple couchdb instances running on the same machine. Old replication checkpoints are recognized (Full replication is not induced) and they are automatically migrated to the new checkpoint format. Thanks to Randall Leeds for the patch. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@965331 13f79535-47bb-0310-9956-ffa450edef68
2010-06-24use JSON content type in replicator, require it in the _bulk_docs and other ↵John Christopher Anderson
POST apis git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957422 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02trailing whitespace pedantryJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@950545 13f79535-47bb-0310-9956-ffa450edef68
2010-05-19Strip password from URLs before adding them to the tasks databaseJan Lehnardt
and before sending it to the logger. Closes COUCHDB-756. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@946428 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04use crypto:md5 when available. thx fdmanana. Closes COUCHDB-757Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@941033 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04use keysearch BIF to search ejson props. Closes COUCHDB-747Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@940708 13f79535-47bb-0310-9956-ffa450edef68
2010-04-11bugfix for replication keepalive. Closes COUCHDB-730Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@933039 13f79535-47bb-0310-9956-ffa450edef68
2010-03-21Take query options into account when generating replication ids.Jan Lehnardt
Patch by Filipe Manana. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@925879 13f79535-47bb-0310-9956-ffa450edef68
2010-03-20backwards compatible ids for non-docid replicationsJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@925497 13f79535-47bb-0310-9956-ffa450edef68
2010-03-19Do not use the doc_id list from the previous replication requestJan Lehnardt
on subsequent replication requests. Closes COUCHDB-703. Patch by Filipe Manana. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@925488 13f79535-47bb-0310-9956-ffa450edef68
2010-02-26fdmananas patch for filtered replication via COUCHDB-673John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@916518 13f79535-47bb-0310-9956-ffa450edef68
2010-02-24replicator and view generator can skip check_is_reader when opening database ↵John Christopher Anderson
files git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915827 13f79535-47bb-0310-9956-ffa450edef68
2010-02-24Allow replication to be cancelled. Closes COUCHDB-664. Patch by Robert Newson.Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915664 13f79535-47bb-0310-9956-ffa450edef68
2010-02-19keep listeners when rebooting replicationsAdam Kocoloski
This fixes the problem where rebooted replications would crash at the end with a badmatch on [] in do_terminate. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@911717 13f79535-47bb-0310-9956-ffa450edef68
2010-01-29Thanks Filipe Manana. Closes COUCHDB-631.John Christopher Anderson
Replicator option to replicate a list of docids (bypasses by_seq index). Usage: POST to /_replicate with a JSON body of: {"source": "myfoo", "target" : "http://remotedb.com/theirfoo", "doc_ids": ["foo1", "foo3", "foo666"]} This will copy the listed docs from the source to the target database. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@904615 13f79535-47bb-0310-9956-ffa450edef68
2009-12-08release old Fds on replication reboot, shut down child procs in a cleaner orderAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@888267 13f79535-47bb-0310-9956-ffa450edef68
2009-11-21code improvements from tidier. Patch by Kostis Sagonas. COUCHDB-570Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@882903 13f79535-47bb-0310-9956-ffa450edef68
2009-10-28reboot replication from last checkpoint if DB is compacted or server restartsAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@830737 13f79535-47bb-0310-9956-ffa450edef68
2009-10-20typoJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@827720 13f79535-47bb-0310-9956-ffa450edef68
2009-10-15Only check for admin user if we are trying to create a database. Thanks to ↵Jan Lehnardt
Bob Dionne for testing the patch. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@825485 13f79535-47bb-0310-9956-ffa450edef68
2009-10-11add create_target:true option to _replicate that creates the target databaseJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@824029 13f79535-47bb-0310-9956-ffa450edef68
2009-09-21attempt at gentler replication shutdown when one of the DBs is deletedAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@817403 13f79535-47bb-0310-9956-ffa450edef68
2009-09-09choice of uuid algos for better insert perf. Closes COUCHDB-465. Thanks ↵Adam Kocoloski
rnewson, bitdiddle git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@813051 13f79535-47bb-0310-9956-ffa450edef68
2009-09-06check if either history is empty, not bothAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@811868 13f79535-47bb-0310-9956-ffa450edef68
2009-09-05code =~ s/imperative/declarative & faster/, thanks to Kostis Sagonas for ↵Jan Lehnardt
pointing these out, more to come git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@811709 13f79535-47bb-0310-9956-ffa450edef68
2009-09-02fix continuous replication occurring after identical normal oneAdam Kocoloski
Both forms of replication had the same child ID in the replication supervisor. As a result, a continuous replication triggered after an otherwise-identical normal replication would "forget" that it was continuous. The tricky part about this patch is that it lets a normal and a continuous replication with the same source and target execute simultaneously. That's inefficient, but other solutions are convoluted or give surprising results to the client. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@810358 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28fix pattern matching bug in redirects for replicationAdam Kocoloski
if opening the DB returns 301, use the new URL for the rest of the replication git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@808876 13f79535-47bb-0310-9956-ffa450edef68