lhm-shopify 3.4.0 → 3.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +24 -15
- data/.gitignore +1 -6
- data/Appraisals +24 -0
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +66 -0
- data/README.md +55 -4
- data/Rakefile +11 -0
- data/dev.yml +31 -6
- data/docker-compose.yml +58 -0
- data/gemfiles/activerecord_5.2.gemfile +9 -0
- data/gemfiles/activerecord_5.2.gemfile.lock +65 -0
- data/gemfiles/activerecord_6.0.gemfile +7 -0
- data/gemfiles/activerecord_6.0.gemfile.lock +67 -0
- data/gemfiles/activerecord_6.1.gemfile +7 -0
- data/gemfiles/activerecord_6.1.gemfile.lock +66 -0
- data/gemfiles/activerecord_7.0.0.alpha2.gemfile +7 -0
- data/gemfiles/activerecord_7.0.0.alpha2.gemfile.lock +64 -0
- data/lhm.gemspec +7 -3
- data/lib/lhm/atomic_switcher.rb +5 -11
- data/lib/lhm/chunk_insert.rb +7 -10
- data/lib/lhm/chunker.rb +21 -10
- data/lib/lhm/cleanup/current.rb +9 -12
- data/lib/lhm/connection.rb +108 -0
- data/lib/lhm/entangler.rb +8 -13
- data/lib/lhm/invoker.rb +6 -4
- data/lib/lhm/locked_switcher.rb +2 -0
- data/lib/lhm/migrator.rb +2 -0
- data/lib/lhm/printer.rb +10 -6
- data/lib/lhm/proxysql_helper.rb +10 -0
- data/lib/lhm/sql_retry.rb +129 -10
- data/lib/lhm/throttler/slave_lag.rb +19 -2
- data/lib/lhm/version.rb +1 -1
- data/lib/lhm.rb +41 -16
- data/scripts/helpers/wait-for-dbs.sh +21 -0
- data/scripts/mysql/reader/create_replication.sql +10 -0
- data/scripts/mysql/writer/create_test_db.sql +1 -0
- data/scripts/mysql/writer/create_users.sql +6 -0
- data/scripts/proxysql/proxysql.cnf +117 -0
- data/spec/integration/atomic_switcher_spec.rb +53 -17
- data/spec/integration/chunk_insert_spec.rb +3 -2
- data/spec/integration/chunker_spec.rb +18 -16
- data/spec/integration/cleanup_spec.rb +49 -38
- data/spec/integration/database.yml +25 -0
- data/spec/integration/entangler_spec.rb +7 -5
- data/spec/integration/integration_helper.rb +25 -10
- data/spec/integration/lhm_spec.rb +114 -40
- data/spec/integration/lock_wait_timeout_spec.rb +2 -2
- data/spec/integration/locked_switcher_spec.rb +4 -4
- data/spec/integration/proxysql_spec.rb +34 -0
- data/spec/integration/sql_retry/db_connection_helper.rb +52 -0
- data/spec/integration/sql_retry/lock_wait_spec.rb +8 -6
- data/spec/integration/sql_retry/lock_wait_timeout_test_helper.rb +17 -4
- data/spec/integration/sql_retry/proxysql_helper.rb +22 -0
- data/spec/integration/sql_retry/retry_with_proxysql_spec.rb +109 -0
- data/spec/integration/table_spec.rb +11 -19
- data/spec/integration/toxiproxy_helper.rb +40 -0
- data/spec/test_helper.rb +24 -0
- data/spec/unit/atomic_switcher_spec.rb +4 -6
- data/spec/unit/chunk_insert_spec.rb +7 -2
- data/spec/unit/chunker_spec.rb +47 -42
- data/spec/unit/connection_spec.rb +111 -0
- data/spec/unit/entangler_spec.rb +85 -22
- data/spec/unit/intersection_spec.rb +4 -4
- data/spec/unit/lhm_spec.rb +23 -6
- data/spec/unit/locked_switcher_spec.rb +13 -18
- data/spec/unit/migrator_spec.rb +17 -19
- data/spec/unit/printer_spec.rb +14 -26
- data/spec/unit/sql_helper_spec.rb +8 -12
- data/spec/unit/table_spec.rb +5 -5
- data/spec/unit/throttler/slave_lag_spec.rb +14 -9
- data/spec/unit/throttler_spec.rb +12 -12
- data/spec/unit/unit_helper.rb +13 -0
- metadata +85 -14
- data/bin/.gitkeep +0 -0
- data/dbdeployer/config.json +0 -32
- data/dbdeployer/install.sh +0 -64
- data/gemfiles/ar-2.3_mysql.gemfile +0 -6
- data/gemfiles/ar-3.2_mysql.gemfile +0 -5
- data/gemfiles/ar-3.2_mysql2.gemfile +0 -5
- data/gemfiles/ar-4.0_mysql2.gemfile +0 -5
- data/gemfiles/ar-4.1_mysql2.gemfile +0 -5
- data/gemfiles/ar-4.2_mysql2.gemfile +0 -5
- data/gemfiles/ar-5.0_mysql2.gemfile +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3893b743c675e62933e58a4f56c0ac2dba1b1081afabc779dc1d899406e7c42
|
4
|
+
data.tar.gz: 569175938b8069e0036f881400b9427180283ec61c29ca5d509a7090a7f8a9ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba3ebf953f97cd793c52cb83fee77dd4436877ca01a51ee6d718c7937916e391a32c659b9f403b62f65cf0a326dc755e6221e3311760738c9c6fb442746e1617
|
7
|
+
data.tar.gz: 2e617329a895d00a2541539526e941fc94dfda8285083d46d4179587a31786cbbb1062bd8dbdfffcc4d046801944ac96aa700c32618a4db9f4346345e9105c7c
|
data/.github/workflows/test.yml
CHANGED
@@ -10,25 +10,34 @@ jobs:
|
|
10
10
|
test:
|
11
11
|
name: Run tests
|
12
12
|
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
include:
|
18
|
+
- ruby-version: "2.4"
|
19
|
+
activerecord-version: "5.2"
|
20
|
+
- ruby-version: "2.5"
|
21
|
+
activerecord-version: "6.0"
|
22
|
+
- ruby-version: "2.7.5"
|
23
|
+
activerecord-version: "6.1"
|
24
|
+
- ruby-version: "3.0"
|
25
|
+
activerecord-version: "7.0.0.alpha2"
|
13
26
|
steps:
|
14
27
|
- uses: actions/checkout@v2
|
15
28
|
- name: Set up Ruby
|
16
29
|
uses: ruby/setup-ruby@v1
|
17
30
|
with:
|
18
|
-
ruby-version:
|
19
|
-
bundler-cache:
|
20
|
-
- name: Cache MySQL
|
21
|
-
uses: actions/cache@v2
|
22
|
-
with:
|
23
|
-
path: dbdeployer/binaries
|
24
|
-
key: ${{ runner.os }}-dbdeployer-${{ hashFiles('**/dbdeployer/install.sh') }}
|
31
|
+
ruby-version: ${{matrix.ruby-version}}
|
32
|
+
bundler-cache: false
|
25
33
|
- name: Install Ruby packages
|
26
|
-
run: bundle install
|
34
|
+
run: BUNDLE_GEMFILE="${GITHUB_WORKSPACE}/gemfiles/activerecord_${{ matrix.activerecord-version }}.gemfile" bundle install
|
27
35
|
- name: Install Ubuntu packages
|
28
|
-
run: sudo apt-get install numactl libaio-dev
|
29
|
-
- name: Setup MySQL
|
30
|
-
run:
|
31
|
-
- name:
|
32
|
-
run:
|
33
|
-
|
34
|
-
|
36
|
+
run: sudo apt-get update && sudo apt-get install numactl libaio-dev libmysqlclient-dev
|
37
|
+
- name: Setup MySQL and ProxySQL (docker-compose)
|
38
|
+
run: docker-compose up -d # Might have to change to docker compose up -d (i.e. Compose V2) when the Ubuntu image changes the docker-compose version
|
39
|
+
- name: Wait until DBs are alive
|
40
|
+
run: ./scripts/helpers/wait-for-dbs.sh
|
41
|
+
timeout-minutes: 2
|
42
|
+
- name: Run tests
|
43
|
+
run: BUNDLE_GEMFILE="${GITHUB_WORKSPACE}/gemfiles/activerecord_${{ matrix.activerecord-version }}.gemfile" bundle exec rake specs
|
data/.gitignore
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
*.gem
|
2
2
|
.bundle
|
3
|
-
gemfiles/*.lock
|
4
3
|
pkg/*
|
5
4
|
.rvmrc
|
6
5
|
.ruby-version
|
7
6
|
.ruby-gemset
|
8
7
|
bin/rake
|
9
|
-
spec/integration/database.yml
|
10
8
|
gemfiles/vendor
|
11
9
|
omg.ponies
|
12
10
|
*~
|
13
11
|
coverage
|
14
|
-
|
15
|
-
/dbdeployer/sandboxes
|
16
|
-
/dbdeployer/binaries
|
17
|
-
Gemfile.lock
|
12
|
+
.idea/
|
data/Appraisals
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Oldest supported Rails version
|
2
|
+
appraise "activerecord-5.2" do
|
3
|
+
gem "activerecord", "5.2.6"
|
4
|
+
|
5
|
+
# This gemfile will be ran against ruby 2.4 and some gems might require 2.4+. The following list are the gems
|
6
|
+
# and their respective versions that work with ruby <= 2.4
|
7
|
+
gem "simplecov", "0.18.5"
|
8
|
+
gem "docile", "1.3.5"
|
9
|
+
end
|
10
|
+
|
11
|
+
# First conflicted version
|
12
|
+
appraise "activerecord-6.0" do
|
13
|
+
gem "activerecord", "6.0.0"
|
14
|
+
end
|
15
|
+
|
16
|
+
# Second conflicted version
|
17
|
+
appraise "activerecord-6.1" do
|
18
|
+
gem "activerecord", "6.1.0"
|
19
|
+
end
|
20
|
+
|
21
|
+
# Latest version at the moment
|
22
|
+
appraise "activerecord-7.0.0.alpha2" do
|
23
|
+
gem "activerecord", "7.0.0.alpha2"
|
24
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
# 3.5.5 (Jan, 2022)
|
2
|
+
* Fix error where from Config shadowing which would cause LHM to abort on reconnect (https://github.com/Shopify/lhm/pull/128)
|
3
|
+
|
4
|
+
# 3.5.4 (Dec, 2021)
|
5
|
+
* Refactored the way options are handled internally. Code is now much clearer to understand
|
6
|
+
* Removed optional connection_options from `Lhm.setup` and `Lhm.connection`
|
7
|
+
* Option `reconnect_with_consistent_host` will now be provided with `options` for `Lhm.change_table`
|
8
|
+
|
9
|
+
# 3.5.3 (Dec, 2021)
|
10
|
+
* Adds ProxySQL comments at the end of query to accommodate for internal tool's requirements
|
11
|
+
|
12
|
+
# 3.5.2 (Dec, 2021)
|
13
|
+
* Fixed error on undefined connection, when calling `Lhm.connection` without calling `Lhm.setup` first
|
14
|
+
* Changed `Lhm.connection.connection` to `lhm.connection.ar_connection` for increased clarity and readability
|
15
|
+
|
16
|
+
# 3.5.1 (Dec , 2021)
|
17
|
+
* Add better logging to the LHM components (https://github.com/Shopify/lhm/pull/112)
|
18
|
+
* Slave lag throttler now supports ActiveRecord > 6.0
|
19
|
+
* [Dev] Add `Appraisals` to test against multiple version
|
20
|
+
|
21
|
+
# 3.5.0 (Dec , 2021)
|
22
|
+
* Duplicate of 3.4.2 (unfortunate mistake)
|
23
|
+
|
24
|
+
# 3.4.2 (Sept, 2021)
|
25
|
+
* Fixed Chunker's undefined name error (https://github.com/Shopify/lhm/pull/110)
|
26
|
+
|
27
|
+
# 3.4.1 (Sep 22, 2021)
|
28
|
+
|
29
|
+
* Add better logging to the LHM components (https://github.com/Shopify/lhm/pull/108)
|
30
|
+
|
1
31
|
# 3.4.0 (Jul 19, 2021)
|
2
32
|
|
3
33
|
* Log or raise on unexpected duplicated entry warnings during INSERT IGNORE (https://github.com/Shopify/lhm/pull/100)
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,66 @@
|
|
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 (6.1.4.1)
|
11
|
+
activesupport (= 6.1.4.1)
|
12
|
+
activerecord (6.1.4.1)
|
13
|
+
activemodel (= 6.1.4.1)
|
14
|
+
activesupport (= 6.1.4.1)
|
15
|
+
activesupport (6.1.4.1)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
21
|
+
after_do (0.4.0)
|
22
|
+
appraisal (2.4.1)
|
23
|
+
bundler
|
24
|
+
rake
|
25
|
+
thor (>= 0.14.0)
|
26
|
+
byebug (11.1.3)
|
27
|
+
concurrent-ruby (1.1.9)
|
28
|
+
docile (1.4.0)
|
29
|
+
i18n (1.8.11)
|
30
|
+
concurrent-ruby (~> 1.0)
|
31
|
+
minitest (5.14.4)
|
32
|
+
mocha (1.13.0)
|
33
|
+
mysql2 (0.5.3)
|
34
|
+
rake (13.0.6)
|
35
|
+
retriable (3.1.2)
|
36
|
+
simplecov (0.21.2)
|
37
|
+
docile (~> 1.1)
|
38
|
+
simplecov-html (~> 0.11)
|
39
|
+
simplecov_json_formatter (~> 0.1)
|
40
|
+
simplecov-html (0.12.3)
|
41
|
+
simplecov_json_formatter (0.1.3)
|
42
|
+
thor (1.1.0)
|
43
|
+
toxiproxy (2.0.0)
|
44
|
+
tzinfo (2.0.4)
|
45
|
+
concurrent-ruby (~> 1.0)
|
46
|
+
zeitwerk (2.5.1)
|
47
|
+
|
48
|
+
PLATFORMS
|
49
|
+
x86_64-darwin-20
|
50
|
+
x86_64-linux
|
51
|
+
|
52
|
+
DEPENDENCIES
|
53
|
+
activerecord
|
54
|
+
after_do
|
55
|
+
appraisal
|
56
|
+
byebug
|
57
|
+
lhm-shopify!
|
58
|
+
minitest
|
59
|
+
mocha
|
60
|
+
mysql2
|
61
|
+
rake
|
62
|
+
simplecov
|
63
|
+
toxiproxy
|
64
|
+
|
65
|
+
BUNDLED WITH
|
66
|
+
2.2.22
|
data/README.md
CHANGED
@@ -109,6 +109,50 @@ end
|
|
109
109
|
to prevent accidental data loss. After successful or failed LHM migrations, these leftover
|
110
110
|
tables must be cleaned up.
|
111
111
|
|
112
|
+
### Usage with ProxySQL
|
113
|
+
LHM can recover from connection loss. However, when used in conjunction with ProxySQL, there are multiple ways that
|
114
|
+
connection loss could induce data loss (if triggered by a failover). Therefore it will perform additional checks to
|
115
|
+
ensure that the MySQL host stays consistent across the schema migrations if the feature is enabled.
|
116
|
+
This is done by tagging every query with `/*maintenance:lhm*/`, which will be recognized by ProxySQL.
|
117
|
+
However, to get this feature working, a new ProxySQL query rule must be added.
|
118
|
+
```cnf
|
119
|
+
{
|
120
|
+
rule_id = <rule id>
|
121
|
+
active = 1
|
122
|
+
match_pattern = "maintenance:lhm"
|
123
|
+
destination_hostgroup = <MySQL writer's hostgroup>
|
124
|
+
}
|
125
|
+
```
|
126
|
+
|
127
|
+
This will ensure that all relevant queries are forwarded to the current writer.
|
128
|
+
|
129
|
+
Also, ProxySQL disables [multiplexing](https://proxysql.com/documentation/multiplexing/) for `select` on `@@` variables.
|
130
|
+
Therefore, the following rules must be added to ensure that queries (even if tagged with `/*maintenance:lhm*/`) get
|
131
|
+
forwarded to the right target.
|
132
|
+
```cnf
|
133
|
+
{
|
134
|
+
rule_id = <rule id>
|
135
|
+
active = 1
|
136
|
+
match_digest = "@@global\.server_id"
|
137
|
+
multiplex = 2
|
138
|
+
},
|
139
|
+
{
|
140
|
+
rule_id = <rule id>
|
141
|
+
active = 1
|
142
|
+
match_digest = "@@global\.hostname"
|
143
|
+
multiplex = 2
|
144
|
+
}
|
145
|
+
```
|
146
|
+
|
147
|
+
Once these changes are added to the ProxySQL configuration (either through `.cnf` or dynamically through the admin interface),
|
148
|
+
the feature can be enabled. This is done by adding this flag when providing options to the migration:
|
149
|
+
```ruby
|
150
|
+
Lhm.change_table(..., options: {reconnect_with_consistent_host: true}) do |t|
|
151
|
+
...
|
152
|
+
end
|
153
|
+
```
|
154
|
+
**Note**: This feature is disabled by default
|
155
|
+
|
112
156
|
## Throttler
|
113
157
|
|
114
158
|
LHM uses a throttling mechanism to read data in your original table. By default, 2,000 rows are read each 0.1 second. If you want to change that behaviour, you can pass an instance of a throttler with the `throttler` option. In this example, 1,000 rows will be read with a 10 second delay between each processing:
|
@@ -259,11 +303,18 @@ COV=1 bundle exec rake unit && bundle exec rake integration
|
|
259
303
|
open coverage/index.html
|
260
304
|
```
|
261
305
|
|
262
|
-
###
|
306
|
+
### Merging for a new version
|
307
|
+
When creating a PR for a new version, make sure that th version has been bumped in `lib/lhm/version.rb`. Then run the following code snippet to ensure the everything is consistent, otherwise
|
308
|
+
the gem will not publish.
|
309
|
+
```bash
|
310
|
+
bundle install
|
311
|
+
bundle update
|
312
|
+
bundle exec appraisals install
|
313
|
+
```
|
263
314
|
|
264
|
-
|
265
|
-
|
266
|
-
|
315
|
+
### Docker Compose
|
316
|
+
The integration tests rely on a replication configuration for MySQL which is being proxied by an instance of ProxySQL.
|
317
|
+
It is important that every container is running to execute the integration test suite.
|
267
318
|
|
268
319
|
## License
|
269
320
|
|
data/Rakefile
CHANGED
@@ -18,5 +18,16 @@ Rake::TestTask.new('integration') do |t|
|
|
18
18
|
t.verbose = true
|
19
19
|
end
|
20
20
|
|
21
|
+
Rake::TestTask.new('dev') do |t|
|
22
|
+
t.libs << 'lib'
|
23
|
+
t.libs << 'spec'
|
24
|
+
|
25
|
+
files = FileList.new('spec/test_helper.rb')
|
26
|
+
files.add(ENV["SINGLE_TEST"]) if ENV["SINGLE_TEST"]
|
27
|
+
t.test_files = files
|
28
|
+
|
29
|
+
t.verbose = true
|
30
|
+
end
|
31
|
+
|
21
32
|
task :specs => [:unit, :integration]
|
22
33
|
task :default => :specs
|
data/dev.yml
CHANGED
@@ -5,16 +5,41 @@ up:
|
|
5
5
|
or: [mysql@5.7]
|
6
6
|
conflicts: [shopify/shopify/mysql-client, mysql-connector-c, mysql, mysql-client]
|
7
7
|
- wget
|
8
|
-
- ruby: 2.
|
8
|
+
- ruby: 2.7.5
|
9
9
|
- bundler
|
10
10
|
- custom:
|
11
|
-
name:
|
12
|
-
met?:
|
13
|
-
meet:
|
14
|
-
|
11
|
+
name: Get Appraisal gems
|
12
|
+
met?: bundle exec appraisal install
|
13
|
+
meet: ":"
|
14
|
+
- docker
|
15
|
+
- custom:
|
16
|
+
name: Docker Compose
|
17
|
+
met?: docker compose ls | grep -ioE -q "lhm.*running\(4\)"
|
18
|
+
meet: docker compose up -d
|
19
|
+
- custom:
|
20
|
+
name: Waiting for DBs to be operational
|
21
|
+
met?: ./scripts/helpers/wait-for-dbs.sh
|
22
|
+
meet: ":"
|
15
23
|
|
16
24
|
commands:
|
17
25
|
unit: bundle exec rake unit
|
18
26
|
int: bundle exec rake integration
|
19
|
-
test:
|
27
|
+
test:
|
28
|
+
optional: file
|
29
|
+
aliases: [ t ]
|
30
|
+
run: |
|
31
|
+
if [[ $# -eq 0 ]]; then
|
32
|
+
bundle exec rake unit && bundle exec rake integration
|
33
|
+
else
|
34
|
+
SINGLE_TEST="$@" bundle exec rake dev
|
35
|
+
fi
|
36
|
+
appraisals: bundle exec appraisal rake specs
|
20
37
|
cov: rm -rf coverage; COV=1 bundle exec rake unit && bundle exec rake integration; open coverage/index.html
|
38
|
+
logs:
|
39
|
+
desc: "See the DB logs (ctrl-c + ctrl-c to exit)"
|
40
|
+
run: docker-compose logs -f
|
41
|
+
clear:
|
42
|
+
run: docker-compose rm -v -s -f && docker-compose up -d && ./scripts/helpers/wait-for-dbs.sh
|
43
|
+
pre-publish:
|
44
|
+
# Ensures all Gemfile.lock are sync with the new version in `lhm/version.rb` and runs appraisals
|
45
|
+
run: bundle install && bundle exec appraisal install && bundle exec appraisal rake specs
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
services:
|
2
|
+
# Writer
|
3
|
+
mysql-1:
|
4
|
+
container_name: mysql-1
|
5
|
+
image: percona:5.7
|
6
|
+
command:
|
7
|
+
--server-id=1
|
8
|
+
--log-bin
|
9
|
+
--log-slave-updates=ON
|
10
|
+
--gtid-mode=ON
|
11
|
+
--enforce-gtid-consistency=ON
|
12
|
+
--read-only=OFF
|
13
|
+
--max-connections=1000
|
14
|
+
hostname: 'mysql-1'
|
15
|
+
volumes:
|
16
|
+
- ./scripts/mysql/writer:/docker-entrypoint-initdb.d
|
17
|
+
environment:
|
18
|
+
MYSQL_ROOT_PASSWORD: password
|
19
|
+
MYSQL_HOST: mysql-1
|
20
|
+
ports:
|
21
|
+
- "33006:3306"
|
22
|
+
# Reader
|
23
|
+
mysql-2:
|
24
|
+
container_name: mysql-2
|
25
|
+
image: percona:5.7
|
26
|
+
command:
|
27
|
+
--server-id=2
|
28
|
+
--log-bin
|
29
|
+
--log-slave-updates=ON
|
30
|
+
--gtid-mode=ON
|
31
|
+
--enforce-gtid-consistency=ON
|
32
|
+
--read-only=ON
|
33
|
+
--max-connections=1000
|
34
|
+
hostname: 'mysql-2'
|
35
|
+
volumes:
|
36
|
+
- ./scripts/mysql/reader:/docker-entrypoint-initdb.d
|
37
|
+
environment:
|
38
|
+
MYSQL_ROOT_PASSWORD: password
|
39
|
+
MYSQL_HOST: mysql-2
|
40
|
+
ports:
|
41
|
+
- "33007:3306"
|
42
|
+
# Proxysql
|
43
|
+
proxysql:
|
44
|
+
container_name: proxysql
|
45
|
+
image: proxysql/proxysql:2.0.11
|
46
|
+
volumes:
|
47
|
+
- ./scripts/proxysql/proxysql.cnf:/etc/proxysql.cnf
|
48
|
+
command: "proxysql -c /etc/proxysql.cnf -f --idle-threads"
|
49
|
+
ports:
|
50
|
+
- "33005:3306"
|
51
|
+
- "6032:6032"
|
52
|
+
toxiproxy:
|
53
|
+
container_name: toxiproxy
|
54
|
+
image: "ghcr.io/shopify/toxiproxy"
|
55
|
+
ports:
|
56
|
+
- "8474:8474"
|
57
|
+
- "22220:22220"
|
58
|
+
- "22222:22222"
|
@@ -0,0 +1,65 @@
|
|
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
|
@@ -0,0 +1,67 @@
|
|
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 (6.0.0)
|
11
|
+
activesupport (= 6.0.0)
|
12
|
+
activerecord (6.0.0)
|
13
|
+
activemodel (= 6.0.0)
|
14
|
+
activesupport (= 6.0.0)
|
15
|
+
activesupport (6.0.0)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 0.7, < 2)
|
18
|
+
minitest (~> 5.1)
|
19
|
+
tzinfo (~> 1.1)
|
20
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
21
|
+
after_do (0.4.0)
|
22
|
+
appraisal (2.4.1)
|
23
|
+
bundler
|
24
|
+
rake
|
25
|
+
thor (>= 0.14.0)
|
26
|
+
byebug (11.1.3)
|
27
|
+
concurrent-ruby (1.1.9)
|
28
|
+
docile (1.4.0)
|
29
|
+
i18n (1.8.11)
|
30
|
+
concurrent-ruby (~> 1.0)
|
31
|
+
minitest (5.14.4)
|
32
|
+
mocha (1.13.0)
|
33
|
+
mysql2 (0.5.3)
|
34
|
+
rake (13.0.6)
|
35
|
+
retriable (3.1.2)
|
36
|
+
simplecov (0.21.2)
|
37
|
+
docile (~> 1.1)
|
38
|
+
simplecov-html (~> 0.11)
|
39
|
+
simplecov_json_formatter (~> 0.1)
|
40
|
+
simplecov-html (0.12.3)
|
41
|
+
simplecov_json_formatter (0.1.3)
|
42
|
+
thor (1.1.0)
|
43
|
+
thread_safe (0.3.6)
|
44
|
+
toxiproxy (2.0.0)
|
45
|
+
tzinfo (1.2.9)
|
46
|
+
thread_safe (~> 0.1)
|
47
|
+
zeitwerk (2.5.1)
|
48
|
+
|
49
|
+
PLATFORMS
|
50
|
+
x86_64-darwin-20
|
51
|
+
x86_64-linux
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
activerecord (= 6.0.0)
|
55
|
+
after_do
|
56
|
+
appraisal
|
57
|
+
byebug
|
58
|
+
lhm-shopify!
|
59
|
+
minitest
|
60
|
+
mocha
|
61
|
+
mysql2
|
62
|
+
rake
|
63
|
+
simplecov
|
64
|
+
toxiproxy
|
65
|
+
|
66
|
+
BUNDLED WITH
|
67
|
+
2.2.22
|
@@ -0,0 +1,66 @@
|
|
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 (6.1.0)
|
11
|
+
activesupport (= 6.1.0)
|
12
|
+
activerecord (6.1.0)
|
13
|
+
activemodel (= 6.1.0)
|
14
|
+
activesupport (= 6.1.0)
|
15
|
+
activesupport (6.1.0)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
21
|
+
after_do (0.4.0)
|
22
|
+
appraisal (2.4.1)
|
23
|
+
bundler
|
24
|
+
rake
|
25
|
+
thor (>= 0.14.0)
|
26
|
+
byebug (11.1.3)
|
27
|
+
concurrent-ruby (1.1.9)
|
28
|
+
docile (1.4.0)
|
29
|
+
i18n (1.8.11)
|
30
|
+
concurrent-ruby (~> 1.0)
|
31
|
+
minitest (5.14.4)
|
32
|
+
mocha (1.13.0)
|
33
|
+
mysql2 (0.5.3)
|
34
|
+
rake (13.0.6)
|
35
|
+
retriable (3.1.2)
|
36
|
+
simplecov (0.21.2)
|
37
|
+
docile (~> 1.1)
|
38
|
+
simplecov-html (~> 0.11)
|
39
|
+
simplecov_json_formatter (~> 0.1)
|
40
|
+
simplecov-html (0.12.3)
|
41
|
+
simplecov_json_formatter (0.1.3)
|
42
|
+
thor (1.1.0)
|
43
|
+
toxiproxy (2.0.0)
|
44
|
+
tzinfo (2.0.4)
|
45
|
+
concurrent-ruby (~> 1.0)
|
46
|
+
zeitwerk (2.5.1)
|
47
|
+
|
48
|
+
PLATFORMS
|
49
|
+
x86_64-darwin-20
|
50
|
+
x86_64-linux
|
51
|
+
|
52
|
+
DEPENDENCIES
|
53
|
+
activerecord (= 6.1.0)
|
54
|
+
after_do
|
55
|
+
appraisal
|
56
|
+
byebug
|
57
|
+
lhm-shopify!
|
58
|
+
minitest
|
59
|
+
mocha
|
60
|
+
mysql2
|
61
|
+
rake
|
62
|
+
simplecov
|
63
|
+
toxiproxy
|
64
|
+
|
65
|
+
BUNDLED WITH
|
66
|
+
2.2.22
|