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

Manual failover without data loss not working in SQL2019

$
0
0

Hi,

I was wondering if you can help. I have setup two Linux SQL2019 CU3 instances on Ubuntu with HA enabled and I get an error when I execute: ALTER AVAILABILITY GROUP [ag6x52] SET (ROLE = SECONDARY); to manually failover over to the secondary replica.

The message is:
Msg 41104, Level 16, State 5, Line 1
Failover of the availability group to the local replica failed because the availability group resource did not come online due to a previous error.

My AG is as follows

Create AVAILABILITY GROUP ag6x52
   WITH (CLUSTER_TYPE = NONE )
   FOR REPLICA ON
   N'sql52' WITH (
      ENDPOINT_URL = N'tcp://172.16.6.52:5022',
      AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
      FAILOVER_MODE = MANUAL,
      SEEDING_MODE = AUTOMATIC
   ),
   N'sql52b' WITH ( 
      ENDPOINT_URL = N'tcp://172.16.5.52:5022', 
      AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
      FAILOVER_MODE = MANUAL,
      SEEDING_MODE = AUTOMATIC
  );

To failover over I ran the following TSQL

ALTER AVAILABILITY GROUP [ag6x52] 
     MODIFY REPLICA ON N'sql52b' 
     WITH (AVAILABILITY_MODE = SYNCHRONOUS_COMMIT);

SELECT ag.name, 
   drs.database_id, 
   drs.group_id, 
   drs.replica_id, 
   drs.synchronization_state_desc, 
   ag.sequence_number
FROM sys.dm_hadr_database_replica_states drs, sys.availability_groups ag
WHERE drs.group_id = ag.group_id; 

The above query shows that the state of all the databases as SYNCHRONIZED

Select is_failover_ready, * from sys.dm_hadr_database_replica_cluster_states

The above query shows the is_failover_ready field for all databases as 1

Next I execute

ALTER AVAILABILITY GROUP [ag6x52] SET (REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT = 1);

which is completed successfully. Then I execute 

ALTER AVAILABILITY GROUP [ag6x52] SET (ROLE = SECONDARY);

which returns the error

Msg 41104, Level 16, State 5, Line 32
Failover of the availability group 'ag6x52' to the local replica failed because the availability group resource did not come online due to a previous error. To identify that error, check the SQL Server error log, cluster logs and system event logs. For information about how to view events and logs for a Windows Server Failover Clustering (WSFC) cluster, see Windows Server documentation.

Please note that the databases are in Synchronized state and there is no cluster (Pacemaker) in place.

Thanks



Viewing all articles
Browse latest Browse all 4532

Trending Articles



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