cloudant / CDTDatastore

Cloudant Sync iOS datastore library.
Apache License 2.0
175 stars 53 forks source link

[WIP] Added handling for server side missing revs #458

Closed ricellis closed 2 years ago

ricellis commented 5 years ago

Checklist

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

Security and Privacy

Testing

TODO

Monitoring and Logging

ricellis commented 2 years ago

This library is now end-of-life.