Skip to content

Commit

Permalink
Deal with collation-related index corruption (mastodon#14860)
Browse files Browse the repository at this point in the history
* Add tootctl maintenance fix-duplicates

This tool goes through the database to detect and fix duplicates.
This operation is very slow and may cause data loss (of data that would be
inaccessible without intervention because of the existing index corruptions).
It tries its best to make sensible decisions, and asks the user in some cases.

* Add warning message in db:migrate hook

* Clear Rails cache after being done with database deduplication

Avoids followers hash cache being incorrect, among other things
  • Loading branch information
ClearlyClaire committed Dec 6, 2020
1 parent a583e54 commit 7c522cd
Show file tree
Hide file tree
Showing 3 changed files with 625 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
require_relative 'mastodon/cache_cli'
require_relative 'mastodon/upgrade_cli'
require_relative 'mastodon/email_domain_blocks_cli'
require_relative 'mastodon/maintenance_cli'
require_relative 'mastodon/version'

module Mastodon
Expand Down Expand Up @@ -57,6 +58,9 @@ def self.exit_on_failure?
desc 'email_domain_blocks SUBCOMMAND ...ARGS', 'Manage e-mail domain blocks'
subcommand 'email_domain_blocks', Mastodon::EmailDomainBlocksCLI

desc 'maintenance SUBCOMMAND ...ARGS', 'Various maintenance utilities'
subcommand 'maintenance', Mastodon::MaintenanceCLI

option :dry_run, type: :boolean
desc 'self-destruct', 'Erase the server from the federation'
long_desc <<~LONG_DESC
Expand Down
Loading

0 comments on commit 7c522cd

Please sign in to comment.