[jira] [Commented] (COUCHDB-1893) Allow replication filters to meaningfully apply to deleted documents

2017-03-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932009#comment-15932009
 ] 

ASF GitHub Bot commented on COUCHDB-1893:
-

Github user wohali closed the pull request at:

https://github.com/apache/couchdb/pull/92


> Allow replication filters to meaningfully apply to deleted documents
> 
>
> Key: COUCHDB-1893
> URL: https://issues.apache.org/jira/browse/COUCHDB-1893
> Project: CouchDB
>  Issue Type: Improvement
>  Components: JavaScript View Server
>Reporter: Stéphane Alnet
>
> A document that is deleted using the DELETE command will be presented to a 
> replication filter as an empty record with only a `_deleted:true` field. A 
> replication filter can then only use the document ID to decide whether or not 
> to propagate the deletion; in most cases this is not sufficient, and one may 
> have to pass along deletion documents for IDs that would not have been 
> replicated by the filter.
> This might lead to document IDs being leaked to the target database, which 
> might be undesirable; more importantly if the goal of filtering was to build 
> a smaller subset of the source database (for example to replicate a very 
> large database to a device that has smaller storage space), those deletion 
> documents might overfill the database (they never get compacted).
> I had somewhat documented this issue on the Wiki 
> (http://wiki.apache.org/couchdb/Replication#Filtered_Replication) a while 
> back but never got to add it to JIRA.
> Dave Cottlehuber on the PouchDB list suggested to use PUT with a 
> `_deleted:true` field to work around the problem (the PUT body can then 
> contain data sufficient to enable the filter to work). However we're still 
> stuck in case DELETE was used instead.
> My suggestion is to expand the replication filter API to add an optional 
> third argument
> filter(doc,req,old_doc)
> where old_doc if present references the version of the document that will get 
> deleted. It is then up to the filter to use the _deleted flag in `doc` and 
> the values in `old_doc`.
> (It might be useful/meaningful/easier to add old_doc in all cases; at this 
> point I'm only suggesting to add it in the case doc contains a _deleted 
> field.)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (COUCHDB-1893) Allow replication filters to meaningfully apply to deleted documents

2017-03-19 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932008#comment-15932008
 ] 

ASF subversion and git services commented on COUCHDB-1893:
--

Commit 67139cc96d4bffdd10d3e2cab02a86e569b220a2 in couchdb-documentation's 
branch refs/heads/master from [~wohali]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-documentation.git;h=67139cc 
]

Document deletion approach when using filtered replication

Addresses PR #92 and COUCHDB-1893.


> Allow replication filters to meaningfully apply to deleted documents
> 
>
> Key: COUCHDB-1893
> URL: https://issues.apache.org/jira/browse/COUCHDB-1893
> Project: CouchDB
>  Issue Type: Improvement
>  Components: JavaScript View Server
>Reporter: Stéphane Alnet
>
> A document that is deleted using the DELETE command will be presented to a 
> replication filter as an empty record with only a `_deleted:true` field. A 
> replication filter can then only use the document ID to decide whether or not 
> to propagate the deletion; in most cases this is not sufficient, and one may 
> have to pass along deletion documents for IDs that would not have been 
> replicated by the filter.
> This might lead to document IDs being leaked to the target database, which 
> might be undesirable; more importantly if the goal of filtering was to build 
> a smaller subset of the source database (for example to replicate a very 
> large database to a device that has smaller storage space), those deletion 
> documents might overfill the database (they never get compacted).
> I had somewhat documented this issue on the Wiki 
> (http://wiki.apache.org/couchdb/Replication#Filtered_Replication) a while 
> back but never got to add it to JIRA.
> Dave Cottlehuber on the PouchDB list suggested to use PUT with a 
> `_deleted:true` field to work around the problem (the PUT body can then 
> contain data sufficient to enable the filter to work). However we're still 
> stuck in case DELETE was used instead.
> My suggestion is to expand the replication filter API to add an optional 
> third argument
> filter(doc,req,old_doc)
> where old_doc if present references the version of the document that will get 
> deleted. It is then up to the filter to use the _deleted flag in `doc` and 
> the values in `old_doc`.
> (It might be useful/meaningful/easier to add old_doc in all cases; at this 
> point I'm only suggesting to add it in the case doc contains a _deleted 
> field.)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)