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

Filipe Manana commented on COUCHDB-1289:
----------------------------------------

Bob, looks good.

I was testing this against a very large database 
(http://fdmanana.iriscouch.com/many_docs) by querying _changes without an 
heartbeat parameter and with a filter that returned false for the first half of 
the changes of the db.
It turns out that about 1 minute after the feed terminated without folding the 
entire seq tree (last_seq in the response was not the current db's seq number).

So what happens is that when no heartbeat is given, a default TimeoutFun which 
returns {stop, Acc} (always) is used:

https://github.com/fdmanana/couchdb/blob/c574d29bb92f2b61688b52e2e03548b05cc4a163/src/couchdb/couch_changes.erl#L239

So we have 2 distinct concepts in the changes feed: heartbeat and timeout.
I think renaming "maybe_timeout" to "maybe_heartbeat" makes it more clear, and 
call the function only if no heartbeat was specified. I made quick code change 
to test this:

https://github.com/fdmanana/couchdb/commit/c574d29bb92f2b61688b52e2e03548b05cc4a163

Makes sense?

thanks :)
                
> heartbeats skipped when continuous changes feed filter function produces no 
> results
> -----------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1289
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1289
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>            Reporter: Bob Dionne
>            Assignee: Bob Dionne
>            Priority: Minor
>         Attachments: 0001-Ensure-heartbeats-are-not-skipped.patch, 
> 0002-Failing-etap-for-heartbeats-skipped.patch
>
>
> if the changes feed has a filter function that produces no results, 
> db_updated messages will still be sent and the heartbeat timeout will never 
> be reached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to