forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdf238ae
committed
Avoid O(N^2) behavior when the standby process releases many locks.
When replaying a transaction that held many exclusive locks on theprimary, a standby server's startup process would expend O(N^2)effort on manipulating the list of locks. This code was fine whenwritten, but commit1cff1b9 made repetitive list_delete_first()calls inefficient, as explained in its commit message. Fix by justiterating the list normally, and releasing storage only when done.(This'd be inadequate if we needed to recover from an error occurringpartway through; but we don't.)Back-patch to v13 where1cff1b9 came in.Nathan BossartDiscussion:https://postgr.es/m/CD2F0E7F-9822-45EC-A411-AE56F14DEA9F@amazon.com1 parent4cd72ad commitdf238ae
1 file changed
+6
-4
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
791 | 791 |
| |
792 | 792 |
| |
793 | 793 |
| |
794 |
| - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
795 | 797 |
| |
796 |
| - | |
| 798 | + | |
797 | 799 |
| |
798 | 800 |
| |
799 | 801 |
| |
| |||
807 | 809 |
| |
808 | 810 |
| |
809 | 811 |
| |
810 |
| - | |
811 |
| - | |
812 | 812 |
| |
| 813 | + | |
| 814 | + | |
813 | 815 |
| |
814 | 816 |
| |
815 | 817 |
| |
|
0 commit comments
Comments
(0)