Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4689

two primary replicas at the same time

$
0
0

Dear all,

Can you help me?

 

Just recently configured an Always On.

 

I am going nuts because I am seeing how the two nodes are primary at the same time (based in the following sentences):


 

DECLARE @preferredReplica int

SET @preferredReplica = (SELECT [master].sys.fn_hadr_backup_is_preferred_replica('mydb’))

IF (@preferredReplica = 0)
BEGIN
PRINT 'go ahead'

END

 

Always get ‘go ahead’ PRINT statement regadless from what node be launched.

 

And if I launch from my primary replica (that one I see from Availability Group Properties->General tab)

 

 

select role_desc,replica_server_name,roleFROMsys.dm_hadr_availability_replica_statesAS a

   JOINsys.availability_replicasAS b

       ON b.replica_id= a.replica_id

 

 

select role_desc,replica_server_name,roleFROM xxsql02.master.sys.dm_hadr_availability_replica_statesAS a

   JOIN xxsql02.master.sys.availability_replicasAS b

       ON b.replica_id= a.replica_id

 

PRIMARY     zzSQL01      1

PRIMARY     xxSQL02      1



Viewing all articles
Browse latest Browse all 4689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>