6yfuXjy6LBUWZXcs10aV3y changeset

Changeset646664313236 (b)
ParentNone (a)
ab
0+diff --git a/src/couchdb/couch_replicator.erl b/src/couchdb/couch_replicator.erl
0+index 315cec4..663ce27 100644
0+--- a/src/couchdb/couch_replicator.erl
0++++ b/src/couchdb/couch_replicator.erl
0+@@ -597,8 +597,18 @@ spawn_changes_reader(StartSeq, Db, ChangesQueue, Options) ->
0+ read_changes(StartSeq, Db, ChangesQueue, Options) ->
0+     try
0+         couch_api_wrap:changes_since(Db, all_docs, StartSeq,
0+-            fun(#doc_info{high_seq = Seq} = DocInfo) ->
0+-                ok = couch_work_queue:queue(ChangesQueue, DocInfo),
0++            fun(#doc_info{high_seq = Seq, id = Id} = DocInfo) ->
0++                case Id of
0++                <<>> ->
0++                    % Previous CouchDB releases had a bug which allowed a doc
0++                    % with an empty ID to be inserted into databases. Such doc
0++                    % is impossible to GET.
0++                    ?LOG_ERROR("Replicator: ignoring document with empty ID in "
0++                        "source database `~s` (_changes sequence ~p)",
0++                        [couch_api_wrap:db_uri(Db), Seq]);
0++                _ ->
0++                    ok = couch_work_queue:queue(ChangesQueue, DocInfo)
0++                end,
0+                 put(last_seq, Seq)
0+             end, Options),
0+         couch_work_queue:close(ChangesQueue)
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- Revision None
+++ Revision 646664313236
@@ -0,0 +1,25 @@
+diff --git a/src/couchdb/couch_replicator.erl b/src/couchdb/couch_replicator.erl
+index 315cec4..663ce27 100644
+--- a/src/couchdb/couch_replicator.erl
++++ b/src/couchdb/couch_replicator.erl
+@@ -597,8 +597,18 @@ spawn_changes_reader(StartSeq, Db, ChangesQueue, Options) ->
+ read_changes(StartSeq, Db, ChangesQueue, Options) ->
+ try
+ couch_api_wrap:changes_since(Db, all_docs, StartSeq,
+- fun(#doc_info{high_seq = Seq} = DocInfo) ->
+- ok = couch_work_queue:queue(ChangesQueue, DocInfo),
++ fun(#doc_info{high_seq = Seq, id = Id} = DocInfo) ->
++ case Id of
++ <<>> ->
++ % Previous CouchDB releases had a bug which allowed a doc
++ % with an empty ID to be inserted into databases. Such doc
++ % is impossible to GET.
++ ?LOG_ERROR("Replicator: ignoring document with empty ID in "
++ "source database `~s` (_changes sequence ~p)",
++ [couch_api_wrap:db_uri(Db), Seq]);
++ _ ->
++ ok = couch_work_queue:queue(ChangesQueue, DocInfo)
++ end,
+ put(last_seq, Seq)
+ end, Options),
+ couch_work_queue:close(ChangesQueue)