Replication of master and replica db

in my frappe erpnext code there is a logic that if reports are from privious fiscal years then it will be genrated and read from replica database and if the reports are from current fiscal years then it must be generated and read from master database …but when i try to create reprot from local server with privious fiscal years it goes to queu instead of completed