Flushall in redis leads to loading the dataset in memory error
Asked Answered
F

1

5

How do I "FLUSHALL" in redis in this situation?

Running redis via docker on PopOs 21.0.4 as shown in the following docker-compose.yml

version: "2.4"
services:
  redis:
    image: redis:5-alpine
    command: redis-server --save "" --appendonly yes
    restart: always
    volumes:
      - "${PWD}//redis/data:/data"
    ports:
      - "6379:6379"

Connecting to redis-cli and issuing a FLUSHALL (or FLUSHDB) command and I get the error:

127.0.0.1:6379[1]> FLUSHALL
(error) LOADING Redis is loading the dataset in memory

Here is docker version:

Client: Docker Engine - Community
 Version:           20.10.10
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        b485636
 Built:             Mon Oct 25 07:43:13 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.10
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       e2f740d
  Built:            Mon Oct 25 07:41:20 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.11
  GitCommit:        5b46e404f6b9f661a205e28d59c982d3634148f8
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Fitzpatrick answered 11/11, 2021 at 1:58 Comment(1)
There is an open issue about that error message.Shaffer
O
6

The error message means that Redis is still loading data, i.e. in your case, the AOF file. You cannot run FLUSHALL until the loading finishes.

If you don't need the data to be loaded, you can delete the AOF file before starting Redis.

Ostrander answered 11/11, 2021 at 2:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.