forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4a20de9
committed
Make walsenders show their replication commands in pg_stat_activity.
A walsender process that has executed a SQL command left the text ofthat command in pg_stat_activity.query indefinitely, which is quiteconfusing if it's in RUNNING state but not doing that query. An easyand useful fix is to treat replication commands as if they were SQLqueries, and show them in pg_stat_activity according to the same rulesas for regular queries. While we're at it, it seems also sensible toset debug_query_string, allowing error logging and debugging to seethe replication command.While here, clean up assorted silliness in exec_replication_command:* Clean up SQLCmd code path, and fix its only-accidentally-not-buggy memory management.* Remove useless duplicate call of SnapBuildClearExportedSnapshot().* replication_scanner_finish() was never called.Back-patch of commitf560209 into v10-v13. I'd originally feltthat this didn't merit back-patching, but subsequent confusionwhile debugging walsender problems suggests that it'll be useful.Also, the original commit has now aged long enough to provide somecomfort that it won't cause problems.Discussion:https://postgr.es/m/2673480.1624557299@sss.pgh.pa.usDiscussion:https://postgr.es/m/880181.1600026471@sss.pgh.pa.us1 parentaf2e67b commit4a20de9
1 file changed
+34
-28
lines changedLines changed: 34 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1545 | 1545 |
| |
1546 | 1546 |
| |
1547 | 1547 |
| |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
1548 | 1551 |
| |
1549 | 1552 |
| |
1550 | 1553 |
| |
| |||
1557 | 1560 |
| |
1558 | 1561 |
| |
1559 | 1562 |
| |
| 1563 | + | |
1560 | 1564 |
| |
1561 | 1565 |
| |
1562 | 1566 |
| |
1563 | 1567 |
| |
1564 |
| - | |
1565 |
| - | |
1566 |
| - | |
1567 |
| - | |
| 1568 | + | |
| 1569 | + | |
1568 | 1570 |
| |
1569 |
| - | |
1570 |
| - | |
1571 |
| - | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
1572 | 1583 |
| |
1573 | 1584 |
| |
1574 |
| - | |
1575 |
| - | |
| 1585 | + | |
| 1586 | + | |
1576 | 1587 |
| |
1577 |
| - | |
1578 |
| - | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
1579 | 1591 |
| |
1580 | 1592 |
| |
1581 |
| - | |
1582 |
| - | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1583 | 1596 |
| |
1584 |
| - | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
1585 | 1604 |
| |
1586 | 1605 |
| |
1587 | 1606 |
| |
| |||
1597 | 1616 |
| |
1598 | 1617 |
| |
1599 | 1618 |
| |
1600 |
| - | |
1601 |
| - | |
1602 |
| - | |
1603 | 1619 |
| |
1604 | 1620 |
| |
1605 | 1621 |
| |
| |||
1668 | 1684 |
| |
1669 | 1685 |
| |
1670 | 1686 |
| |
1671 |
| - | |
1672 |
| - | |
1673 |
| - | |
1674 |
| - | |
1675 |
| - | |
1676 |
| - | |
1677 |
| - | |
1678 |
| - | |
1679 |
| - | |
1680 |
| - | |
1681 |
| - | |
1682 | 1687 |
| |
1683 | 1688 |
| |
1684 | 1689 |
| |
| |||
1690 | 1695 |
| |
1691 | 1696 |
| |
1692 | 1697 |
| |
| 1698 | + | |
1693 | 1699 |
| |
1694 | 1700 |
| |
1695 | 1701 |
| |
|
0 commit comments
Comments
(0)