Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tootctl upgrade storage-schema misbehaving #13761

Merged
merged 1 commit into from
May 15, 2020

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented May 15, 2020

  • Fix not moving original files of custom emojis
  • Fix command failing to move any files with S3 storage
  • Fix command marking records as upgraded when move failed

Fix #13594

@Gargron Gargron added the bug Something isn't working label May 15, 2020
# Hopefully if this does happen, it happens for all styles, but if
# transfer of one or more of the styles fails, we should not mark
# the record as upgraded
attachment.instance_write(:storage_schema_version, CURRENT_STORAGE_SCHEMA_VERSION) if success
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an error occurs for one style and not the others, we'll have some files already moved, and re-running the task will always fail, right? Is there something sensible we can do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, what if only :original will determine whether upgrade failed or not, and the other styles will be ignored? Because you could re-generate other styles from :original as long as you had it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, ok, but we don't have anything to actually re-generate other styles, do we?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what paperclip's reprocess! does

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but there's nothing for an admin to run it, and it wouldn't get triggered automatically either, would it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but I still consider it fixable, e.g. you'd give the admin code to run in console.

@Gargron Gargron force-pushed the fix-tootctl-upgrade-storage-schema branch from 8175933 to 725433f Compare May 15, 2020 13:42
- Fix not moving original files of custom emojis
- Fix command failing to move any files with S3 storage
- Fix command marking records as upgraded when move failed

Fix #13594
@Gargron Gargron force-pushed the fix-tootctl-upgrade-storage-schema branch from 725433f to fb6f7a5 Compare May 15, 2020 14:43
@Gargron Gargron merged commit 2b91a3d into master May 15, 2020
@Gargron Gargron deleted the fix-tootctl-upgrade-storage-schema branch May 15, 2020 15:15
naaaaaaaaaaaf pushed a commit to Hostdon/mastodon that referenced this pull request May 25, 2020
- Fix not moving original files of custom emojis
- Fix command failing to move any files with S3 storage
- Fix command marking records as upgraded when move failed

Fix mastodon#13594
shouo1987 pushed a commit to CrossGate-Pawoo/mastodon that referenced this pull request Dec 7, 2022
- Fix not moving original files of custom emojis
- Fix command failing to move any files with S3 storage
- Fix command marking records as upgraded when move failed

Fix mastodon#13594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"tootctl upgrade storage-schema" fails to move "original" custom_emoji files to cache
2 participants