nickva opened a new pull request, #6165:
URL: https://github.com/apache/couchdb/pull/6165
With a selective filter a client may go a long while without getting a
matching row with a sequence. Without getting a sequence a client cannot
checkpoint. If the feed crashes or times out, a client may have to rewind all
the way to the last received row. The worst case of this is when due to
timeouts it becomes impossible to make any progress at all.
To fix this, implement heartbeats as json object which have a sequence
field. With the new `heartbeat_seq=true` parameter continuous, normal and
longpoll feeds will send `{"seq": ..., "id": null, "changes": []}` heartbeat
objects as a separate line or an element of `results` array. With `eventsource`
feeds the heartbeat event gets an `id` field set to the sequence, so browsers
can resume from it with `Last-Event-ID`.
The seq heartbeat object is sent at most once per heartbeat interval if the
sequence changed since the last one sent. A heartbeat value now also sets the
keepalive period of a normal feed while it is being read.
To make the new feature work the coordinator timeout callback now takes a
sequence parameter (`{timeout, Seq}`) so that required updating other change
feed users (chttpd_auth_cache, global_changes, fabric_bench, etc). But this
shouldn't affect inter-node compatibility as we haven't changed the
`#changes_args{}` record passed to workers.
Note: this just adds the new option to the _changes endpoint. There will be
a separate PR to enchance the replicator to use this feature to checkpoint
replication jobs.
Fixes #6120
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]