SELECT query slowing down the wal replay in replication server
Replication can be delayed if a query on the standby needs data the master has removed. The WAL from the master with the resource removal cannot be replayed until the standby query finishes, or the standby query must be cancelled.

You can:


Let the standby cancel the query after a time limit - see the max_standby_archive_delay and max_standby_stremaing_delay parameters; or
Enable hot_standby_feedback on the standby so the master won't remove resources the standby needs while its queries are running. This isn't perfect, conflicts that delay replication or cause query cancels can still happen when the standby just recently started up. But it helps.