I am setting up an AlwaysOn Availability Group with 3 nodes. 1 Primary, 1 Secondary Read-only node and 1 secondary non-readable node. I want to offload my maintenance jobs to my secondary read-only node which is fine. I can do this by adding a step to all my maintenance jobs to check the node. If it's the Primary node, the job will stop before moving on to the next step.
I also have a maintenance database where I record all my maintenance job information such as failures, start times, end time, durations, index/statistic names etc etc. I want to keep this database within my AG group rather than have a different maintenance DB on each node. So my question is..
IF my maintenance jobs are running on my secondary read-only node and I need this to record audit information in a maintenance database within the AG Group, will this automatically write the data to the Primary Node DB or will it try and write this to the Secondary Node database. If it tries to write to the secondary node will it fail? If it does, is there a good workaround that doesn't involve having a separate maintenanceDB on each node or keeping my maintenanceDB within it's own separate Availability Group?