Commit b870f1d
committed
client routes: disable fallback to broadcast address when route is missing
When client routes are configured, the driver must connect exclusively
through proxies (addresses from system.client_routes). The previous
behavior silently fell back to the node's direct broadcast address when
no route entry existed for a host_id, which caused races and silent
misbehaviour upon adding new nodes (time window between node addition
and client route entry publication).
Now ClientRoutesEndPoint.resolve() throws IllegalStateException when
no route is found, causing the node to go DOWN and enter the standard
reconnection loop until a CLIENT_ROUTES_CHANGE event populates the
route. This matches the Rust driver's approach of failing address
translation on missing entries.
Changes:
- ClientRoutesEndPoint: remove fallbackEndPoint field; resolve() throws
with WARN log instead of falling back to broadcast address
- ClientRoutesTopologyMonitor.buildNodeEndPoint(): remove fallback
computation; throw on null host_id instead of delegating to super
- Tests updated to verify exception-throwing behavior1 parent fc725a0 commit b870f1d
4 files changed
Lines changed: 60 additions & 66 deletions
File tree
- core/src
- main/java/com/datastax/oss/driver/internal/core/metadata
- test/java/com/datastax/oss/driver/internal/core/metadata
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | | - | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
56 | | - | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| |||
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
76 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | 89 | | |
| |||
core/src/main/java/com/datastax/oss/driver/internal/core/metadata/ClientRoutesTopologyMonitor.java
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
| 465 | + | |
465 | 466 | | |
466 | 467 | | |
467 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
468 | 472 | | |
469 | | - | |
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
| |||
477 | 480 | | |
478 | 481 | | |
479 | 482 | | |
480 | | - | |
| 483 | + | |
481 | 484 | | |
482 | 485 | | |
483 | 486 | | |
| |||
Lines changed: 19 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
50 | | - | |
| 47 | + | |
51 | 48 | | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
56 | | - | |
| 53 | + | |
57 | 54 | | |
58 | | - | |
59 | 55 | | |
60 | | - | |
61 | 56 | | |
62 | | - | |
63 | | - | |
| 57 | + | |
64 | 58 | | |
65 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
73 | | - | |
74 | | - | |
| 71 | + | |
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
| |||
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
88 | | - | |
89 | | - | |
| 85 | + | |
90 | 86 | | |
91 | 87 | | |
92 | 88 | | |
| |||
101 | 97 | | |
102 | 98 | | |
103 | 99 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 100 | + | |
| 101 | + | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
113 | 107 | | |
114 | 108 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 109 | + | |
| 110 | + | |
119 | 111 | | |
120 | 112 | | |
121 | 113 | | |
122 | 114 | | |
123 | 115 | | |
124 | 116 | | |
125 | 117 | | |
126 | | - | |
127 | | - | |
| 118 | + | |
128 | 119 | | |
129 | 120 | | |
130 | 121 | | |
| |||
135 | 126 | | |
136 | 127 | | |
137 | 128 | | |
138 | | - | |
139 | | - | |
| 129 | + | |
140 | 130 | | |
141 | 131 | | |
142 | 132 | | |
| |||
145 | 135 | | |
146 | 136 | | |
147 | 137 | | |
148 | | - | |
149 | | - | |
| 138 | + | |
150 | 139 | | |
151 | 140 | | |
152 | 141 | | |
| |||
156 | 145 | | |
157 | 146 | | |
158 | 147 | | |
159 | | - | |
160 | | - | |
| 148 | + | |
161 | 149 | | |
162 | 150 | | |
163 | 151 | | |
| |||
168 | 156 | | |
169 | 157 | | |
170 | 158 | | |
171 | | - | |
172 | | - | |
| 159 | + | |
173 | 160 | | |
174 | 161 | | |
175 | 162 | | |
| |||
Lines changed: 15 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
1041 | 1040 | | |
1042 | 1041 | | |
1043 | 1042 | | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1047 | 1046 | | |
1048 | 1047 | | |
1049 | | - | |
1050 | 1048 | | |
1051 | 1049 | | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1057 | 1053 | | |
1058 | 1054 | | |
1059 | 1055 | | |
| |||
1065 | 1061 | | |
1066 | 1062 | | |
1067 | 1063 | | |
1068 | | - | |
1069 | 1064 | | |
1070 | 1065 | | |
1071 | 1066 | | |
| |||
1138 | 1133 | | |
1139 | 1134 | | |
1140 | 1135 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1144 | 1140 | | |
1145 | | - | |
1146 | 1141 | | |
1147 | 1142 | | |
1148 | | - | |
1149 | 1143 | | |
1150 | | - | |
1151 | 1144 | | |
1152 | 1145 | | |
1153 | 1146 | | |
1154 | 1147 | | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
1159 | 1153 | | |
1160 | 1154 | | |
1161 | 1155 | | |
| |||
0 commit comments