# TiFlash restart query impact by version

Use this topic only when the customer asks about SQL impact or avoidance for a
planned TiFlash process or host restart. Apply the exact version boundary; do
not use it for a generic TiFlash load or resource question with no restart.

- TiFlash graceful shutdown was introduced in TiDB v8.5.4. The new
  `flash.graceful_wait_shutdown_timeout` setting lets TiFlash reject new MPP
  tasks while allowing already-running MPP tasks to continue for a bounded
  timeout. Its default is 600 seconds; unfinished tasks are forcibly stopped
  after the timeout.
- TiDB v7.5.6 predates that feature. When TiFlash is terminated, it does not
  wait for all running MPP tasks to finish. SQL whose MPP task is running on
  the restarted TiFlash can therefore fail.
- Multiple TiFlash replicas preserve data availability and can serve other or
  later work, but they do not migrate an already-running MPP task away from the
  instance being terminated. Two available replicas therefore do not guarantee
  that a host restart is transparent to every in-flight SQL.
- In `INFORMATION_SCHEMA.TIFLASH_REPLICA`, `REPLICA_COUNT` is the configured
  replica count, while `AVAILABLE` is a Boolean availability indicator for the
  table's TiFlash replica (`1` means available). Never interpret
  `REPLICA_COUNT=2, AVAILABLE=1` as "only one of two replicas is available."
- On v7.5.6 there is no TiFlash graceful-shutdown control that can completely
  eliminate this query-failure window. A low-traffic maintenance window and
  restarting only one TiFlash host at a time reduce impact but do not make the
  operation error-free. The application should be prepared to retry affected
  read-only queries when that is safe for its workload.
- When the customer supplies an older version and asks how to avoid the impact,
  include the actionable version boundary in the customer answer: TiFlash
  graceful shutdown starts in v8.5.4. Present an upgrade as a longer-term way
  to reduce the interruption window, not as a zero-impact guarantee.
- Keep approval and execution human-owned. Before a production restart,
  Support should confirm the affected host, replica availability, current MPP
  workload, maintenance window, application retry behavior, and recovery
  checks. Do not promise zero impact merely from replica count.
- For v8.5.4 or later, verify the deployed version and configuration before
  claiming graceful behavior. Graceful shutdown bounds disruption for running
  MPP tasks; it does not guarantee that every task finishes before the timeout.

Official references:

- https://docs.pingcap.com/tidb/stable/release-8.5.4/
- https://docs.pingcap.com/tidb/stable/tiflash-configuration/#graceful_wait_shutdown_timeout-new-in-v854
- https://docs.pingcap.com/tidb/stable/information-schema-tiflash-replica/
- https://github.com/pingcap/tiflash/issues/10266
