summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep.erl
AgeCommit message (Collapse)Author
2011-06-21Backport revision 1137928 from trunkFilipe David Borba Manana
Fix server crash associated with the replicator database If there's an exception when calculating the replication ID for a replication document, it crashes the replication manager gen_server 10 times. 10 is the maximum number of restarts per hour specified for the couch_server_sup supervisor. An easy way to trigger such exception is to specify a non existent filter in a replication document. This closes COUCHDB-1199. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1137929 13f79535-47bb-0310-9956-ffa450edef68
2011-05-30supervisor:delete_child returns ok after a successful terminated_child in R14B03Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1129107 13f79535-47bb-0310-9956-ffa450edef68
2011-05-25Backported revision 1127632 from trunkFilipe David Borba Manana
Force non admins to supply a user_ctx in replication documents This is to prevent users deleting replication documents added by other users and to make it clear who triggers which replications. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1127634 13f79535-47bb-0310-9956-ffa450edef68
2011-05-21Merged revision 1125680 from trunkFilipe David Borba Manana
Use RFC3339 timestamps in replication documents As recently proposed by Max Odgen, RFC3339 timestamps are now used instead of Unix timestamps. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1125682 13f79535-47bb-0310-9956-ffa450edef68
2011-05-20Replication manager: don't update doc if new state == current stateFilipe David Borba Manana
This is to avoid unncessary updates. This is a backport of revision 1125317 (trunk). git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1125320 13f79535-47bb-0310-9956-ffa450edef68
2011-04-20Merged revision 1095355 from branch 1.0.xFilipe David Borba Manana
Avoid replicator crash on list_to_existing_atom/1 calls This happens when a remote endpoint exposes new information in the database URI that is not recognized by this CouchDB version. Closes COUCHDB-1004. Applied Adam's simple 1 line fix. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1095356 13f79535-47bb-0310-9956-ffa450edef68
2011-04-18Merged revision 1094419 from branch 1.0.xFilipe David Borba Manana
Replicator: fix proxy feature after upgrading ibrowse to version 2.2.0 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1094420 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28Backport fix from revision 1086185Filipe David Borba Manana
Replicator: fix error when restarting replications in OTP R14B02 This is a workaround for a change introduced in OTP R14B02 to the supervisor module. There's an erlang-bugs thread about this issue: http://erlang.org/pipermail/erlang-bugs/2011-March/002273.html git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1086186 13f79535-47bb-0310-9956-ffa450edef68
2011-03-13Merged revision 1081106 from trunkFilipe David Borba Manana
Add replication ID version information to checkpoints Now that we have versioned replication IDs (introduced by COUCHDB-810), it's useful to know which version is being used in the replication checkpoints. This is mostly for debugging purposes. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1081107 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-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