Couchbase get from replica -


i use couchbase 4.0.1 java sdk.

this code:

bucket.async()             .get(key)             .onerrorresumenext(throwable -> {                 if (throwable instanceof timeoutexception) {                     return getbucket().async().getfromreplica(key, replicamode.all);                 }                 return observable.error(throwable);             })             .map(doc -> doc.content())             .toblocking()             .singleordefault(null); 

if timeoutexception - go replica, last week, due sever issue, got outofmemory exception 1 of our servers. ofcourse did not document replica , suffered exceptions of our own.

i'd know if should go replica in any exception or not?

thanks,

ido

always going replica not going classes of errors, documentdoesnotexistexception of course.

for others might indicate cluster-wide issue, couchbaseoutofmemoryexception, going replica option but put more pressure on cluster , make problem worse.

it might better off, wait little , retry.


Comments