Permalink
Browse files

Fix seq problem in full_uri by encoding

BugzID:12741
  • Loading branch information...
Bob Dionne
Bob Dionne committed Oct 17, 2011
1 parent cf630a2 commit 9c1d6798e56d95a9ec6ad36c7baf7c3d23ce5eff
Showing with 2 additions and 2 deletions.
  1. +1 −1 apps/couch/src/couch_rep.erl
  2. +1 −1 apps/couch/src/couch_rep_changes_feed.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),
@@ -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

4 comments on commit 9c1d679

@kocolosk

This comment has been minimized.

Show comment Hide comment
@kocolosk

kocolosk Oct 17, 2011

Owner

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.

Owner

kocolosk replied Oct 17, 2011

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.

@bdionne

This comment has been minimized.

Show comment Hide comment
@bdionne

bdionne Oct 17, 2011

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

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

@rnewson

This comment has been minimized.

Show comment Hide comment
@rnewson

rnewson Oct 18, 2011

Owner

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

Owner

rnewson replied Oct 18, 2011

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

@bdionne

This comment has been minimized.

Show comment Hide comment
@bdionne

bdionne Oct 19, 2011

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.

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.

Please sign in to comment.