Fix it now
The lease is a timer between the instance and the cluster resource that represents its availability group. Error 19407 is published as that lease having expired because a connectivity issue occurred between SQL Server and the cluster. The lease is almost never the problem: something stalled the instance, and the lease is what noticed.
Get-ClusterLog -Destination C:\Temp -TimeSpan 15
- Note the exact timestamp of the 19407 entry, then collect the 19406 replica state changes either side of it to build a timeline.
- Look for a stall at that moment in the SQL Server error log: scheduler or latch warnings, memory dumps written into the LOG folder, or warnings about I/O taking longer than expected.
- Check the Windows System and Application logs at the same timestamp for storage, hypervisor, backup or antivirus events, and check the guest’s own memory pressure.
- Read the cluster log you just generated around that window, and compare it against what the instance was doing.
- Do not raise the lease timeout until you know what the stall was. Changing it changes when you find out, not whether it happens.
The documented default lease timeout is 20,000 milliseconds, and Microsoft documents changing it through the availability group resource’s Properties in Failover Cluster Manager rather than from SQL Server.
If you have found the stall and dealt with it, stop here. If nothing was stalled, the next section covers Microsoft’s own list of what causes a lease to expire.
Why it happens
The cluster watches an availability group in two ways, and they catch different things. A health check runs periodically and asks the instance to report on itself; how bad the answer has to be before a failover is triggered is governed by the failure condition level, and the health check timeout defaults to 30,000 milliseconds with a documented minimum of 15,000. Separately, a lease is renewed continuously between the group’s cluster resource and the engine.
Microsoft describes the lease as a synchronisation and split-brain prevention mechanism. When the group comes online as primary, SQL Server spawns a dedicated lease worker thread that shares memory with the resource host; each side signals the other’s renewal event and each keeps a time-to-live that is updated when signalled. If a time-to-live expires while waiting for a signal, the lease expires and the replica transitions to a resolving state. That is the point: the old primary takes itself offline before a new one is elected.
The health check can detect a sick instance. Only the lease detects an instance that has stopped responding altogether while still running as a process, and that distinction matters when you read the log. A failover following a health check has a reason recorded in it. A failover following 19407 does not, because the instance was too stuck to record anything, so the evidence is somewhere else: in dumps, in the Windows event logs, in storage latency, or in the hypervisor.
Two neighbouring codes are worth getting the right way round, because they are easily transposed. Error 35201 is published as a connection timeout while attempting to establish a connection to an availability replica, adding that either a networking or firewall issue exists or the endpoint address given for the replica is not that host’s database mirroring endpoint. Error 35206 is published as a connection timeout on a previously established connection, adding that either a networking or firewall issue exists or the replica has transitioned to the resolving role. Error 19406 is the informational state change of the local replica, and it is what you use to build the timeline.
The instance stalled internally
You have this one if Scheduler or latch warnings, or a dump file written into the LOG folder within seconds of the lease expiry. Generating dump files is on Microsoft’s own list of lease expiry causes.
- Read the dump’s accompanying log entries to see which component was involved, and check whether your build has a fix for it.
- Apply the current cumulative update for your version, which is the usual remedy for a known stall.
- If it recurs on a current build, capture the evidence and raise it with support rather than tuning the timeouts around it.
The machine ran out of usable memory
You have this one if Low virtual memory or working set paging around the timestamp, which are both documented causes.
- Check the Windows event logs for low virtual memory events and the page file configuration.
- Confirm SQL Server’s max server memory leaves enough for the operating system, and that Lock Pages in Memory is configured deliberately rather than by accident.
- On a virtual machine, give the guest reserved memory rather than dynamic allocation, and confirm the host is not overcommitted.
The CPU was pegged
You have this one if Sustained full CPU across the window, which is another of the documented causes, often from a runaway query or a maintenance job.
- Correlate the window with whatever workload was running and deal with that rather than the lease.
- Check for other software on the node competing for CPU, including antivirus scans and backup agents.
- Consider Resource Governor or scheduling changes if one workload can reliably starve the instance.
The cluster went away rather than the instance
You have this one if Nothing on this node, plenty on the network, or the cluster lost quorum. WSFC being down is a documented cause of lease expiry.
- Check node membership and quorum for the same window.
- Review the witness configuration if a single node or site failure took quorum with it.
- Look at the network between nodes, including anything that saturates it such as backups or live migrations.
The timeouts are genuinely too tight for the environment
You have this one if You have investigated, found no stall, and the pattern fits a stretched or heavily virtualised environment where brief pauses are normal.
- Document the latency you measured and the failovers it caused, so the change is evidence-led rather than a reflex.
- Change the lease timeout on the availability group resource in Failover Cluster Manager: Roles, right-click the resource, Properties, then the Properties tab.
- Adjust the health check timeout on the group itself if that is the one firing:
ALTER AVAILABILITY GROUP [AG1] SET (HEALTH_CHECK_TIMEOUT = 60000);
Full reference
Microsoft’s own list of what expires a lease
- The operating system not responding.
- Low virtual memory.
- Working set paging.
- Generating dump files.
- Pegged CPU.
- The Windows Server Failover Cluster being down, including loss of quorum.
Everything else you might suspect, including storage latency, a hypervisor snapshot or a filter driver, works by producing one of those conditions. That is a useful way to hold it: find which of the six happened, then find what caused it.
The two timeouts, and what they cost
| Timeout | Default | Where it is set |
|---|---|---|
| Lease timeout | 20,000 ms | The availability group resource’s Properties in Failover Cluster Manager |
| Health check timeout | 30,000 ms, minimum 15,000 ms | ALTER AVAILABILITY GROUP ... SET (HEALTH_CHECK_TIMEOUT = ...) |
Every second you add to either timeout is a second longer before a genuinely dead instance is detected and failed over. Raising them trades availability for stability, and it should be a decision someone owns rather than a quiet edit made to stop an alert.
Building the timeline
| Source | What to take from it |
|---|---|
| SQL Server error log | The 19407 timestamp, plus 19406 state changes either side of it |
Get-ClusterLog -TimeSpan <minutes> |
What the cluster believed was happening in the same window |
| Windows System log | Storage, network and service events at that moment |
| Windows Application log | Antivirus, backup and hypervisor integration events |
| The LOG folder | Dump files written within seconds of the expiry |
| AlwaysOn_health extended events | The replica’s own view, on every replica not just this one |
Environmental checks worth doing once
- Exclude clustered SQL Server guests from hypervisor snapshots that quiesce the guest; a guest paused for a few seconds is indistinguishable from a dead instance.
- Exclude SQL Server data, log and backup files and folders from on-access scanning, following your antivirus vendor’s guidance.
- List filter drivers on the node and identify anything sitting over the database volumes.
- Move backups, storage snapshots and array maintenance away from each other so they do not compound.
- Schedule live migrations for maintenance windows and check the inter-node network is not saturated during them.
When it is one node and not the other
Recurring lease expiries on a single node almost always mean something local: an agent installed there, a different storage path, a host that is more heavily committed, or a build that is behind the others. Compare the node against a quiet one rather than looking at the availability group configuration, which is shared and therefore rarely the difference.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
19407 |
The lease between the availability group and the cluster expired because a connectivity issue occurred between SQL Server and the Windows Server Failover Cluster | Microsoft Learn |
19406 |
Informational: the state of the local availability replica changed from one state to another. Useful for reconstructing the timeline around a failover | Microsoft Learn |
35206 |
A connection timeout on a previously established connection to an availability replica; either a networking or firewall issue exists, or the replica has moved to the resolving role | Microsoft Learn |
35201 |
A connection timeout while attempting to establish a connection to an availability replica; either a networking or firewall issue exists, or the address given is not that host’s mirroring endpoint | Microsoft Learn |
Confirm the fix worked
- The group is online and healthy on the node you expect, with every replica connected.
sys.dm_hadr_availability_replica_statesreports a healthy synchronisation state for every replica.- The window that previously produced expiries, such as a backup run, passes with a clean error log.
- No new dump files appear in the LOG folder.
- If you changed a timeout, the new value is recorded somewhere alongside the reason for it.
Questions people ask about this
Does this cost anything to fix?
No. Lease expiry is a symptom of a stall, and the remedies are patching, memory and CPU headroom, storage tuning, hypervisor settings and antivirus exclusions. No licence or edition changes how the lease behaves.
Why did the group fail over when the instance was clearly running?
Because running is not the same as responding. The lease exists to catch an instance that is alive as a process but unable to answer, which from an application’s point of view is indistinguishable from being down. Microsoft describes it as a split-brain prevention mechanism: the old primary takes itself offline before a new one is elected.
Can I disable the lease?
No, and you would not want to. Without it, an instance that stopped responding without crashing would keep the group nominally online while serving nobody.
Is one failover a month worth investigating?
Yes. A lease expiry always has a cause, and the same cause tends to produce a longer stall eventually. Investigating a single event while the logs still exist is far easier than reconstructing a pattern later.
Where do I change the lease timeout?
On the availability group’s cluster resource, through Failover Cluster Manager: Roles, right-click the resource, Properties, then the Properties tab, where LeaseTimeout is listed. The documented default is 20,000 milliseconds. The health check timeout is a separate setting changed with ALTER AVAILABILITY GROUP.
