// Redis error reference

LOADING: Dataset still loading from disk

The server restarted and is still reading its RDB or AOF into memory; commands that need the dataset are refused until loading finishes.

Error prefix
LOADING
카테고리
Memory and persistence
오류 메시지
LOADING Redis is loading the dataset in memory

의미

LOADING is the startup state: Redis has opened its port but is still reading the dataset from the RDB snapshot or replaying the AOF, and it refuses commands that would touch data it has not loaded yet. INFO and a few management commands work; data commands such as GET are refused, whichever key they name.

In the happy path this is a wait-it-out error, and otherwise a smoke alarm: how long loading takes is a function of dataset size and disk speed, and if it happens mid-day it usually means an unexpected restart. Clients should retry with backoff, and readiness probes should hold traffic back until INFO persistence reports loading:0.

일반적인 원인

  • A restart, planned or from a crash, left Redis replaying its persistence file.
  • A large dataset on slow storage makes the loading window long enough for clients to trip over it.
  • A replica loading the primary's RDB transfer answers LOADING until the load completes.

Find the cause

INFO persistence | grep loading
# loading_loaded_bytes against loading_total_bytes: progress in bytes
INFO server | grep uptime_in_seconds
# How long ago this server started, that is, how long it has been loading

해결 방법

  1. Watch progress rather than guessing:

    INFO persistence
    # loading:1, loading_loaded_bytes, loading_total_bytes
  2. Gate traffic until it finishes: readiness checks should treat loading:1 as not ready and retry with backoff.

  3. If the window is too long for your SLA, shrink the source: faster disk, smaller snapshots through TTLs, or a tightened AOF rewrite schedule.

Other ways to handle it

For deploy scripts, wait for readiness before running migrations: loop on INFO persistence until loading is 0. In clusters and behind Sentinel, role changes route traffic around a loading node automatically, which is one more reason not to point everything at a single node.

안전하게 재현하세요

Small datasets load in milliseconds, so the window is easy to miss locally; with a 0.78 GB dump (20M keys) it lasted 12 s on the test machine.

redis-server --port 7308 --save '' &
redis-cli -p 7308 SET warmup key
redis-cli -p 7308 BGSAVE
redis-cli -p 7308 SHUTDOWN
redis-server --port 7308 &
redis-cli -p 7308 SET x 1
# (error) LOADING Redis is loading the dataset in memory   (if you are quick)

질문

Which commands work during LOADING?

INFO, CONFIG GET, CLIENT, HELLO, SELECT and ECHO answer normally; anything touching the dataset is refused, and so is PING. That is why INFO-based monitoring keeps working while the application and PING-based health checks do not.

Can I skip loading and start empty?

Yes, deliberately: move the dump file away, or start in a directory that has no dump file. Starting with --save '' does not skip loading, because Redis still reads an existing dump.rdb. Done carelessly, that data is gone: the next save overwrites the original dump file.

관련 오류

More memory and persistence errors

코드와 메시지 텍스트의 출처는 다음과 같습니다 Redis documentation and source code. 전체 목록은 Redis error list 또는 모든 데이터베이스 오류 검색.

// 오류는 줄이고, 수정은 빠르게

Work on Redis in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Redis and the other databases you use.

이 페이지의 텍스트와 데이터: CC BY 4.0, 출처: SQLly (sqlly.app). 코드와 SQL 스니펫: MIT. 라이선스 세부 정보 인용된 오류 메시지 텍스트의 권리는 해당 데이터베이스 공급업체에 있습니다.