Repository navigation
Commit 5eaffdd
test: let the migration settle H2's key type before the readers compare
The concurrent legacy-index test failed on all three Java 17 builds with
UnsupportedOperationException: Can not compare, from inside H2. That is
not the race #1309 fixed. H2's ObjectDataType settles its key type on
first use through an unsynchronized field and identity checks in
SerializedObjectType.compare, so sixteen threads making a fresh map's
first key comparison at once can each see a different type instance.
The code is identical in h2 2.4.240 and 2.5.250; 2.5.250 only made it
show up more often.
With one legacy id the migration never compared a key, so the readers
made the first comparison. Two ids make the migration's second put do
it, before any reader gets past the migration lock. 10/10 green on
2.5.250 here; still 3/3 red on the pre-#1309 sources.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 7bdfdef commit 5eaffdd
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
218 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
219 | 226 | | |
220 | | - | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
240 | | - | |
| 247 | + | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
| |||
0 commit comments