Discourse 및 Discourse restore 실패로 인한 정지

백업에 동일한 이메일을 가진 두 명의 사용자가 있는 것 같습니다. 해당 사용자 중 한 명을 삭제하시거나, 이메일 주소를 변경한 뒤 새 백업을 생성하시겠습니까?

손상된 인덱스가 있습니다. 비슷한 문제를 겪은 적이 있었는데(다른 테이블과 인덱스였던 것 같습니다), 해결 과정을 Can't restore due to corrupt indexes (with some clues on how to deal with corrupt indexes) 에 설명해 두었습니다. 사용자의 해결 방법은 다를 수 있지만, 거기에 설명한 내용이 문제를 해결하는 데 도움이 될 수 있습니다.

@Dev_Work 님, 안녕하세요.

좋은 소식입니다.

여러 가지 옵션이 있습니다. 바로 떠오르는 것 중 두 가지만 소개해 드리겠습니다:

사용자 테이블을 분석하고 재인덱싱합니다:

VACUUM ANALYZE users;

그 다음 다음을 실행할 수 있습니다:

REINDEX VERBOSE TABLE users

이렇게 하면 “테이블별” 기준으로 분석 및 재인덱싱이 수행됩니다(위 예시에서는 “users”).

또한 데이터베이스 전체에 대해 동일한 작업을 수행할 수도 있습니다.

VACUUM;
REINDEX DATABASE discourse;

어떤 방법을 사용하든, "기존 DB"에 대해 REINDEX를 수행한 후 새로운 백업을 생성하고, 이를 "새로운 DB"로 복원했을 때 어떻게 되는지 확인해 볼 수 있습니다.

도움이 되길 바랍니다.

참고:

https://medium.com/@andreigridnev/db-maintenance-commands-in-postgresql-analyze-reindex-vacuum-4a14d75bee6c

이 오류가 발생하는 이유는 무엇인가요?

[STARTED]
'system' has started the restore!
Marking restore as running...
Making sure /var/www/discourse/tmp/restores/default/2020-08-26-075829 exists...
Copying archive to tmp directory...
Unzipping archive, this may take a while...
Extracting dump file...
EXCEPTION: No space left on device @ io_write - /shared/tmp/restores/default/2020-08-26-075829/dump.sql
/var/www/discourse/lib/compression/gzip.rb:50:in `write'
/var/www/discourse/lib/compression/gzip.rb:50:in `<<'
/var/www/discourse/lib/compression/gzip.rb:50:in `block in extract_file'
/var/www/discourse/lib/compression/gzip.rb:45:in `open'
/var/www/discourse/lib/compression/gzip.rb:45:in `extract_file'
/var/www/discourse/lib/compression/strategy.rb:26:in `block (2 levels) in decompress'
/var/www/discourse/lib/compression/strategy.rb:18:in `each'
/var/www/discourse/lib/compression/strategy.rb:18:in `block in decompress'
/var/www/discourse/lib/compression/gzip.rb:30:in `get_compressed_file_stream'
/var/www/discourse/lib/compression/strategy.rb:15:in `decompress'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:86:in `extract_db_dump'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:23:in `decompress'
/var/www/discourse/lib/backup_restore/restorer.rb:42:in `run'
script/discourse:143:in `restore'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
script/discourse:284:in `<top (required)>'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Trying to rollback...
There was no need to rollback
Cleaning stuff up...
Removing tmp '/var/www/discourse/tmp/restores/default/2020-08-26-075829' directory...
Unpausing sidekiq...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

솔직히, 아마도

:question: