forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit799f8bc
committed
Shorten timeouts while waiting for logicalrep worker slot attach/detach.
When waiting for a logical replication worker process to start or stop,we have to busy-wait until we see it add or remove itself from theLogicalRepWorker slot in shared memory. Those loops were using aone-second delay between checks, but on any reasonably modern machine, itdoesn't take more than a couple of msec for a worker to spawn or shut down.Reduce the loop delays to 10ms to avoid wasting quite so much time in therelated regression tests.In principle, a better solution would be to fix things so that the waitingprocess can be awakened via its latch at the right time. But that seemsconsiderably more invasive, which is undesirable for a post-beta fix.Worker start/stop performance likely isn't of huge interest anyway forproduction purposes, so we might not ever get around to it.In passing, rearrange the second wait loop in logicalrep_worker_stop()so that the lock is held at the top of the loop, thus saving one lockacquisition/release per call, and making it look more like the other loop.Discussion:https://postgr.es/m/30864.1498861103@sss.pgh.pa.us1 parentef74e03 commit799f8bc
1 file changed
+17
-18
lines changedLines changed: 17 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
201 | 201 |
| |
202 | 202 |
| |
203 | 203 |
| |
204 |
| - | |
| 204 | + | |
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
208 |
| - | |
| 208 | + | |
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
| |||
408 | 408 |
| |
409 | 409 |
| |
410 | 410 |
| |
411 |
| - | |
412 |
| - | |
| 411 | + | |
| 412 | + | |
413 | 413 |
| |
414 | 414 |
| |
415 | 415 |
| |
| |||
435 | 435 |
| |
436 | 436 |
| |
437 | 437 |
| |
438 |
| - | |
439 |
| - | |
| 438 | + | |
| 439 | + | |
440 | 440 |
| |
441 | 441 |
| |
442 | 442 |
| |
443 | 443 |
| |
444 | 444 |
| |
445 | 445 |
| |
446 | 446 |
| |
447 |
| - | |
| 447 | + | |
448 | 448 |
| |
449 | 449 |
| |
450 |
| - | |
| 450 | + | |
451 | 451 |
| |
452 | 452 |
| |
453 | 453 |
| |
| |||
459 | 459 |
| |
460 | 460 |
| |
461 | 461 |
| |
462 |
| - | |
| 462 | + | |
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
| |||
480 | 480 |
| |
481 | 481 |
| |
482 | 482 |
| |
483 |
| - | |
484 | 483 |
| |
485 | 484 |
| |
486 | 485 |
| |
487 | 486 |
| |
488 | 487 |
| |
489 | 488 |
| |
490 |
| - | |
| 489 | + | |
491 | 490 |
| |
492 |
| - | |
493 |
| - | |
494 | 491 |
| |
495 |
| - | |
496 |
| - | |
497 | 492 |
| |
498 |
| - | |
| 493 | + | |
499 | 494 |
| |
500 |
| - | |
| 495 | + | |
501 | 496 |
| |
502 | 497 |
| |
503 |
| - | |
| 498 | + | |
504 | 499 |
| |
505 | 500 |
| |
506 | 501 |
| |
| |||
511 | 506 |
| |
512 | 507 |
| |
513 | 508 |
| |
| 509 | + | |
| 510 | + | |
514 | 511 |
| |
| 512 | + | |
| 513 | + | |
515 | 514 |
| |
516 | 515 |
| |
517 | 516 |
| |
|
0 commit comments
Comments
(0)