forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitde559c2
committed
Switch pg_test_fsync to use binary mode on Windows
pg_test_fsync has always opened files using the text mode on Windows, asthis is the default mode used if not enforced by _setmode().This fixes a failure when running pg_test_fsync down to 12 becauseO_DSYNC and the text mode are not able to work together nicely. Wefixed the handling of O_DSYNC in 12~ for the tool by switching to theconcurrent-safe version of fopen() in src/port/ with0ba06e0. And40cfe86, by enforcing the text mode for compatibility reasons if O_TEXTor O_BINARY are not specified by the caller, broke pg_test_fsync. Forall versions, this avoids any translation overhead, and pg_test_fsyncshould test binary writes, so it is a gain in all cases.Note that O_DSYNC is still not handled correctly in ~11, leading topg_test_fsync to show insanely high numbers for open_datasync() (usingthis property it is easy to notice that the binary mode is muchfaster). This would require a backpatch of0ba06e0 and40cfe86, whichcould potentially break existing applications, so this is left out.There are no TAP tests for this tool yet, so I have checked all buildsmanually using MSVC. We could invent a new option to run a singletransaction instead of using a duration of 1s to make the tests amaximum short, but this is left as future work.Thanks to Bruce Momjian for the discussion.Reported-by: Jeff JanesAuthor: Michael PaquierDiscussion:https://postgr.es/m/16526-279ded30a230d275@postgresql.orgBackpatch-through: 9.51 parentc6d43ff commitde559c2
1 file changed
+12
-12
lines changedLines changed: 12 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
226 |
| - | |
| 226 | + | |
227 | 227 |
| |
228 | 228 |
| |
229 | 229 |
| |
| |||
258 | 258 |
| |
259 | 259 |
| |
260 | 260 |
| |
261 |
| - | |
| 261 | + | |
262 | 262 |
| |
263 | 263 |
| |
264 | 264 |
| |
| |||
288 | 288 |
| |
289 | 289 |
| |
290 | 290 |
| |
291 |
| - | |
| 291 | + | |
292 | 292 |
| |
293 | 293 |
| |
294 | 294 |
| |
| |||
312 | 312 |
| |
313 | 313 |
| |
314 | 314 |
| |
315 |
| - | |
| 315 | + | |
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
338 |
| - | |
| 338 | + | |
339 | 339 |
| |
340 | 340 |
| |
341 | 341 |
| |
| |||
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
364 |
| - | |
| 364 | + | |
365 | 365 |
| |
366 | 366 |
| |
367 | 367 |
| |
| |||
428 | 428 |
| |
429 | 429 |
| |
430 | 430 |
| |
431 |
| - | |
| 431 | + | |
432 | 432 |
| |
433 | 433 |
| |
434 | 434 |
| |
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
479 |
| - | |
| 479 | + | |
480 | 480 |
| |
481 | 481 |
| |
482 | 482 |
| |
| |||
488 | 488 |
| |
489 | 489 |
| |
490 | 490 |
| |
491 |
| - | |
| 491 | + | |
492 | 492 |
| |
493 | 493 |
| |
494 | 494 |
| |
| |||
504 | 504 |
| |
505 | 505 |
| |
506 | 506 |
| |
507 |
| - | |
| 507 | + | |
508 | 508 |
| |
509 | 509 |
| |
510 | 510 |
| |
511 | 511 |
| |
512 | 512 |
| |
513 |
| - | |
| 513 | + | |
514 | 514 |
| |
515 | 515 |
| |
516 | 516 |
| |
| |||
535 | 535 |
| |
536 | 536 |
| |
537 | 537 |
| |
538 |
| - | |
| 538 | + | |
539 | 539 |
| |
540 | 540 |
| |
541 | 541 |
| |
|
0 commit comments
Comments
(0)