forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf560209
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:* The SQLCmd path failed to restore CurrentMemoryContext to the caller'svalue, and failed to delete the temp context created in this routine.It's only through great good fortune that these oversights did notresult in long-term memory leaks or other problems. It seems cleanerto code SQLCmd as a separate early-exit path, so do it like that.* Remove useless duplicate call of SnapBuildClearExportedSnapshot().* replication_scanner_finish() was never called.None of those things are significant enough to merit a backpatch,so this is for HEAD only.Discussion:https://postgr.es/m/880181.1600026471@sss.pgh.pa.us1 parent47a3a1c commitf560209
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 |
| |
| |||
1651 | 1667 |
| |
1652 | 1668 |
| |
1653 | 1669 |
| |
1654 |
| - | |
1655 |
| - | |
1656 |
| - | |
1657 |
| - | |
1658 |
| - | |
1659 |
| - | |
1660 |
| - | |
1661 |
| - | |
1662 |
| - | |
1663 |
| - | |
1664 |
| - | |
1665 | 1670 |
| |
1666 | 1671 |
| |
1667 | 1672 |
| |
| |||
1677 | 1682 |
| |
1678 | 1683 |
| |
1679 | 1684 |
| |
| 1685 | + | |
1680 | 1686 |
| |
1681 | 1687 |
| |
1682 | 1688 |
| |
|
0 commit comments
Comments
(0)