org.postgresql.util.PSQLException: ERROR: canceling statement due to conflict with recovery
What you see is a common experience for anyone running standbys and bigger queries on the master.  There are a couple of possible causes:


  There are also additional types of conflict that can occur with Hot
  Standby. These conflicts are hard conflicts in the sense that queries
  might need to be canceled and, in some cases, sessions disconnected to
  resolve them. The user is provided with several ways to handle these
  conflicts. Conflict cases include:
  
  Access Exclusive locks taken on the primary server, including both
  explicit LOCK commands and various DDL actions, conflict with table
  accesses in standby queries.
  
  
  Dropping a tablespace on the primary conflicts with standby queries using that tablespace for temporary work files.
  Dropping a database on the primary conflicts with sessions connected to that database on the standby.
  Application of a vacuum cleanup record from WAL conflicts with standby transactions whose snapshots can still "see" any of the rows
  to be removed.
  Application of a vacuum cleanup record from WAL conflicts with queries accessing the target page on the standby, whether or not the
  data to be removed is visible.
  


When a query will be killed for one of the above reasons is hard to predict, but usually there are some that appear more often.  It is also configurable, for options read the documentation page further.

The most important option is hot_standby_feedback, which helps against the most common cause (VACUUM removing recently-dead rows).  It has its own costs (might cause table bloat), but the outcome is usually still better than running the same queries on the master.