Skip to content


Subversion checkout URL

You can clone with
Download ZIP


12741 replication seq format #76

merged 1 commit into from

3 participants



JSON encode the new seq format


I'm worried about how this will work with plain old integer sequences. Adding quotes around the integers seems like it could screw with CouchDB <=> BigCouch replication.

using couchdb master I've tried replications in both directions, initiating the replication from both bigcouch and couchdb. So far so good


fyi: the iolist_to_binary doesn't appear to be necessary. I replicated fine without it. What's the reason for it?

it probably is belt and suspenders, and an artifact from trying to fix it in full_url, which would be preferable as there are a few other paths thru that code. There's a couple of bugs also in _replicator db so we can revisit it when we fix those.


As I mentioned on IRC, I'm satisfied that this is safe and the right thing to do. couch_rep_httpc:full_uri/1 calls to_list/1 on the query-string values, so our conversion from integer to binary string won't cause any problems there. Let's merge to master and 0.4.x.

@kocolosk kocolosk merged commit df394dd into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 17, 2011
  1. Fix seq problem in full_uri by encoding

    Bob Dionne authored
This page is out of date. Refresh to see the latest.
2  apps/couch/src/couch_rep.erl
@@ -834,7 +834,7 @@ ensure_full_commit(#http_db{headers = Headers} = Source, RequiredSeq) ->
Req = Source#http_db{
resource = "_ensure_full_commit",
method = post,
- qs = [{seq, RequiredSeq}],
+ qs = [{seq, iolist_to_binary(?JSON_ENCODE(RequiredSeq))}],
headers = Headers1
{ResultProps} = couch_rep_httpc:request(Req),
2  apps/couch/src/couch_rep_changes_feed.erl
@@ -64,7 +64,7 @@ init([Parent, #http_db{headers = Headers0} = Source, Since, PostProps]) ->
BaseQS = [
{"style", all_docs},
{"heartbeat", 10000},
- {"since", Since},
+ {"since", iolist_to_binary(?JSON_ENCODE(Since))},
{"feed", Feed}
{QS, Method, Body, Headers} = case get_value(<<"doc_ids">>, PostProps) of
Something went wrong with that request. Please try again.