Hello,
If the stats collector is forcibly terminated on the standby in streaming replication configuration, it won't be restarted until the standby is promoted to the primary. The attached patch restarts the stats collector on the standby.
FYI, when the stats collector is down, SELECTs against the statistics views get stale data with the following message.
LOG: using stale statistics instead of current ones because stats collector is not responding
STATEMENT: select * from pg_stat_user_tables
Regards
Takayuki Tsunakawa