Commit ece7817
Skip a segment whose mmap fault arrives late
SegmentRing's per-file arm caught only MmapSegmentException, so an
unbacked or sparse mapped page in one .sfa could abort recovery of the
whole slot and strand every frame the sibling segments still held.
MmapSegment installs handlers around its own recovery reads, but they
cannot be relied on before JDK 21: HotSpot records an unsafe-access
fault and raises the InternalError at the next return or safepoint
check rather than at the faulting read, so it surfaces in an arbitrary
caller frame. JDK-8283699 made delivery precise only in 21+. Observed
on 8 and 17 landing two frames above SegmentRing.openExisting, past
every handler MmapSegment installs -- which is what left the two
map-past-EOF guards in MmapSegmentRecoveryFaultTest erroring on the
JDK 8 job while passing on 25.
Convert at the per-file boundary instead, the frame the late delivery
lands in. The arm widens to Throwable but rethrows anything that is
neither MmapSegmentException nor the recognized mmap access fault, so
resource exhaustion and programmer errors still propagate to the outer
catch as before. isMmapAccessFault becomes package-private for that
caller and carries the delivery caveat in its javadoc.
Add a facade-aware SegmentRing.openExisting overload, mirroring the
seam MmapSegment already exposes, and two tests that inject the fault
through it deterministically on any JDK: one asserting the faulting
segment is skipped while its sibling's frames survive, one asserting an
unrecognized InternalError still propagates so the widened catch cannot
degrade into skip-on-anything. The two pre-existing map-past-EOF tests
now drive SegmentRing -- the boundary their own javadocs describe --
keeping the strong assertion where delivery is precise and degrading on
pre-21 to what the JVM still makes checkable: the process survived and
the escaping error is the recognized fault.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 47b3c9e commit ece7817
3 files changed
Lines changed: 250 additions & 32 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass/qwp/client/sf/cursor
- test/java/io/questdb/client/test/cutlass/qwp/client/sf/cursor
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
652 | 667 | | |
653 | | - | |
| 668 | + | |
654 | 669 | | |
655 | 670 | | |
656 | 671 | | |
| |||
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
171 | 187 | | |
172 | 188 | | |
173 | 189 | | |
| |||
197 | 213 | | |
198 | 214 | | |
199 | 215 | | |
200 | | - | |
| 216 | + | |
201 | 217 | | |
202 | 218 | | |
203 | 219 | | |
| |||
231 | 247 | | |
232 | 248 | | |
233 | 249 | | |
234 | | - | |
| 250 | + | |
235 | 251 | | |
236 | 252 | | |
237 | 253 | | |
| |||
243 | 259 | | |
244 | 260 | | |
245 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
246 | 280 | | |
247 | 281 | | |
248 | 282 | | |
| |||
0 commit comments