content/develop/clients/sch.md
Smart client handoffs (SCH) is a feature of Redis Cloud and Redis Software servers that lets them actively notify clients about planned server maintenance shortly before it happens. This lets a client reconnect or otherwise respond gracefully without significant interruptions in service.
SCH is primarily useful when server software or hardware upgrades are required. It provides two main features to help the client avoid disruptions in service during the maintenance period:
{{< note >}}SCH does not work with blocking connections.
These include connections used for blocking operations like
[BLPOP]({{< relref "/commands/blpop" >}}) and also
[pub/sub]({{< relref "/develop/pubsub" >}}) subscriptions.
All non-blocking operations are safe to use with SCH.
{{< /note >}}
SCH is enabled automatically on the client side during connection if you select the [RESP3]({{< relref "/develop/reference/protocol-spec#resp-versions" >}}) protocol, which is a requirement for SCH. However, you can configure some parameters, such as the timeouts to use during maintenance. See the pages linked below to learn how to configure SCH for:
SCH is fully supported and enabled by default on Redis Cloud, except when you are using one of the following options:
These services don't currently allow for pre-handoffs, but you still get the benefit of relaxed timeouts during database version upgrades. All other configurations have full support for both relaxed timeouts and pre-handoffs.
You must enable SCH explicitly on self-managed Redis Software servers by using the
[v1/cluster]({{< relref "/operate/rs/references/rest-api/requests/cluster" >}})
REST API request to set the client_maint_notifications option to true.
The example below shows how to do this using the
curl command line utility:
curl -k -X PUT -H "accept: application/json" \
-H "content-type: application/json" \
-u "[email protected]:test123" \
-d '{ "client_maint_notifications": true }' \
https://localhost:9443/v1/cluster
Redis Software uses relaxed timeouts to avoid command failures during database version upgrades. The support for pre-handoffs depends on the specific upgrade method you use, as detailed in the table below.
| Upgrade method | SCH support | Expected behavior |
|---|---|---|
| [Rolling upgrade]({{< relref "/operate/rs/installing-upgrading/upgrading/upgrade-cluster#rolling-upgrade" >}}) | Full | New nodes and old ones removed sequentially. SCH pre-handoffs and relaxed timeouts greatly reduce disruptions during the upgrade. |
| [In-place upgrade]({{< relref "/operate/rs/installing-upgrading/upgrading/upgrade-cluster#in-place-upgrade" >}}) | Partial | Relaxed timeouts reduce errors but there are no pre-handoffs. Disconnections occur when processes are replaced during the upgrade, so clients should rely on auto-reconnect, which will cause brief lapses in service. |
| [Maintenance mode]({{< relref "/operate/rs/clusters/maintenance-mode" >}}) | Full | SCH is fully supported during hardware or OS patching operations. Pre-handoffs and relaxed timeouts minimize application impact. |
SCH is not currently supported for [Kubernetes]({{< relref "/operate/kubernetes" >}}) clusters.
SCH is not currently supported for [Redis Open Source]({{< relref "/operate/oss_and_stack" >}}).