0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/spec/lib/backup_restore
Alan Guo Xiang Tan 30896b6d0e
PERF: Run primary and parallel DB setup concurrently in CI (#40319)
Reattempt of #40294, which was reverted in #40301 because two concurrent
processes raced on plugin symlink creation in
`Discourse::Utils.atomic_ln_s`. The first commit here fixes that race at
the source by serializing the check-and-replace with a file lock and
switching to `File.rename` (atomic on POSIX, doesn't follow symlinks at
the destination). A stress test of the previous implementation failed
15/16 workers under contention; the new implementation passes 5/5 stress
runs and 5/5 end-to-end CI-like runs locally with `LOAD_PLUGINS=1`.

The second commit is the parallelization itself: the two CI
database-setup steps run concurrently through GNU `parallel` instead of
one after the other. It also adds `Discourse.test_env_number` to align
the `TEST_ENV_NUMBER=""` interpretation across `FileStore::BaseStore`,
`Stylesheet::Manager`, `S3Helper`, and `BackupRestore::S3BackupStore`
with `config/boot.rb` — without this, the gem's first worker and the
primary process would race on `public/uploads/default/test_0/`.
2026-05-29 06:46:32 +08:00
..
backup_file_handler_multisite_spec.rb
backup_file_handler_spec.rb FIX: Handle restore URLs ending with query params (#33384) 2025-07-07 18:43:31 +03:00
creator_spec.rb DEV: Rename Backuper to Creator 2026-01-22 18:46:02 +00:00
database_restorer_multisite_spec.rb
database_restorer_spec.rb FIX: Remove unsupported SQL from DB dump during restore 2025-11-03 11:15:00 +01:00
local_backup_store_spec.rb SECURITY: block cross-site backup traversal in multisite local storage 2026-05-19 00:26:04 +01:00
meta_data_handler_spec.rb
s3_backup_store_spec.rb DEV: Bump aws-sdk-core in prep for aws-sdk-mediaconvert (#33250) 2025-06-20 16:41:01 -06:00
shared_context_for_backup_restore.rb FEATURE: Add utilities for importing and exporting backups (#32992) 2025-06-11 15:44:10 +03:00
shared_examples_for_backup_store.rb FIX: Use a valid value for disabling backups using backup_frequency (#34245) 2025-08-12 13:19:56 +08:00
system_interface_multisite_spec.rb
system_interface_spec.rb DEV: Upgrade Sidekiq to v7.3.9 2025-03-10 15:02:48 +01:00
uploads_restorer_spec.rb PERF: Run primary and parallel DB setup concurrently in CI (#40319) 2026-05-29 06:46:32 +08:00