Question

Shortly I will be migrating a 2008 R2 SSRS installation to a new SQL 2019 Always on AG in AWS. This one will contain subscriptions, and I have never dealt with them before. I read the documentation here: SSRS and AG's and it states that the agent jobs that control the subscriptions are automatically recreated after a failover on the new primary, but still exist on the old primary.

For my other SSRS migrations, I wrote code that automatically takes care of restarting SQL agent and SSRS services on the appropriate nodes after a failover to use the new node. I have the same jobs on all replicas, and I also have a job step in them that checks to see if the server is the primary. If it's not, the job will not run.

Since my jobs are already synced and have controlled execution based on primary replica status, id rather use that to control the subscriptions, but will SQL overwrite the existing jobs for the subscriptions? Or will it only add jobs that are not there? I don't have a server to test this on at the moment, and I can't find this specific situation online. I'd rather have the jobs always there, and let the job logic run the jobs based on the replica state. Is that possible with subscriptions, or do I need to always disable the jobs on the old primary, and let SQL recreate the jobs on the new primary?

I'd also like to rename the sql agent jobs from their nonsense GUID to something more intuitive. Would that mess with the jobs executing if I did that?

Was it helpful?

Solution

I managed this situation severals times.

The best thing is to not modify the subscrition jobs created by SSRS service. After all they do not have a job schedule. The schedules are managed internally in the SSRS database. With SQL Server Always on AG the jobs are not replicated because their definition is inside the msdb. So in an Alwayson AG setup for SSRS, you have an SSRS database inside an AG but you have two (or more) msdb that can contain ssrs jobs and two (or more) SSRS services. Each of the runnig SSRS services will execute the scheduled jobs handling dividing the workload trough the ssrs database. Here I'm supposing you configured the SSRS to use the AG listener for db connection.

Remember to place the proper ssrs service user in msdb database role (RSExecRole) of each instances as described here:

https://docs.microsoft.com/it-it/sql/reporting-services/security/create-the-rsexecrole?view=sql-server-ver15

The SSRS subscription jobs are recreated every time ssrs starts so when a failover occurs you have to start or restart ssrs service to handle this.

Then what happend depends on what is the role of AG you designed: HA or DR.

In the DR design I suggest you to not leave SSRS service turned off because it will execute subscription on a DR site and this usualy is not good.

In an HA design you could leave the SSRS service turned on so you balance the workload between the two instances (keep attention to licensing too)

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top