[ ] Added tests for code changes or test/build only changes
[ ] Updated the change log file (CHANGES.md|CHANGELOG.md) or test/build only changes
[x] Completed the PR template below:
Description
If server side compaction removes revs between the iOS client fetching the changes feed and fetching the changes there are potential 404 not found conditions.
See #454
Approach
Since the 404 alone does not provide enough information to determine if it is transient (i.e. the document is yet to be consistent across all nodes) or permanent (i.e. the rev has been permanently removed) then we must assume the transient case in the first instance.
To deal with this any rev that gets a 404 from the bulk cases will be requeued for individual fetching. If the document is subsequently not found when an individual fetch attempt is made then it is considered a permanent failure.
This is approximately inline with the behaviour of the CouchDB replicator which performs a single retry after a configurable delay.
This change will not solve the problem for cases where only an individual fetch attempt is made, but all Couch 2.x support the _bulk_get endpoint and Couch 1.x is EOL so this fix should be suitable.
Schema & API Changes
No API changes
Security and Privacy
No change
Testing
TODO
Monitoring and Logging
Added new log line to warn of permanent failures fetching a revision.
Checklist
CHANGES.md
|CHANGELOG.md
) or test/build only changesDescription
If server side compaction removes revs between the iOS client fetching the changes feed and fetching the changes there are potential
404 not found
conditions.See #454
Approach
Since the
404
alone does not provide enough information to determine if it is transient (i.e. the document is yet to be consistent across all nodes) or permanent (i.e. the rev has been permanently removed) then we must assume the transient case in the first instance.To deal with this any rev that gets a 404 from the bulk cases will be requeued for individual fetching. If the document is subsequently not found when an individual fetch attempt is made then it is considered a permanent failure.
This is approximately inline with the behaviour of the CouchDB replicator which performs a single retry after a configurable delay.
This change will not solve the problem for cases where only an individual fetch attempt is made, but all Couch 2.x support the
_bulk_get
endpoint and Couch 1.x is EOL so this fix should be suitable.Schema & API Changes
Security and Privacy
Testing
TODO
Monitoring and Logging