Currently follow is just throwing an error here under the false assumption that the database has been deleted. This change always retries the changes request if it's terminated by the server. Only when the following retry attempt returns a 404 do we mark the database as deleted and stop the feed.
CouchDB terminates the changes feed, sending a
last_seq
, if the node serving your request is placed in maintenance mode (see https://github.com/apache/couchdb-fabric/blob/master/src/fabric_view_changes.erl#L94). The expectation here is that the client will retry the request using thelast_seq
provided in the response.Currently follow is just throwing an error here under the false assumption that the database has been deleted. This change always retries the changes request if it's terminated by the server. Only when the following retry attempt returns a 404 do we mark the database as deleted and stop the feed.