Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-45967 : Ensure creds cache entries are no more than 10 seconds old
Problem: With the addition of creds cache in eventing consumer, the following scenario can cause LCB_ERR_AUTHENTICATION_FAILURE: * 2 KV nodes: N1 N2 1 eventing node: N3 * creds cache on N3 has entries cached for N1 and N2 * N2 is rebalanced out followed by rebalance in all while no ops are hitting the src collection. Because of lack of ops lcb's event loop won't progress hence cache will still have entry for N2 with *old/stale* credentials. We now pass these stale creds for N2 to lcb for bootstrap which results in auth_error. Solution: As long as there is at least one eventing node in cluster, rebalance will take at least 13 seconds to completion. Hence as a safe value we fetch the creds from cbauth if cached creds entry is older than 10 seconds. Change-Id: I5a14318bc7fee651030983f1feb33b6dbf2c50eb Reviewed-on: http://review.couchbase.org/c/eventing/+/154046 Reviewed-by: <ankit.prabhu@couchbase.com> Reviewed-by: CI Bot Tested-by: <abhishek.jindal@couchbase.com>
- Loading branch information