Reconnection index transfer

I need to know if a node is already synchronized. as I can know?

I was watching this API call that the result is unexpected.

API call: http://x.x.x.x:8443/rest/db/status=shared.

I have 3 nodes, 1 master, 2 slaves.



Slave 1:


Slave 2:


how I can know if a node is synchronized in consultation API?


In sync only has meaning while you are connected. If you are disconnected from everyone you don’t know their state, hence nothing to compare against - hence in sync. When you are connected to somone, needBytes says how many bytes are still needed to catch up with the newest state. If 0, you are in sync. Also, these values are periodically recalculated, rather than when the call is made, so might be a bit stale.

You know why the number of version is different in all nodes?

The local version number is local, i.e. generated by each side on the fly. There’s nothing to say they should be the same.

You can know that a device is in sync by looking at the needBytes, needFiles etc fields. If those are zero, you are in sync.

you know if needBytes is update in reconnection before to transfer index?

needBytes gets updated once we receive an index from a remote device, but can br delayed by 2 seconds.