복원 테스트 - 작동하지 않음

안녕하세요, 여러분이 아시는 그 버그 헌터, 지원팀을 골치 아프게 만드는 유저입니다.

오늘 오후에 복원을 테스트했는데, 두 번 다 아래 같은 오류가 발생했어요:

ERROR:  could not extend file "base/16384/3294755": wrote only 4096 of 8192 bytes at block 43985
HINT:  Check free disk space.
EXCEPTION: psql failed: HINT:  Check free disk space.
/var/www/discourse/lib/backup_restore/database_restorer.rb:92:in `restore_dump'
/var/www/discourse/lib/backup_restore/database_restorer.rb:26:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:51:in `run'
script/discourse:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Trying to rollback...
Rolling back...
Cleaning stuff up...
Dropping functions from the discourse_functions schema...
Removing tmp '/var/www/discourse/tmp/restores/default/2023-08-19-145440' directory...
Unpausing sidekiq...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

특히 아래 부분은 언급할 가치가 있어요.

Finished!
[FAILED]
Restore done.

이 부분은 좀 웃겼어요 :roll_eyes:
"별로 안 나쁘다"에서 “정말 최악이다” 사이의 척도로 본다면, 이건 정말 최악에 가까울 정도로 나쁘다고 할 수 있겠네요.

저는 스테이징 환경(테스트와 실험을 위해 별도로 사용하는 VM)에서 클린 작업을 수행한 후 복원을 시도했습니다:

  • launcher stop app
  • rm -rf /var/discourse/shared
  • launcher rebuild app

복원하려는 백업은 자동 복원 시스템이 생성한 마지막 백업으로, S3에 저장되어 있습니다.

이후 이메일로 제공된 링크를 통해 다운로드하고, 다음 가이드를 따라 복원을 수행했습니다:

백업 파일 크기는 10GB였습니다. 복원을 시작할 당시 VM에는 약 110GB의 여유 공간이 있었습니다.

수정: Discourse 버전 3.2.0.beta1-dev (fbf7b106cc)

디스크 공간이 부족합니다. 이 서버에 백업 크기의 최소 3배 이상 용량이 있는지 확인하세요.

아니요. 그것은 "흔한 문제"라는 의미의 "힌트"입니다.

당신의 답변 바로 위에 있는 게시물에 명시된 바와 같이:

백업은 10GB였습니다. 복원을 시작할 당시 VM에는 대략 110GB의 여유 공간이 있었습니다.

(읽기 편하도록 GB 단위로 이미지를 수정했습니다)

더 자세히 조사해 보니, 백업된 데이터에 문제가 있는 것 같습니다. 파일이 어떻게 손상되었거나, 조리 과정에서 무언가가 잘못되었을 수 있습니다.

파일 다운로드 과정에서 문제가 있는 가능성을 배제하기 위해, 다른 백업 파일을 다운로드하여 백업 파일 전체에 동일한 문제가 있는지 확인해 보겠습니다.

더 이상한 것은, 해당 주제와 메시지를 로드했을 때 discourse에서 실제로 문제가 전혀 없다는 점입니다. 문제없이 로드되고 렌더링됩니다.

수동으로 개입하여 해당 게시물을 수정했습니다. 다시 테스트하기 위해 이제 수동 백업을 시작합니다.