In the old client, is was possible that with a persistent bucket with replicas enabled, when the master node went down, it would automatically send reads over to the replica node until the master came back up. I have noticed with the new client (both via experimentation and through the docs) that calls to the regular
get method will not do this kind of behavior. It seems that if I want this behavior that I would have to either:
getFromReplicawith the type set to
FIRSTand basically never read from the master (but not sure what happens if the first replica goes down instead)
ALLand take the first item in the list returned. This seems more fail safe in that if a node is down as long as both aren’t, you will still get data. But this seems rather inefficient to always be reading from two nodes.
Am I missing something here. Is there a better way to gracefully fail the reads over to a replica if the master is not available?