lhm-shopify 3.5.5 → 4.1.0
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 +4 -4
- data/.github/workflows/test.yml +20 -18
- data/Appraisals +8 -19
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +37 -20
- data/README.md +21 -14
- data/dev.yml +12 -8
- data/docker-compose-mysql-5.7.yml +1 -0
- data/docker-compose-mysql-8.0.yml +63 -0
- data/docker-compose.yml +5 -3
- data/gemfiles/activerecord_6.1.gemfile +1 -0
- data/gemfiles/activerecord_6.1.gemfile.lock +23 -13
- data/gemfiles/{activerecord_7.0.0.alpha2.gemfile → activerecord_7.0.gemfile} +2 -1
- data/gemfiles/{activerecord_7.0.0.alpha2.gemfile.lock → activerecord_7.0.gemfile.lock} +29 -19
- data/gemfiles/{activerecord_6.0.gemfile → activerecord_7.1.gemfile} +1 -1
- data/gemfiles/activerecord_7.1.gemfile.lock +83 -0
- data/lhm.gemspec +2 -1
- data/lib/lhm/atomic_switcher.rb +3 -3
- data/lib/lhm/chunker.rb +4 -4
- data/lib/lhm/connection.rb +9 -1
- data/lib/lhm/sql_helper.rb +1 -1
- data/lib/lhm/sql_retry.rb +36 -18
- data/lib/lhm/table.rb +3 -4
- data/lib/lhm/throttler/replica_lag.rb +166 -0
- data/lib/lhm/throttler/slave_lag.rb +5 -155
- data/lib/lhm/throttler/threads_running.rb +3 -1
- data/lib/lhm/throttler.rb +7 -3
- data/lib/lhm/version.rb +1 -1
- data/scripts/helpers/wait-for-dbs.sh +3 -3
- data/scripts/mysql/writer/create_users.sql +1 -1
- data/spec/.lhm.example +1 -1
- data/spec/README.md +8 -9
- data/spec/integration/atomic_switcher_spec.rb +6 -10
- data/spec/integration/chunk_insert_spec.rb +2 -2
- data/spec/integration/chunker_spec.rb +54 -44
- data/spec/integration/database.yml +4 -4
- data/spec/integration/entangler_spec.rb +4 -4
- data/spec/integration/integration_helper.rb +23 -15
- data/spec/integration/lhm_spec.rb +70 -44
- data/spec/integration/locked_switcher_spec.rb +2 -2
- data/spec/integration/proxysql_spec.rb +10 -10
- data/spec/integration/sql_retry/db_connection_helper.rb +2 -4
- data/spec/integration/sql_retry/lock_wait_spec.rb +7 -8
- data/spec/integration/sql_retry/lock_wait_timeout_test_helper.rb +18 -10
- data/spec/integration/sql_retry/proxysql_helper.rb +1 -1
- data/spec/integration/sql_retry/retry_with_proxysql_spec.rb +1 -2
- data/spec/integration/table_spec.rb +1 -1
- data/spec/integration/toxiproxy_helper.rb +1 -1
- data/spec/test_helper.rb +27 -3
- data/spec/unit/atomic_switcher_spec.rb +2 -2
- data/spec/unit/chunker_spec.rb +43 -43
- data/spec/unit/connection_spec.rb +2 -2
- data/spec/unit/entangler_spec.rb +14 -24
- data/spec/unit/printer_spec.rb +2 -6
- data/spec/unit/sql_helper_spec.rb +2 -2
- data/spec/unit/throttler/{slave_lag_spec.rb → replica_lag_spec.rb} +84 -92
- data/spec/unit/throttler/threads_running_spec.rb +18 -0
- data/spec/unit/throttler_spec.rb +8 -8
- metadata +26 -12
- data/.travis.yml +0 -21
- data/gemfiles/activerecord_5.2.gemfile +0 -9
- data/gemfiles/activerecord_5.2.gemfile.lock +0 -65
- data/gemfiles/activerecord_6.0.gemfile.lock +0 -67
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__)) + '/../unit_helper'
|
2
2
|
|
3
|
-
require 'lhm/throttler/
|
3
|
+
require 'lhm/throttler/replica_lag'
|
4
4
|
|
5
5
|
describe Lhm::Throttler do
|
6
6
|
include UnitHelper
|
@@ -32,7 +32,7 @@ describe Lhm::Throttler do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
describe Lhm::Throttler::
|
35
|
+
describe Lhm::Throttler::Replica do
|
36
36
|
include UnitHelper
|
37
37
|
|
38
38
|
before :each do
|
@@ -43,31 +43,23 @@ describe Lhm::Throttler::Slave do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
describe "#client" do
|
46
|
-
before do
|
47
|
-
class TestMysql2Client
|
48
|
-
def initialize(config)
|
49
|
-
raise Mysql2::Error.new("connection error")
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
46
|
describe 'on connection error' do
|
55
47
|
it 'logs and returns nil' do
|
56
|
-
assert_nil(Lhm::Throttler::
|
48
|
+
assert_nil(Lhm::Throttler::Replica.new('replica', @dummy_mysql_client_config).connection)
|
57
49
|
|
58
50
|
log_messages = @logs.string.lines
|
59
51
|
assert_equal(2, log_messages.length)
|
60
|
-
assert log_messages[0].include? "Connecting to
|
61
|
-
assert log_messages[1].include? "Error connecting to
|
52
|
+
assert log_messages[0].include? "Connecting to replica on database: db"
|
53
|
+
assert log_messages[1].include? "Error connecting to replica"
|
62
54
|
end
|
63
55
|
end
|
64
56
|
|
65
57
|
describe 'with proper config' do
|
66
|
-
it "creates a new
|
67
|
-
expected_config = { username: 'user', password: 'pw', database: 'db', host: '
|
68
|
-
|
58
|
+
it "creates a new database client" do
|
59
|
+
expected_config = { username: 'user', password: 'pw', database: 'db', host: 'replica' }
|
60
|
+
DATABASE.client.stubs(:new).with(expected_config).returns(mock())
|
69
61
|
|
70
|
-
assert Lhm::Throttler::
|
62
|
+
assert Lhm::Throttler::Replica.new('replica', @dummy_mysql_client_config).connection
|
71
63
|
end
|
72
64
|
end
|
73
65
|
|
@@ -80,13 +72,13 @@ describe Lhm::Throttler::Slave do
|
|
80
72
|
ActiveRecord::Base.stubs(:connection_pool).returns(stub(spec: stub(config: active_record_config)))
|
81
73
|
end
|
82
74
|
|
83
|
-
|
75
|
+
DATABASE.client.stubs(:new).returns(mock())
|
84
76
|
|
85
|
-
assert Lhm::Throttler::
|
77
|
+
assert Lhm::Throttler::Replica.new('replica').connection
|
86
78
|
|
87
79
|
log_messages = @logs.string.lines
|
88
80
|
assert_equal(1, log_messages.length)
|
89
|
-
assert log_messages[0].include? "Connecting to
|
81
|
+
assert log_messages[0].include? "Connecting to replica on database: db"
|
90
82
|
end
|
91
83
|
end
|
92
84
|
end
|
@@ -95,16 +87,16 @@ describe Lhm::Throttler::Slave do
|
|
95
87
|
before do
|
96
88
|
class Connection
|
97
89
|
def self.query(query)
|
98
|
-
if query == Lhm::Throttler::
|
90
|
+
if query == Lhm::Throttler::Replica::SQL_SELECT_MAX_REPLICA_LAG
|
99
91
|
[{ 'Seconds_Behind_Master' => 20 }]
|
100
|
-
elsif query == Lhm::Throttler::
|
92
|
+
elsif query == Lhm::Throttler::Replica::SQL_SELECT_REPLICA_HOSTS
|
101
93
|
[{ 'host' => '1.1.1.1:80' }]
|
102
94
|
end
|
103
95
|
end
|
104
96
|
end
|
105
97
|
|
106
|
-
@
|
107
|
-
@
|
98
|
+
@replica = Lhm::Throttler::Replica.new('replica', @dummy_mysql_client_config)
|
99
|
+
@replica.instance_variable_set(:@connection, Connection)
|
108
100
|
|
109
101
|
class StoppedConnection
|
110
102
|
def self.query(query)
|
@@ -112,54 +104,54 @@ describe Lhm::Throttler::Slave do
|
|
112
104
|
end
|
113
105
|
end
|
114
106
|
|
115
|
-
@
|
116
|
-
@
|
107
|
+
@stopped_replica = Lhm::Throttler::Replica.new('stopped_replica', @dummy_mysql_client_config)
|
108
|
+
@stopped_replica.instance_variable_set(:@connection, StoppedConnection)
|
117
109
|
end
|
118
110
|
|
119
111
|
describe "#lag" do
|
120
|
-
it "returns the
|
121
|
-
assert_equal(20, @
|
112
|
+
it "returns the replica lag" do
|
113
|
+
assert_equal(20, @replica.lag)
|
122
114
|
end
|
123
115
|
end
|
124
116
|
|
125
|
-
describe "#lag with a stopped
|
126
|
-
it "returns 0
|
127
|
-
assert_equal(0, @
|
117
|
+
describe "#lag with a stopped replica" do
|
118
|
+
it "returns 0 replica lag" do
|
119
|
+
assert_equal(0, @stopped_replica.lag)
|
128
120
|
end
|
129
121
|
end
|
130
122
|
|
131
|
-
describe "#
|
123
|
+
describe "#replica_hosts" do
|
132
124
|
it "returns the hosts" do
|
133
|
-
assert_equal(['1.1.1.1'], @
|
125
|
+
assert_equal(['1.1.1.1'], @replica.replica_hosts)
|
134
126
|
end
|
135
127
|
end
|
136
128
|
|
137
129
|
describe "#lag on connection error" do
|
138
|
-
it "logs and returns 0
|
130
|
+
it "logs and returns 0 replica lag" do
|
139
131
|
client = mock()
|
140
|
-
client.stubs(:query).raises(
|
141
|
-
Lhm::Throttler::
|
142
|
-
Lhm::Throttler::
|
132
|
+
client.stubs(:query).raises(DATABASE.error_class, "Can't connect to MySQL server")
|
133
|
+
Lhm::Throttler::Replica.any_instance.stubs(:client).returns(client)
|
134
|
+
Lhm::Throttler::Replica.any_instance.stubs(:config).returns([])
|
143
135
|
|
144
|
-
|
145
|
-
Logger.any_instance.expects(:info).with("Unable to connect and/or query
|
146
|
-
assert_equal(0,
|
136
|
+
replica = Lhm::Throttler::Replica.new('replica', @dummy_mysql_client_config)
|
137
|
+
Logger.any_instance.expects(:info).with("Unable to connect and/or query replica: Can't connect to MySQL server")
|
138
|
+
assert_equal(0, replica.lag)
|
147
139
|
end
|
148
140
|
end
|
149
141
|
end
|
150
142
|
end
|
151
143
|
|
152
|
-
describe Lhm::Throttler::
|
144
|
+
describe Lhm::Throttler::ReplicaLag do
|
153
145
|
include UnitHelper
|
154
146
|
|
155
147
|
before :each do
|
156
|
-
@throttler = Lhm::Throttler::
|
148
|
+
@throttler = Lhm::Throttler::ReplicaLag.new
|
157
149
|
end
|
158
150
|
|
159
151
|
describe '#throttle_seconds' do
|
160
|
-
describe 'with no
|
152
|
+
describe 'with no replica lag' do
|
161
153
|
before do
|
162
|
-
def @throttler.
|
154
|
+
def @throttler.max_current_replica_lag
|
163
155
|
0
|
164
156
|
end
|
165
157
|
end
|
@@ -170,9 +162,9 @@ describe Lhm::Throttler::SlaveLag do
|
|
170
162
|
end
|
171
163
|
end
|
172
164
|
|
173
|
-
describe 'with a large
|
165
|
+
describe 'with a large replica lag' do
|
174
166
|
before do
|
175
|
-
def @throttler.
|
167
|
+
def @throttler.max_current_replica_lag
|
176
168
|
100
|
177
169
|
end
|
178
170
|
end
|
@@ -183,14 +175,14 @@ describe Lhm::Throttler::SlaveLag do
|
|
183
175
|
end
|
184
176
|
|
185
177
|
it 'does not increase the timeout past the maximum' do
|
186
|
-
@throttler.timeout_seconds = Lhm::Throttler::
|
187
|
-
assert_equal(Lhm::Throttler::
|
178
|
+
@throttler.timeout_seconds = Lhm::Throttler::ReplicaLag::MAX_TIMEOUT
|
179
|
+
assert_equal(Lhm::Throttler::ReplicaLag::MAX_TIMEOUT, @throttler.send(:throttle_seconds))
|
188
180
|
end
|
189
181
|
end
|
190
182
|
|
191
|
-
describe 'with no
|
183
|
+
describe 'with no replica lag after it has previously been increased' do
|
192
184
|
before do
|
193
|
-
def @throttler.
|
185
|
+
def @throttler.max_current_replica_lag
|
194
186
|
0
|
195
187
|
end
|
196
188
|
end
|
@@ -202,56 +194,56 @@ describe Lhm::Throttler::SlaveLag do
|
|
202
194
|
end
|
203
195
|
|
204
196
|
it 'does not decrease the timeout past the minimum on repeated runs' do
|
205
|
-
@throttler.timeout_seconds = Lhm::Throttler::
|
206
|
-
assert_equal(Lhm::Throttler::
|
207
|
-
assert_equal(Lhm::Throttler::
|
197
|
+
@throttler.timeout_seconds = Lhm::Throttler::ReplicaLag::INITIAL_TIMEOUT * 2
|
198
|
+
assert_equal(Lhm::Throttler::ReplicaLag::INITIAL_TIMEOUT, @throttler.send(:throttle_seconds))
|
199
|
+
assert_equal(Lhm::Throttler::ReplicaLag::INITIAL_TIMEOUT, @throttler.send(:throttle_seconds))
|
208
200
|
end
|
209
201
|
end
|
210
202
|
end
|
211
203
|
|
212
|
-
describe '#
|
213
|
-
describe 'with multiple
|
204
|
+
describe '#max_current_replica_lag' do
|
205
|
+
describe 'with multiple replicas' do
|
214
206
|
it 'returns the largest amount of lag' do
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
Lhm::Throttler::
|
220
|
-
assert_equal 5, @throttler.send(:
|
207
|
+
replica1 = mock()
|
208
|
+
replica2 = mock()
|
209
|
+
replica1.stubs(:lag).returns(5)
|
210
|
+
replica2.stubs(:lag).returns(0)
|
211
|
+
Lhm::Throttler::ReplicaLag.any_instance.stubs(:replicas).returns([replica1, replica2])
|
212
|
+
assert_equal 5, @throttler.send(:max_current_replica_lag)
|
221
213
|
end
|
222
214
|
end
|
223
215
|
|
224
|
-
describe 'with MySQL stopped on the
|
225
|
-
it 'assumes 0
|
216
|
+
describe 'with MySQL stopped on the replica' do
|
217
|
+
it 'assumes 0 replica lag' do
|
226
218
|
client = mock()
|
227
|
-
client.stubs(:query).raises(
|
228
|
-
Lhm::Throttler::
|
219
|
+
client.stubs(:query).raises(DATABASE.error_class, "Can't connect to MySQL server")
|
220
|
+
Lhm::Throttler::Replica.any_instance.stubs(:client).returns(client)
|
229
221
|
|
230
|
-
Lhm::Throttler::
|
231
|
-
Lhm::Throttler::
|
232
|
-
@throttler.stubs(:
|
222
|
+
Lhm::Throttler::Replica.any_instance.stubs(:prepare_connection_config).returns([])
|
223
|
+
Lhm::Throttler::Replica.any_instance.stubs(:replica_hosts).returns(['1.1.1.2'])
|
224
|
+
@throttler.stubs(:master_replica_hosts).returns(['1.1.1.1'])
|
233
225
|
|
234
|
-
assert_equal 0, @throttler.send(:
|
226
|
+
assert_equal 0, @throttler.send(:max_current_replica_lag)
|
235
227
|
end
|
236
228
|
end
|
237
229
|
end
|
238
230
|
|
239
|
-
describe '#
|
240
|
-
describe 'with no
|
231
|
+
describe '#get_replicas' do
|
232
|
+
describe 'with no replicas' do
|
241
233
|
before do
|
242
|
-
def @throttler.
|
234
|
+
def @throttler.master_replica_hosts
|
243
235
|
[]
|
244
236
|
end
|
245
237
|
end
|
246
238
|
|
247
|
-
it 'returns no
|
248
|
-
assert_equal([], @throttler.send(:
|
239
|
+
it 'returns no replicas' do
|
240
|
+
assert_equal([], @throttler.send(:get_replicas))
|
249
241
|
end
|
250
242
|
end
|
251
243
|
|
252
|
-
describe 'with multiple
|
244
|
+
describe 'with multiple replicas' do
|
253
245
|
before do
|
254
|
-
class
|
246
|
+
class TestReplica
|
255
247
|
attr_reader :host, :connection
|
256
248
|
|
257
249
|
def initialize(host, _)
|
@@ -259,7 +251,7 @@ describe Lhm::Throttler::SlaveLag do
|
|
259
251
|
@connection = 'conn' if @host
|
260
252
|
end
|
261
253
|
|
262
|
-
def
|
254
|
+
def replica_hosts
|
263
255
|
if @host == '1.1.1.1'
|
264
256
|
['1.1.1.2', '1.1.1.3']
|
265
257
|
else
|
@@ -268,21 +260,21 @@ describe Lhm::Throttler::SlaveLag do
|
|
268
260
|
end
|
269
261
|
end
|
270
262
|
|
271
|
-
@
|
272
|
-
|
263
|
+
@create_replica = lambda { |host, config|
|
264
|
+
TestReplica.new(host, config)
|
273
265
|
}
|
274
266
|
end
|
275
267
|
|
276
268
|
describe 'without the :check_only option' do
|
277
269
|
before do
|
278
|
-
def @throttler.
|
270
|
+
def @throttler.master_replica_hosts
|
279
271
|
['1.1.1.1', '1.1.1.4']
|
280
272
|
end
|
281
273
|
end
|
282
274
|
|
283
|
-
it 'returns the
|
284
|
-
Lhm::Throttler::
|
285
|
-
assert_equal(["1.1.1.4", "1.1.1.1", "1.1.1.3", "1.1.1.2"], @throttler.send(:
|
275
|
+
it 'returns the replica instances' do
|
276
|
+
Lhm::Throttler::Replica.stubs(:new).returns(@create_replica) do
|
277
|
+
assert_equal(["1.1.1.4", "1.1.1.1", "1.1.1.3", "1.1.1.2"], @throttler.send(:get_replicas).map(&:host))
|
286
278
|
end
|
287
279
|
end
|
288
280
|
end
|
@@ -291,28 +283,28 @@ describe Lhm::Throttler::SlaveLag do
|
|
291
283
|
describe 'with a callable argument' do
|
292
284
|
before do
|
293
285
|
check_only = lambda { { 'host' => '1.1.1.3' } }
|
294
|
-
@throttler = Lhm::Throttler::
|
286
|
+
@throttler = Lhm::Throttler::ReplicaLag.new :check_only => check_only
|
295
287
|
end
|
296
288
|
|
297
|
-
it 'returns only that single
|
298
|
-
Lhm::Throttler::
|
299
|
-
assert_equal ['1.1.1.3'], @throttler.send(:
|
289
|
+
it 'returns only that single replica' do
|
290
|
+
Lhm::Throttler::Replica.stubs(:new).returns(@create_replica) do
|
291
|
+
assert_equal ['1.1.1.3'], @throttler.send(:get_replicas).map(&:host)
|
300
292
|
end
|
301
293
|
end
|
302
294
|
end
|
303
295
|
|
304
296
|
describe 'with a non-callable argument' do
|
305
297
|
before do
|
306
|
-
@throttler = Lhm::Throttler::
|
298
|
+
@throttler = Lhm::Throttler::ReplicaLag.new :check_only => 'I cannot be called'
|
307
299
|
|
308
|
-
def @throttler.
|
300
|
+
def @throttler.master_replica_hosts
|
309
301
|
['1.1.1.1', '1.1.1.4']
|
310
302
|
end
|
311
303
|
end
|
312
304
|
|
313
|
-
it 'returns all the
|
314
|
-
Lhm::Throttler::
|
315
|
-
assert_equal(["1.1.1.4", "1.1.1.1", "1.1.1.3", "1.1.1.2"], @throttler.send(:
|
305
|
+
it 'returns all the replica instances' do
|
306
|
+
Lhm::Throttler::Replica.stubs(:new).returns(@create_replica) do
|
307
|
+
assert_equal(["1.1.1.4", "1.1.1.1", "1.1.1.3", "1.1.1.2"], @throttler.send(:get_replicas).map(&:host))
|
316
308
|
end
|
317
309
|
end
|
318
310
|
end
|
@@ -9,6 +9,24 @@ describe Lhm::Throttler::ThreadsRunning do
|
|
9
9
|
@throttler = Lhm::Throttler::ThreadsRunning.new
|
10
10
|
end
|
11
11
|
|
12
|
+
describe '#stride' do
|
13
|
+
describe 'default value' do
|
14
|
+
it 'is present' do
|
15
|
+
assert_equal(@throttler.stride, 2_000)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'when set by user' do
|
20
|
+
before do
|
21
|
+
@throttler = Lhm::Throttler::ThreadsRunning.new(stride: 100_500)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns that value' do
|
25
|
+
assert_equal(@throttler.stride, 100_500)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
12
30
|
describe '#throttle_seconds' do
|
13
31
|
describe 'with no mysql activity' do
|
14
32
|
before do
|
data/spec/unit/throttler_spec.rb
CHANGED
@@ -31,13 +31,13 @@ describe Lhm::Throttler do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe 'when passing a
|
34
|
+
describe 'when passing a replica_lag_throttler key' do
|
35
35
|
before do
|
36
|
-
@mock.setup_throttler(:
|
36
|
+
@mock.setup_throttler(:replica_lag_throttler, allowed_lag: 20)
|
37
37
|
end
|
38
38
|
|
39
|
-
it 'instantiates the
|
40
|
-
value(@mock.throttler.class).must_equal Lhm::Throttler::
|
39
|
+
it 'instantiates the replica_lag throttle' do
|
40
|
+
value(@mock.throttler.class).must_equal Lhm::Throttler::ReplicaLag
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'returns 20 seconds as allowed_lag' do
|
@@ -66,10 +66,10 @@ describe Lhm::Throttler do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
describe 'when passing a
|
69
|
+
describe 'when passing a replica_lag_throttler instance' do
|
70
70
|
|
71
71
|
before do
|
72
|
-
@instance = Lhm::Throttler::
|
72
|
+
@instance = Lhm::Throttler::ReplicaLag.new
|
73
73
|
def @instance.timeout_seconds
|
74
74
|
0
|
75
75
|
end
|
@@ -98,10 +98,10 @@ describe Lhm::Throttler do
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
-
describe 'when passing a
|
101
|
+
describe 'when passing a replica_lag_throttler class' do
|
102
102
|
|
103
103
|
before do
|
104
|
-
@klass = Class.new(Lhm::Throttler::
|
104
|
+
@klass = Class.new(Lhm::Throttler::ReplicaLag)
|
105
105
|
@mock.setup_throttler(@klass)
|
106
106
|
end
|
107
107
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhm-shopify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SoundCloud
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2023-10-12 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: retriable
|
@@ -112,6 +112,20 @@ dependencies:
|
|
112
112
|
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: trilogy
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
115
129
|
- !ruby/object:Gem::Dependency
|
116
130
|
name: simplecov
|
117
131
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +193,6 @@ files:
|
|
179
193
|
- ".github/workflows/test.yml"
|
180
194
|
- ".gitignore"
|
181
195
|
- ".rubocop.yml"
|
182
|
-
- ".travis.yml"
|
183
196
|
- Appraisals
|
184
197
|
- CHANGELOG.md
|
185
198
|
- Gemfile
|
@@ -188,15 +201,15 @@ files:
|
|
188
201
|
- README.md
|
189
202
|
- Rakefile
|
190
203
|
- dev.yml
|
204
|
+
- docker-compose-mysql-5.7.yml
|
205
|
+
- docker-compose-mysql-8.0.yml
|
191
206
|
- docker-compose.yml
|
192
|
-
- gemfiles/activerecord_5.2.gemfile
|
193
|
-
- gemfiles/activerecord_5.2.gemfile.lock
|
194
|
-
- gemfiles/activerecord_6.0.gemfile
|
195
|
-
- gemfiles/activerecord_6.0.gemfile.lock
|
196
207
|
- gemfiles/activerecord_6.1.gemfile
|
197
208
|
- gemfiles/activerecord_6.1.gemfile.lock
|
198
|
-
- gemfiles/activerecord_7.0.
|
199
|
-
- gemfiles/activerecord_7.0.
|
209
|
+
- gemfiles/activerecord_7.0.gemfile
|
210
|
+
- gemfiles/activerecord_7.0.gemfile.lock
|
211
|
+
- gemfiles/activerecord_7.1.gemfile
|
212
|
+
- gemfiles/activerecord_7.1.gemfile.lock
|
200
213
|
- lhm.gemspec
|
201
214
|
- lib/lhm-shopify.rb
|
202
215
|
- lib/lhm.rb
|
@@ -222,6 +235,7 @@ files:
|
|
222
235
|
- lib/lhm/table_name.rb
|
223
236
|
- lib/lhm/test_support.rb
|
224
237
|
- lib/lhm/throttler.rb
|
238
|
+
- lib/lhm/throttler/replica_lag.rb
|
225
239
|
- lib/lhm/throttler/slave_lag.rb
|
226
240
|
- lib/lhm/throttler/threads_running.rb
|
227
241
|
- lib/lhm/throttler/time.rb
|
@@ -282,7 +296,7 @@ files:
|
|
282
296
|
- spec/unit/sql_helper_spec.rb
|
283
297
|
- spec/unit/table_name_spec.rb
|
284
298
|
- spec/unit/table_spec.rb
|
285
|
-
- spec/unit/throttler/
|
299
|
+
- spec/unit/throttler/replica_lag_spec.rb
|
286
300
|
- spec/unit/throttler/threads_running_spec.rb
|
287
301
|
- spec/unit/throttler_spec.rb
|
288
302
|
- spec/unit/unit_helper.rb
|
@@ -299,14 +313,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
313
|
requirements:
|
300
314
|
- - ">="
|
301
315
|
- !ruby/object:Gem::Version
|
302
|
-
version:
|
316
|
+
version: 3.0.0
|
303
317
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
304
318
|
requirements:
|
305
319
|
- - ">="
|
306
320
|
- !ruby/object:Gem::Version
|
307
321
|
version: '0'
|
308
322
|
requirements: []
|
309
|
-
rubygems_version: 3.
|
323
|
+
rubygems_version: 3.4.20
|
310
324
|
signing_key:
|
311
325
|
specification_version: 4
|
312
326
|
summary: online schema changer for mysql
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
before_script:
|
3
|
-
- "mysql -e 'create database lhm;'"
|
4
|
-
rvm:
|
5
|
-
- 2.0.0
|
6
|
-
- 2.1
|
7
|
-
- 2.2
|
8
|
-
sudo: false
|
9
|
-
gemfile:
|
10
|
-
- gemfiles/ar-2.3_mysql.gemfile
|
11
|
-
- gemfiles/ar-3.2_mysql.gemfile
|
12
|
-
- gemfiles/ar-3.2_mysql2.gemfile
|
13
|
-
- gemfiles/ar-4.0_mysql2.gemfile
|
14
|
-
- gemfiles/ar-4.1_mysql2.gemfile
|
15
|
-
- gemfiles/ar-4.2_mysql2.gemfile
|
16
|
-
matrix:
|
17
|
-
exclude:
|
18
|
-
- rvm: 2.2
|
19
|
-
gemfile: gemfiles/ar-3.2_mysql.gemfile
|
20
|
-
- rvm: 2.2
|
21
|
-
gemfile: gemfiles/ar-2.3_mysql.gemfile
|
@@ -1,65 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
lhm-shopify (3.5.5)
|
5
|
-
retriable (>= 3.0.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
activemodel (5.2.6)
|
11
|
-
activesupport (= 5.2.6)
|
12
|
-
activerecord (5.2.6)
|
13
|
-
activemodel (= 5.2.6)
|
14
|
-
activesupport (= 5.2.6)
|
15
|
-
arel (>= 9.0)
|
16
|
-
activesupport (5.2.6)
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
-
i18n (>= 0.7, < 2)
|
19
|
-
minitest (~> 5.1)
|
20
|
-
tzinfo (~> 1.1)
|
21
|
-
after_do (0.4.0)
|
22
|
-
appraisal (2.4.1)
|
23
|
-
bundler
|
24
|
-
rake
|
25
|
-
thor (>= 0.14.0)
|
26
|
-
arel (9.0.0)
|
27
|
-
byebug (11.1.3)
|
28
|
-
concurrent-ruby (1.1.9)
|
29
|
-
docile (1.3.5)
|
30
|
-
i18n (1.8.11)
|
31
|
-
concurrent-ruby (~> 1.0)
|
32
|
-
minitest (5.14.4)
|
33
|
-
mocha (1.13.0)
|
34
|
-
mysql2 (0.5.3)
|
35
|
-
rake (13.0.6)
|
36
|
-
retriable (3.1.2)
|
37
|
-
simplecov (0.18.5)
|
38
|
-
docile (~> 1.1)
|
39
|
-
simplecov-html (~> 0.11)
|
40
|
-
simplecov-html (0.12.3)
|
41
|
-
thor (1.1.0)
|
42
|
-
thread_safe (0.3.6)
|
43
|
-
toxiproxy (2.0.0)
|
44
|
-
tzinfo (1.2.9)
|
45
|
-
thread_safe (~> 0.1)
|
46
|
-
|
47
|
-
PLATFORMS
|
48
|
-
x86_64-darwin-20
|
49
|
-
|
50
|
-
DEPENDENCIES
|
51
|
-
activerecord (= 5.2.6)
|
52
|
-
after_do
|
53
|
-
appraisal
|
54
|
-
byebug
|
55
|
-
docile (= 1.3.5)
|
56
|
-
lhm-shopify!
|
57
|
-
minitest
|
58
|
-
mocha
|
59
|
-
mysql2
|
60
|
-
rake
|
61
|
-
simplecov (= 0.18.5)
|
62
|
-
toxiproxy
|
63
|
-
|
64
|
-
BUNDLED WITH
|
65
|
-
2.2.22
|