forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit66d86d4
committed
Document more assumptions of LWLock variable changes with WAL inserts
This commit adds a few comments about what LWLockWaitForVar() relies onwhen a backend waits for a variable update on its LWLocks for WALinsertions up to an expected LSN.First, LWLockWaitForVar() does not include a memory barrier, relying ona spinlock taken at the beginning of WaitXLogInsertionsToFinish(). Thiswas hidden behind two layers of routines in lwlock.c. This assumptionis now documented at the top of LWLockWaitForVar(), and detailed at bitmore within LWLockConflictsWithVar().Second, document why WaitXLogInsertionsToFinish() does not includememory barriers, relying on a spinlock at its top, which is, per Andres'input, fine for two different reasons, both depending on the fact thatthe caller of WaitXLogInsertionsToFinish() is waiting for a LSN up to acertain value.This area's documentation and assumptions could be improved more in thefuture, but at least that's a beginning.Author: Bharath Rupireddy, Andres FreundReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/CALj2ACVF+6jLvqKe6xhDzCCkr=rfd6upaGc3477Pji1Ke9G7Bg@mail.gmail.com1 parent62e9af4 commit66d86d4
2 files changed
+19
-3
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1495 | 1495 |
| |
1496 | 1496 |
| |
1497 | 1497 |
| |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
1498 | 1509 |
| |
1499 | 1510 |
| |
1500 | 1511 |
| |
|
Lines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1556 | 1556 |
| |
1557 | 1557 |
| |
1558 | 1558 |
| |
1559 |
| - | |
1560 |
| - | |
1561 |
| - | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
1562 | 1563 |
| |
1563 | 1564 |
| |
1564 | 1565 |
| |
| |||
1601 | 1602 |
| |
1602 | 1603 |
| |
1603 | 1604 |
| |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
1604 | 1609 |
| |
1605 | 1610 |
| |
1606 | 1611 |
| |
|
0 commit comments
Comments
(0)