forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2783898
committed
Relax lock level for setting PGPROC->statusFlags
We don't actually need a lock to set PGPROC->statusFlags itself; what wedo need is a shared lock on either XidGenLock or ProcArrayLock in order toensure MyProc->pgxactoff keeps still while we modify the mirror array inProcGlobal->statusFlags. Some places were using an exclusive lock forthat, which is excessive. Relax those to use shared lock only.procarray.c has a couple of places with somewhat brittle assumptionsabout PGPROC changes: ProcArrayEndTransaction uses only shared lock, soit's permissible to change MyProc only. On the other hand,ProcArrayEndTransactionInternal also changes other procs, so it musthold exclusive lock. Add asserts to ensure those assumptions continueto hold.Author: Álvaro Herrera <alvherre@alvh.no-ip.org>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/20201117155501.GA13805@alvherre.pgsql1 parent2cccb62 commit2783898
File tree
6 files changed
+16
-5
lines changed- src
- backend
- commands
- replication
- logical
- storage
- ipc
- lmgr
- include/storage
6 files changed
+16
-5
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1741 | 1741 |
| |
1742 | 1742 |
| |
1743 | 1743 |
| |
1744 |
| - | |
| 1744 | + | |
1745 | 1745 |
| |
1746 | 1746 |
| |
1747 | 1747 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
181 | 181 |
| |
182 | 182 |
| |
183 | 183 |
| |
184 |
| - | |
| 184 | + | |
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
527 | 527 |
| |
528 | 528 |
| |
529 | 529 |
| |
530 |
| - | |
| 530 | + | |
531 | 531 |
| |
532 | 532 |
| |
533 | 533 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
662 | 662 |
| |
663 | 663 |
| |
664 | 664 |
| |
| 665 | + | |
| 666 | + | |
665 | 667 |
| |
666 | 668 |
| |
667 | 669 |
| |
| |||
682 | 684 |
| |
683 | 685 |
| |
684 | 686 |
| |
685 |
| - | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
686 | 692 |
| |
687 | 693 |
| |
688 | 694 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
623 | 623 |
| |
624 | 624 |
| |
625 | 625 |
| |
626 |
| - | |
| 626 | + | |
627 | 627 |
| |
628 | 628 |
| |
629 | 629 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 |
| |
102 | 107 |
| |
103 | 108 |
| |
|
0 commit comments
Comments
(0)