summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep.erl
AgeCommit message (Collapse)Author
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
2009-08-25use _ensure_full_commit?seq=N in replication for efficiencyAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@807461 13f79535-47bb-0310-9956-ffa450edef68
2009-08-24only save a checkpoint at the end if something changedAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@807360 13f79535-47bb-0310-9956-ffa450edef68
2009-08-24checkpoint at most once per 5 secondsAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@807320 13f79535-47bb-0310-9956-ffa450edef68
2009-08-24skip full_commit during replication when its safeAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@807208 13f79535-47bb-0310-9956-ffa450edef68
2009-08-19continuous replication request returns 202 Accepted and the _local docidAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@805643 13f79535-47bb-0310-9956-ffa450edef68
2009-08-15better failure modes in replication. See COUCHDB-193, COUCHDB-416Adam Kocoloski
If you try to replicate a DB to itself, the replication will proceed, but no checkpoints will be saved, and the logs will say "checkpoint failure: conflict (are you replicating to yourself?)" If you try to specify a non-existent DB as source or target, replication will fail immediately with a 404. The response body will indicate which DB could not be opened. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@804436 13f79535-47bb-0310-9956-ffa450edef68
2009-08-10new replicator using _changes feed for continuous replicationAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@802888 13f79535-47bb-0310-9956-ffa450edef68
2009-08-07ibrowse wrapper for replicator, will replace do_http_requestAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@802145 13f79535-47bb-0310-9956-ffa450edef68
2009-08-04Initial check-in of OAuth and cookie authentication.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@800938 13f79535-47bb-0310-9956-ffa450edef68
2009-08-04encode slashes in db names in Location response header after database ↵Jan Lehnardt
creation, move couch_rep:url_encode/1 to couch_util:url_encode/1, closes COUCHDB-411 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@800883 13f79535-47bb-0310-9956-ffa450edef68
2009-07-17Deterministic revids, MD5 checking of documents, added tracking of rev when ↵Damien F. Katz
an attachment is edited to allow attachment level replication. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@795232 13f79535-47bb-0310-9956-ffa450edef68
2009-07-14wheeeeeeeeNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@794057 13f79535-47bb-0310-9956-ffa450edef68
2009-07-06trimmed trailing whitespaceNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791350 13f79535-47bb-0310-9956-ffa450edef68
2009-06-05checkpoint during abnormal terminate is not safeAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@782038 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29make sure process is still alive before calculating memory footprintAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@779846 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29the atom doesn't necessarily existAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@779842 13f79535-47bb-0310-9956-ffa450edef68
2009-05-18first crack at binary backoff for failed replicator requestsAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@776031 13f79535-47bb-0310-9956-ffa450edef68
2009-05-17guard memory_footprint() list with is_pid()Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775720 13f79535-47bb-0310-9956-ffa450edef68
2009-05-17one more hanging receive loop fixAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775715 13f79535-47bb-0310-9956-ffa450edef68
2009-05-17replicator should never hang when attachment receiver diesAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775685 13f79535-47bb-0310-9956-ffa450edef68
2009-05-17cleaner, more informative replicator log messagesAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775680 13f79535-47bb-0310-9956-ffa450edef68
2009-05-16replicator memory management and buffer flush calculation updatesAdam Kocoloski
* new should_flush fun considers ndocs, nattachments, memory in making decision * memory utilized by attachment receivers is accounted for * download attachments using standalone connections instead of conn pool. This prevents a document request from getting stuck behind a huge attachment, which would prevent us from triggering a buffer flush in time. We also consider the memory utilization of the standalone ibrowse connection in should_flush git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775507 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06Removing leftover io:format call from debugging.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@772415 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06First cut at _changes api. Update the by_id and by_seq indexes to contain ↵Damien F. Katz
update seq numbers and pointers to bodies on disk, for use in the _changes api. This is a new file version, but the code can continue to serve the old 0.9 version without problems, though certain features in the _changes api will not be able to work. Upgrade to new file version (from 1 to 2) by compacting the file. Also fixed bugs with how the stats api tracks open databases. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@772406 13f79535-47bb-0310-9956-ffa450edef68
2009-05-04use revisions when replicating attachments. Closes COUCHDB-337Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@771480 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15URL-encode attachment paths during replicationAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@765364 13f79535-47bb-0310-9956-ffa450edef68
2009-03-31unify including of couch_db.hrlJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@760533 13f79535-47bb-0310-9956-ffa450edef68
2009-03-16Adding the necessary done=true to the last race condition fix in the ↵Damien F. Katz
replicator. Thanks Adam. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@755016 13f79535-47bb-0310-9956-ffa450edef68
2009-03-16Fix for occasional replication failure where replication would complete ↵Damien F. Katz
before before the caller had a chance to request the results. No tests, but this should fix this error that already occurs occasionally: {"error":"normal","reason":"{gen_server,call,[<0.228.0>,get_result,infinity]}"} git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@755009 13f79535-47bb-0310-9956-ffa450edef68
2009-03-15Streaming attachment replication now follows redirects and checks for error ↵John Christopher Anderson
codes. Includes tests that design doc attachments are replicated. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@754704 13f79535-47bb-0310-9956-ffa450edef68
2009-03-13Commit Damien's rep_security branch to trunk. John Christopher Anderson
Changes bulk_docs conflict checking. Breaks file format, see mailing list for data upgrade procedure, or http://wiki.apache.org/couchdb/Breaking_changes git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@753448 13f79535-47bb-0310-9956-ffa450edef68
2009-03-08beefier fault tolerance in the replicatorAdam Kocoloski
- trap exits (enumerator and attachment streamers are linked) - retry by respawning enumerator with last known good source seq - checkpoint replication record on every flush of document buffer - reformat nicer error messages to listeners if we need to exit git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@751491 13f79535-47bb-0310-9956-ffa450edef68
2009-03-07rewrite replicator using OTP behavioursAdam Kocoloski
- only one instance of given source->target runs at a time - supervisor restarts replications that terminate abnormally - pull repl. streams attachments directly to disk - improved memory utilization - temporarily rollback parallel async doc GETs during pull rep. - replication updates show up in Futon Status window git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@751305 13f79535-47bb-0310-9956-ffa450edef68