summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2017-06-05 18:16:45 -0400
committerJoan Touzet <wohali@users.noreply.github.com>2017-10-19 19:13:25 -0400
commit6bcc6d19164c4a82de906e9d876a613f8eb639da (patch)
tree99c07a39e006d6828f44958cc9b424a07a8ac05d
parentc57a7cec6312057c6fadd4133c8f75c445fccbde (diff)
downloadcouchdb-6bcc6d19164c4a82de906e9d876a613f8eb639da.tar.gz
Handle attachments downgrades in a mixed cluster environment
Previously attachment uploading from a PSE to non-PSE node would fail as the attachment streaming API changed between version. This commit handles downgrading attachment streams from PSE nodes so that non-PSE nodes can write them. COUCHDB-3288
-rw-r--r--src/couch/src/couch_att.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/couch/src/couch_att.erl b/src/couch/src/couch_att.erl
index 5c040a8c4..3380f5739 100644
--- a/src/couch/src/couch_att.erl
+++ b/src/couch/src/couch_att.erl
@@ -494,6 +494,9 @@ flush(Fd, Att) ->
flush_data(Fd, fetch(data, Att), Att).
+flush_data(Fd, {stream, {couch_bt_engine_stream, {OtherFd, StreamPointer}}},
+ Att) ->
+ flush_data(Fd, {OtherFd, StreamPointer}, Att);
flush_data(Fd, {Fd0, _}, Att) when Fd0 == Fd ->
% already written to our file, nothing to write
Att;