Commit d0a794a
committed
fix(qwp): orphan drainer must not quarantine an all-replica window (Invariant B)
BackgroundDrainer.connectWithDurableAckRetry() lumped role rejects
(QwpRoleMismatchException / QwpIngressRoleRejectedException -- an
all-endpoints-replica failover window) together with a genuine durable-ack
capability gap and gave up on BOTH the 16-attempt cap and the
reconnect_max_duration_millis wall clock -> markFailed / .failed sentinel /
DrainOutcome.FAILED. A transient failover window thus quarantined an orphan
slot's un-drained SF data instead of waiting for a promotion.
Split the catch:
- QwpRoleMismatchException | QwpIngressRoleRejectedException (all endpoints are
replicas right now) -> TRANSIENT. Fire the per-attempt observability callback
and retry with capped exponential backoff indefinitely; never escalate, never
quarantine. Only stopRequested (or a primary reappearing, or SF exhaustion)
ends it. WARN throttled to 1/5s.
- QwpDurableAckMismatchException (a server upgraded but does not advertise
durable ack -- a real cluster-wide capability gap) -> stays terminal with the
bounded settle budget + attempt cap + .failed sentinel, as before.
Backoff now clamps to the remaining budget ONLY on the bounded capability-gap
path (so it still escalates promptly at the deadline); the transient failover
path backs off capped-exponential and never busy-loops past a deadline.
Turns green testAllReplicaWindowNeverEscalatesInvariantB while keeping
testEscalatesAfterMaxAttemptsAndDropsSentinel and
testWallTimeBudgetEscalatesBeforeAttemptCap valid. 48 drainer/pool tests pass.1 parent 0d65c3a commit d0a794a
1 file changed
Lines changed: 51 additions & 12 deletions
Lines changed: 51 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
166 | 176 | | |
167 | 177 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
177 | 209 | | |
178 | 210 | | |
179 | 211 | | |
| |||
198 | 230 | | |
199 | 231 | | |
200 | 232 | | |
| 233 | + | |
201 | 234 | | |
202 | 235 | | |
203 | 236 | | |
| |||
218 | 251 | | |
219 | 252 | | |
220 | 253 | | |
221 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
222 | 258 | | |
223 | | - | |
224 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
225 | 264 | | |
226 | 265 | | |
227 | 266 | | |
| |||
0 commit comments