One-shot Replication - Mobile Native API - shortages

46 views
Skip to first unread message

Arash Ashrafi

unread,
Aug 8, 2014, 9:17:16 AM8/8/14
to mobile-c...@googlegroups.com

A one-shot replication, very often, needs to be FOLLOWED by some other action WHEN finished.

In order to be able to do that, a reliable mechanism is required to say that:
1. it is stopped
2. how has it stopped (successful, interrupted, neverStarted etc.)

At the moment, by observing replication change notifications, the following cases are not easy to handle:
1. If you start the replication with no network connection, it sends only one notification with "Offline" status and gets stuck (never goes to "Stopped")
2. If network connection get's lost in the middle of replication, it keeps sending "Offline" replication notifications, strangely with "completed changes count" being increased and going above "changes count".
3. If network connection get's lost in the middle of replication, it stops at some point, but there is no control over how long it should wait till it gives up trying.

Suggestions:
a) Improving the one-shot replication mechanism to guaranty that it always stops at some point (goes to "Stop" status)
b) Providing some API for one-shot replications to provide a time-out setting (so that if it can not progress for any reason, it goes to "Stop" status after that time)
c) Having a final replication status property, to access after replication has stopped, in order to find out the out come of the replication.



Traun Leyden

unread,
Aug 8, 2014, 9:42:38 AM8/8/14
to mobile-c...@googlegroups.com

Are you seeing this behavior on Android, iOS, or both?
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/e5939f70-31e3-459a-8f2f-bff381fd08df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arash Ashrafi

unread,
Aug 8, 2014, 9:47:43 AM8/8/14
to mobile-c...@googlegroups.com
on iOS.

Jens Alfke

unread,
Aug 8, 2014, 11:36:16 AM8/8/14
to mobile-c...@googlegroups.com
On Aug 8, 2014, at 6:17 AM, Arash Ashrafi <arashe...@gmail.com> wrote:

a) Improving the one-shot replication mechanism to guaranty that it always stops at some point (goes to "Stop" status)
b) Providing some API for one-shot replications to provide a time-out setting (so that if it can not progress for any reason, it goes to "Stop" status after that time)
c) Having a final replication status property, to access after replication has stopped, in order to find out the out come of the replication.

These sound like things you can implement yourself, if you need them. For instance your client can keep its own timer and stop the replication if it doesn't go online within that time interval. Are there any features you need that you're finding impossible to implement?

—Jens

Arash Ashrafi

unread,
Aug 8, 2014, 12:05:42 PM8/8/14
to mobile-c...@googlegroups.com
I have implemented the timer already. Those were just suggestions for improvement.

Apart from the time-out,  when replication goes to "Stopped", there is not a clean way to say HOW the replication ended. Did it finish the job and stopped? Did it get interrupted? Did it get stuck for some reason? Did it manage to connect to remote server at all?

And, when the replication is stopped with its "stop" method, I believe it makes sense to send a notification with status: "Stopped". It doesn't at the moment.

Anyway, as you said, non of these are things impossible to implement by ourselves. For example, we can use lastError property to some extent for that.
Reply all
Reply to author
Forward
0 new messages