forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit932f9fb
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 parented2c7f6 commit932f9fb
1 file changed
+12
-12
lines changedLines changed: 12 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 |
| - | |
| 227 | + | |
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
262 |
| - | |
| 262 | + | |
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
| |||
289 | 289 |
| |
290 | 290 |
| |
291 | 291 |
| |
292 |
| - | |
| 292 | + | |
293 | 293 |
| |
294 | 294 |
| |
295 | 295 |
| |
| |||
313 | 313 |
| |
314 | 314 |
| |
315 | 315 |
| |
316 |
| - | |
| 316 | + | |
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
| |||
336 | 336 |
| |
337 | 337 |
| |
338 | 338 |
| |
339 |
| - | |
| 339 | + | |
340 | 340 |
| |
341 | 341 |
| |
342 | 342 |
| |
| |||
362 | 362 |
| |
363 | 363 |
| |
364 | 364 |
| |
365 |
| - | |
| 365 | + | |
366 | 366 |
| |
367 | 367 |
| |
368 | 368 |
| |
| |||
429 | 429 |
| |
430 | 430 |
| |
431 | 431 |
| |
432 |
| - | |
| 432 | + | |
433 | 433 |
| |
434 | 434 |
| |
435 | 435 |
| |
| |||
477 | 477 |
| |
478 | 478 |
| |
479 | 479 |
| |
480 |
| - | |
| 480 | + | |
481 | 481 |
| |
482 | 482 |
| |
483 | 483 |
| |
| |||
489 | 489 |
| |
490 | 490 |
| |
491 | 491 |
| |
492 |
| - | |
| 492 | + | |
493 | 493 |
| |
494 | 494 |
| |
495 | 495 |
| |
| |||
505 | 505 |
| |
506 | 506 |
| |
507 | 507 |
| |
508 |
| - | |
| 508 | + | |
509 | 509 |
| |
510 | 510 |
| |
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
514 |
| - | |
| 514 | + | |
515 | 515 |
| |
516 | 516 |
| |
517 | 517 |
| |
| |||
536 | 536 |
| |
537 | 537 |
| |
538 | 538 |
| |
539 |
| - | |
| 539 | + | |
540 | 540 |
| |
541 | 541 |
| |
542 | 542 |
| |
|
0 commit comments
Comments
(0)