Commit 5d3d82f
NCBC-4128: Clear dead nodes after select bucket failure
Motivation
----------
When attempting to reuses a globally bootstrapped node and select a
bucket so it becomes a bucket-specific node, if the select bucket call
fails the node may have all connections dead. Because the select bucket
call goes through a special path to all connections in the pool, it can
then continue to fail because the dead connection is still there and
will fail on the next attempt.
Modifications
-------------
- Don't attempt to select bucket on dead connections in the connection
pool
- Throw an error if there are no healthy connections in the pool when
select bucket is attempted
- On a general exception calling select bucket, discard the node so the
next attempt will use a fresh connection pool
Results
-------
Greater resiliency in cases where the cluster isn't fully accessible
during bootstrap and the first call to BucketAsync fails. This prevents
the Cluster from being in a bad state until the application is recycled.
Change-Id: I2db1e2f6653ef604f6d3e03405e99a1264ae486d
Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/239143
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>1 parent f8fb0d7 commit 5d3d82f
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
629 | 628 | | |
630 | 629 | | |
631 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
632 | 644 | | |
633 | 645 | | |
634 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
139 | 147 | | |
140 | 148 | | |
141 | 149 | | |
| |||
0 commit comments