Skip to content
Snippets Groups Projects
  1. Oct 02, 2017
    • aschmitz's avatar
      Make IdsToBigints (mostly!) non-blocking (#5088) · 97c02c33
      aschmitz authored
      * Make IdsToBigints (mostly!) non-blocking
      
      This pulls in GitLab's MigrationHelpers, which include code to make
      column changes in ways that Postgres can do without locking. In general,
      this involves creating a new column, adding an index and any foreign
      keys as appropriate, adding a trigger to keep it populated alongside
      the old column, and then progressively copying data over to the new
      column, before removing the old column and replacing it with the new
      one.
      
      A few changes to GitLab's MigrationHelpers were necessary:
      
      * Some changes were made to remove dependencies on other GitLab code.
      * We explicitly wait for index creation before forging ahead on column
        replacements.
      * We use different temporary column names, to avoid running into index
        name length limits.
      * We rename the generated indices back to what they "should" be after
        replacing columns.
      * We rename the generated foreign keys to use the new column names when
        we had to create them. (This allows the migration to be rolled back
        without incident.)
      
      # Big Scary Warning
      
      There are two things here that may trip up large instances:
      
      1. The change for tables' "id" columns is not concurrent. In
         particular, the stream_entries table may be big, and does not
         concurrently migrate its id column. (On the other hand, x_id type
         columns are all concurrent.)
      2. This migration will take a long time to run, *but it should not
         lock tables during that time* (with the exception of the "id"
         columns as described above). That means this should probably be run
         in `screen` or some other session that can be run for a long time.
         Notably, the migration will take *longer* than it would without
         these changes, but the website will still be responsive during that
         time.
      
      These changes were tested on a relatively large statuses table (256k
      entries), and the service remained responsive during the migration.
      Migrations both forward and backward were tested.
      
      * Rubocop fixes
      
      * MigrationHelpers: Support ID columns in some cases
      
      This doesn't work in cases where the ID column is referred to as a
      foreign key by another table.
      
      * MigrationHelpers: support foreign keys for ID cols
      
      Note that this does not yet support foreign keys on non-primary-key
      columns, but Mastodon also doesn't yet have any that we've needed to
      migrate.
      
      This means we can perform fully "concurrent" migrations to change ID
      column types, and the IdsToBigints migration can happen with effectively
      no downtime. (A few operations require a transaction, such as renaming
      columns or deleting them, but these transactions should not block for
      noticeable amounts of time.)
      
      The algorithm for generating foreign key names has changed with this,
      and therefore all of those changed in schema.rb.
      
      * Provide status, allow for interruptions
      
      The MigrationHelpers now allow restarting the rename of a column if it
      was interrupted, by removing the old "new column" and re-starting the
      process.
      
      Along with this, they now provide status updates on the changes which
      are happening, as well as indications about when the changes can be
      safely interrupted (when there are at least 10 seconds estimated to be
      left before copying data is complete).
      
      The IdsToBigints migration now also sorts the columns it migrates by
      size, starting with the largest tables. This should provide
      administrators a worst-case scenario estimate for the length of
      migrations: each successive change will get faster, giving admins a
      chance to abort early on if they need to run the migration later. The
      idea is that this does not force them to try to time interruptions
      between smaller migrations.
      
      * Fix column sorting in IdsToBigints
      
      Not a significant change, but it impacts the order of columns in the
      database and db/schema.rb.
      
      * Actually pause before IdsToBigints
      97c02c33
  2. Sep 27, 2017
  3. Sep 26, 2017
  4. Sep 25, 2017
  5. Sep 23, 2017
    • Eugen Rochko's avatar
      Add emoji autosuggest (#5053) · 1e02ba11
      Eugen Rochko authored
      * Add emoji autosuggest
      
      Some credit goes to glitch-soc/mastodon#149
      
      * Remove server-side shortcode->unicode conversion
      
      * Insert shortcode when suggestion is custom emoji
      
      * Remove remnant of server-side emojis
      
      * Update style of autosuggestions
      
      * Fix wrong emoji filenames generated in autosuggest item
      
      * Do not lazy load emoji picker, as that no longer works
      
      * Fix custom emoji autosuggest
      
      * Fix multiple "Custom" categories getting added to emoji index, only add once
      1e02ba11
  6. Sep 16, 2017
  7. Sep 14, 2017
    • abcang's avatar
      Revert unique retry job (#4937) · 1aad015b
      abcang authored
      * Revert "Enable UniqueRetryJobMiddleware even when called from sidekiq worker (#4836)"
      
      This reverts commit 6859d4c0.
      
      * Revert "Do not execute the job with the same arguments as the retry job (#4814)"
      
      This reverts commit be7ffa2d.
      1aad015b
  8. Sep 11, 2017
    • Eugen Rochko's avatar
      Fix count numbers from ActivityPub not being saved (#4899) · 0a6b0986
      Eugen Rochko authored
      They are marked as read-only by Rails, but we know what we are doing,
      so we are un-marking them as such.
      
      The mastodon:maintenance:update_counter_caches task is not really
      supposed to be run anymore (it was a one-time thing during an upgrade)
      however, just in case, I have modified it to not touch ActivityPub
      accounts.
      
      Also, no point writing to logger from these rake tasks, since they
      are not to be run from cron. Better to give stdout feedback.
      0a6b0986
  9. Sep 10, 2017
  10. Sep 09, 2017
  11. Sep 07, 2017
    • Joseph Mingrone's avatar
      Use casecmp() instead of casecmp?() for now (#4832) · 52644962
      Joseph Mingrone authored
      * Use casecmp() instead of casecmp?() for now
      
      casecmp?() is only available in ruby 2.4.0.  Users running earlier ruby versions
      would see errors, e.g., running
      RAILS_ENV=production rails mastodon:maintenance:remove_deprecated_preview_cards.
      
      * Correctly check whether casecmp() returns 0
      52644962
  12. Sep 06, 2017
  13. Sep 05, 2017
  14. Sep 03, 2017
  15. Sep 02, 2017
  16. Sep 01, 2017
    • Eugen Rochko's avatar
      Make PreviewCard records reuseable between statuses (#4642) · 7dc50350
      Eugen Rochko authored
      * Make PreviewCard records reuseable between statuses
      
      **Warning!** Migration truncates preview_cards tablec
      
      * Allow a wider thumbnail for link preview, display it in horizontal layout (#4648)
      
      * Delete preview cards files before truncating
      
      * Rename old table instead of truncating it
      
      * Add mastodon:maintenance:remove_deprecated_preview_cards
      
      * Ignore deprecated_preview_cards in schema definition
      
      * Fix null behaviour
      7dc50350
  17. Aug 26, 2017
  18. Aug 22, 2017
  19. Aug 20, 2017
    • Eugen Rochko's avatar
      ActivityPub migration procedure (#4617) · 6e9eda53
      Eugen Rochko authored
      * ActivityPub migration procedure
      
      Once one account is detected as going from OStatus to ActivityPub,
      invalidate WebFinger cache for other accounts from the same domain
      
      * Unsubscribe from PuSH updates once we receive an ActivityPub payload
      
      * Re-subscribe to PuSH unless already unsubscribed, regardless of protocol
      6e9eda53
  20. Aug 06, 2017
  21. Aug 01, 2017
  22. Jul 31, 2017
  23. Jul 28, 2017
  24. Jul 24, 2017
  25. Jul 22, 2017
  26. Jul 21, 2017
  27. Jul 16, 2017
  28. Jul 14, 2017
  29. Jul 11, 2017
    • Eugen Rochko's avatar
      Fix #2848 - Rake task to redownload avatars/headers (#4156) · e6c81a63
      Eugen Rochko authored
      Can be filtered by a specific domain
      Resolves #2292
      e6c81a63
    • Eugen Rochko's avatar
      Redesign the landing page, mount public timeline on it (#4122) · e19eefe2
      Eugen Rochko authored
      * Redesign the landing page, mount public timeline on it
      
      * Adjust the standalone mounted component to the lacking of router
      
      * Adjust auth layout pages to new design
      
      * Fix tests
      
      * Standalone public timeline polling every 5 seconds
      
      * Remove now obsolete translations
      
      * Add responsive design for new landing page
      
      * Address reviews
      
      * Add floating clouds behind frontpage form
      
      * Use access token from public page when available
      
      * Fix mentions and hashtags links, cursor on status content in standalone mode
      
      * Add footer link to source code
      
      * Fix errors on pages that don't embed the component, use classnames
      
      * Fix tests
      
      * Change anonymous autoPlayGif default to false
      
      * When gif autoplay is disabled, hover to play
      
      * Add option to hide the timeline preview
      
      * Slightly improve alt layout
      
      * Add elephant friend to new frontpage
      
      * Display "back to mastodon" in place of "login" when logged in on frontpage
      
      * Change polling time to 3s
      e19eefe2
  30. Jun 28, 2017
Loading