forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6912acc
committed
Replication lag tracking for walsenders
Adds write_lag, flush_lag and replay_lag cols to pg_stat_replication.Implements a lag tracker module that reports the lag times based uponmeasurements of the time taken for recent WAL to be written, flushed andreplayed and for the sender to hear about it. These timesrepresent the commit lag that was (or would have been) introduced by eachsynchronous commit level, if the remote server was configured as asynchronous standby. For an asynchronous standby, the replay_lag columnapproximates the delay before recent transactions became visible to queries.If the standby server has entirely caught up with the sending server andthere is no more WAL activity, the most recently measured lag times willcontinue to be displayed for a short time and then show NULL.Physical replication lag tracking is automatic. Logical replication trackingis possible but is the responsibility of the logical decoding plugin.Tracking is a private module operating within each walsender individually,with values reported to shared memory. Module not used outside of walsender.Design and code is good enough now to commit - kudos to the author.In many ways a difficult topic, with important and subtle behaviour so thisshoudl be expected to generate discussion and multiple open items: Test now!Author: Thomas Munro, following designs by Fujii Masao and Simon RiggsReview: Simon Riggs, Ian Barwick and Craig Ringer1 parent7c4f524 commit6912acc
File tree
8 files changed
+370
-7
lines changed- doc/src/sgml
- src
- backend
- access/transam
- catalog
- replication
- include
- catalog
- replication
- test/regress/expected
8 files changed
+370
-7
lines changedLines changed: 69 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1695 | 1695 |
| |
1696 | 1696 |
| |
1697 | 1697 |
| |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1698 | 1728 |
| |
1699 | 1729 |
| |
1700 | 1730 |
| |
| |||
1745 | 1775 |
| |
1746 | 1776 |
| |
1747 | 1777 |
| |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
1748 | 1817 |
| |
1749 | 1818 |
| |
1750 | 1819 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11555 | 11555 |
| |
11556 | 11556 |
| |
11557 | 11557 |
| |
| 11558 | + | |
11558 | 11559 |
| |
11559 | 11560 |
| |
11560 | 11561 |
| |
| |||
11877 | 11878 |
| |
11878 | 11879 |
| |
11879 | 11880 |
| |
| 11881 | + | |
| 11882 | + | |
| 11883 | + | |
| 11884 | + | |
| 11885 | + | |
| 11886 | + | |
| 11887 | + | |
| 11888 | + | |
| 11889 | + | |
| 11890 | + | |
| 11891 | + | |
| 11892 | + | |
| 11893 | + | |
11880 | 11894 |
| |
11881 | 11895 |
| |
11882 | 11896 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
705 | 705 |
| |
706 | 706 |
| |
707 | 707 |
| |
| 708 | + | |
| 709 | + | |
| 710 | + | |
708 | 711 |
| |
709 | 712 |
| |
710 | 713 |
| |
|
0 commit comments
Comments
(0)