summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep.erl
AgeCommit message (Collapse)Author
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
2009-02-13fix COUCHDB-253. Replicator should not use chunked transfer-encoding on GET ↵John Christopher Anderson
requests. thanks Adam Kocoloski git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@744193 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12Fix for spurious 'server restarted' during replicationDamien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@743801 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29Replacement of inets with ibrowse. Fixes COUCHDB-179 and enhances replication.John Christopher Anderson
Thanks Jason Davies and Adam Kocoloski for the fix, Maximillian Dornseif for reporting. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@739047 13f79535-47bb-0310-9956-ffa450edef68
2009-01-09Added support so clients can detect if a server has potentially lost commits ↵Damien F. Katz
after multiple updates, like during bulk imports and so the replicator can detect lost commits on remote replications. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@733174 13f79535-47bb-0310-9956-ffa450edef68
2009-01-04change count to limit in view query paramsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@731159 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16fix COUCHDB-174 thanks Adam KocoloskiJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@727182 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16Adam Kocoloski replication performance improvements (closes COUCHDB-160)John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@727171 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20Nearly completed security/validation work. Still needs replication testing.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@719160 13f79535-47bb-0310-9956-ffa450edef68
2008-11-17More security and validation work. Still incomplete.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@718311 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11Check in of initial validation and authorization work. This work is ↵Damien F. Katz
incomplete, as there is not yet any way of restricting who can update the design docs. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@713132 13f79535-47bb-0310-9956-ffa450edef68
2008-11-09apply replication fixing patches from COUCHDB-157John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@712578 13f79535-47bb-0310-9956-ffa450edef68
2008-09-23fix for COUCHDB-119 - replication is incremental between local and remote ↵John Christopher Anderson
databases git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@698333 13f79535-47bb-0310-9956-ffa450edef68