ERR Background save already in progress: Background save already in progress(バックグラウンド保存が既に進行中)
Redis意味
新しいバックグラウンド保存 (BGSAVE) または AOF 書換えを開始しようとしたが、バックグラウンド保存が既に進行中である。Redis は同時に 2 つ目の保存プロセスを許可しない。
原因
前回の完了前に新しい BGSAVE/BGREWRITEAOF がトリガーされた、または大規模なデータセットで fork/保存に時間がかかる間に監視スクリプトやアプリケーションが BGSAVE を繰り返し呼び出した。遅いディスクや大きな RDB ファイルは処理を長引かせる。
対処方法
実行中の保存が終わるまで待つ。INFO persistence の rdb_bgsave_in_progress と aof_rewrite_in_progress フィールド、および LASTSAVE のタイムスタンプで状態を確認する。アプリケーション/自動化のロジックを条件付きにし、前回の保存が終わる前に新しい BGSAVE をトリガーしないようにする。保存に時間がかかりすぎる場合は、ディスク速度と RDB サイズを調査する。
同じデータベースの他の項目
- ERR Can't execute '<cmd>': only (P|S)SUBSCRIBE / (P|S)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this contextCommand not allowed in subscribe context(subscribe コンテキストでは許可されないコマンド)
- ERR SELECT is not allowed in cluster modeSELECT is not allowed in cluster mode(クラスタモードでは SELECT は許可されない)
- ERR wrong number of arguments for commandWrong number of arguments for command(コマンドの引数の数が誤っている)
- ERR bit offset is not an integer or out of rangeBit offset is not an integer or out of range(ビットオフセットが整数でないか範囲外)
- ERR Protocol error: invalid multibulk lengthProtocol error: invalid multibulk length(プロトコルエラー: 無効な multibulk 長)
- ERR Number of keys can't be greater than number of argsEVAL/EVALSHA: numkeys exceeds argument count(numkeys が引数の数を超えている)
- ERR WATCH inside MULTI is not allowedWATCH inside MULTI is not allowed(MULTI 内の WATCH は許可されない)