online_migrations 0.31.0 → 0.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4afb5d9ab9916861d263de3c38a2436d2ee131ae9988edf282866145a274356d
|
|
4
|
+
data.tar.gz: 761d30f417479db296429af0668bf62e47581aa4a73fce1d9ba72bd62c66173f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e6930e8069732e7988b731d826a9e82b023c8f4bbebd5827a31efa10747ada86af64e7e75553df5a8d2e318688002e9c194cdf07e9124ef4231986197d885e7
|
|
7
|
+
data.tar.gz: fe46acbfd31436293ead08b37258c877ca4eddf3bb6c41e462a74c89153d4f632e244c2fa5b98b0887fbfe024a3ab8a9ada8ad101fffb9bebfd10dbbd9f5c9bc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## master (unreleased)
|
|
2
2
|
|
|
3
|
+
## 0.31.2 (2025-11-13)
|
|
4
|
+
|
|
5
|
+
- Fix running background data migrations inline
|
|
6
|
+
|
|
7
|
+
## 0.31.1 (2025-11-11)
|
|
8
|
+
|
|
9
|
+
- Do not attempt running background migrations on database with `database_tasks: false`
|
|
10
|
+
|
|
3
11
|
## 0.31.0 (2025-10-22)
|
|
4
12
|
|
|
5
13
|
- Store backtraces for failed background data migrations jobs
|
|
@@ -37,7 +37,16 @@ module OnlineMigrations
|
|
|
37
37
|
# TODO: use 'cursor' accessor from sidekiq in the future.
|
|
38
38
|
# https://github.com/sidekiq/sidekiq/pull/6606
|
|
39
39
|
@migration.persist_progress(@_cursor, ticks, duration)
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
# When using a scheduler, these are running only from a single shard, but when inline -
|
|
42
|
+
# these are run from each shard (not needed, but simplifies the implementation).
|
|
43
|
+
#
|
|
44
|
+
# Do not reload the migration when running inline, because it can be from a different shard
|
|
45
|
+
# than the "default" shard (which is used to lookup background migrations).
|
|
46
|
+
if !Utils.run_background_migrations_inline?
|
|
47
|
+
# Reload to check if the migration's status changed etc.
|
|
48
|
+
@migration.reload
|
|
49
|
+
end
|
|
41
50
|
end
|
|
42
51
|
|
|
43
52
|
@throttle_checked_at = current_time
|
|
@@ -127,7 +127,14 @@ module OnlineMigrations
|
|
|
127
127
|
# This is the way that currently is used in ActiveRecord tests themselves.
|
|
128
128
|
pool_manager = ActiveRecord::Base.connection_handler.send(:get_pool_manager, ancestor.name)
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
if pool_manager
|
|
131
|
+
shards_with_database_tasks = pool_manager.shard_names.select do |shard_name|
|
|
132
|
+
pool_config = pool_manager.get_pool_config(:writing, shard_name)
|
|
133
|
+
pool_config.db_config.database_tasks? if pool_config
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
return shards_with_database_tasks
|
|
137
|
+
end
|
|
131
138
|
end
|
|
132
139
|
end
|
|
133
140
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: online_migrations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.31.
|
|
4
|
+
version: 0.31.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- fatkodima
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-
|
|
10
|
+
date: 2025-11-12 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activerecord
|