YES, provided you are performing an In-Place Upgrade (e.g., running the Windows Setup to go from Server 2016 to Server 2019/2022) and not a "Clean Install" (formatting the disk).
Microsoft supports a feature called Cluster OS Rolling Upgrade (introduced in Server 2012 R2), which allows you to upgrade the Operating System of a node while it remains a member of the cluster.
- Mixed-OS Mode: When you upgrade
PWGIRSQL2 to the new OS version and it rejoins the cluster, the cluster will temporarily operate in a "Mixed Mode." It will tolerate having Node 1 on the old OS and Node 2 on the new OS simultaneously.
The Cluster Role Persists: The Failover Clustering feature and your configuration are preserved during the Windows upgrade process. You do not need to reinstall the Failover Clustering role or re-add the node manually if you choose "Keep personal files and apps" during the OS setup.
SQL Server Upgrade: Similarly, for the Database Engine, you can perform an In-Place upgrade of the SQL instance on Node 2. Since it is currently a Secondary replica, this will not affect the production database on Node 1.
Important Warning: While the cluster is in this "Mixed OS" state, you generally cannot perform management operations that require features only present in the new OS version. CRITICAL: Do NOT run the PowerShell command Update-ClusterFunctionalLevel until ALL nodes (PWGIRSQL1, 2, and 3) have been upgraded to the new Operating System version. If you run this command while Node 1 is still on the old version, the cluster service on Node 1 may fail permanently.
So:
Pause & Drain PWGIRSQL2.
Upgrade Windows OS (In-Place) on Node 2 -> Reboot.
Upgrade SQL Server on Node 2 -> Reboot.
Resume Node 2 (Wait for SQL Synchronization).
Failover to Node 2.
Repeat for other nodes.
I hope you've found something useful here. If it helps you get more insight into the issue, it's appreciated to accept the answer. Should you have more questions, feel free to leave a message. Have a nice day!
VP