lhm-shopify 4.1.0 → 4.1.1
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/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/gemfiles/activerecord_6.1.gemfile.lock +1 -1
- data/gemfiles/activerecord_7.0.gemfile.lock +1 -1
- data/gemfiles/activerecord_7.1.gemfile.lock +1 -1
- data/lib/lhm/chunker.rb +6 -5
- data/lib/lhm/version.rb +1 -1
- data/spec/integration/chunker_spec.rb +2 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49f23bf2b018fc5af679644fb6c9f424f943a0d4dd58d7e2d8366b389ae4270b
|
4
|
+
data.tar.gz: 14e15f4fc464d721b20889a1841c4a78a609bb3c6aee1a68ee5f3f5e3e89d2ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86a7153f5278bdf8d26ebd0ca668dab3e4861ad5349e1115796a59b72ac7c8b0eb920cbe74f443e9913efd5b8c2861499c98ba37990d970177e273188656d02a
|
7
|
+
data.tar.gz: f394a26a3dcf8e5737748610db039b28e9cde415a5a82f3b2f29f358f93124155ee6be68c8196bf027b807aedf19feb6f7a60d89097384242f31e65c96907fc7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/lhm/chunker.rb
CHANGED
@@ -23,6 +23,7 @@ module Lhm
|
|
23
23
|
@chunk_finder = ChunkFinder.new(migration, connection, options)
|
24
24
|
@options = options
|
25
25
|
@raise_on_warnings = options.fetch(:raise_on_warnings, false)
|
26
|
+
@pk_duplicate_warning_regexp ||= /Duplicate entry .+ for key '(#{@migration.destination_name}\.)?PRIMARY'/
|
26
27
|
@verifier = options[:verifier]
|
27
28
|
if @throttler = options[:throttler]
|
28
29
|
@throttler.connection = @connection if @throttler.respond_to?(:connection=)
|
@@ -80,11 +81,11 @@ module Lhm
|
|
80
81
|
|
81
82
|
def raise_on_non_pk_duplicate_warning
|
82
83
|
@connection.select_all("SHOW WARNINGS", should_retry: true, log_prefix: LOG_PREFIX).each do |row|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
next if row["Message"].match?(@pk_duplicate_warning_regexp)
|
85
|
+
|
86
|
+
m = "Unexpected warning found for inserted row: #{row["Message"]}"
|
87
|
+
Lhm.logger.warn(m)
|
88
|
+
raise Error.new(m) if @raise_on_warnings
|
88
89
|
end
|
89
90
|
end
|
90
91
|
|
data/lib/lhm/version.rb
CHANGED
@@ -31,7 +31,6 @@ describe Lhm::Chunker do
|
|
31
31
|
replica do
|
32
32
|
value(count_all(@destination.name)).must_equal(1)
|
33
33
|
end
|
34
|
-
|
35
34
|
end
|
36
35
|
|
37
36
|
it 'should copy and ignore duplicate primary key' do
|
@@ -39,7 +38,7 @@ describe Lhm::Chunker do
|
|
39
38
|
execute("insert into origin set id = 1002 ")
|
40
39
|
execute("insert into destination set id = 1002 ")
|
41
40
|
|
42
|
-
Lhm::Chunker.new(@migration, connection, {throttler: throttler, printer: printer} ).run
|
41
|
+
Lhm::Chunker.new(@migration, connection, {raise_on_warnings: true, throttler: throttler, printer: printer} ).run
|
43
42
|
|
44
43
|
replica do
|
45
44
|
value(count_all(@destination.name)).must_equal(2)
|
@@ -55,7 +54,7 @@ describe Lhm::Chunker do
|
|
55
54
|
execute("insert into composite_primary_key set id = 1002, shop_id = 1")
|
56
55
|
execute("insert into composite_primary_key_dest set id = 1002, shop_id = 1")
|
57
56
|
|
58
|
-
Lhm::Chunker.new(migration, connection, {throttler: throttler, printer: printer} ).run
|
57
|
+
Lhm::Chunker.new(migration, connection, {raise_on_warning: true, throttler: throttler, printer: printer} ).run
|
59
58
|
|
60
59
|
replica do
|
61
60
|
value(count_all(destination.name)).must_equal(2)
|
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.1.
|
4
|
+
version: 4.1.1
|
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: 2023-
|
15
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: retriable
|
@@ -320,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
320
|
- !ruby/object:Gem::Version
|
321
321
|
version: '0'
|
322
322
|
requirements: []
|
323
|
-
rubygems_version: 3.4.
|
323
|
+
rubygems_version: 3.4.21
|
324
324
|
signing_key:
|
325
325
|
specification_version: 4
|
326
326
|
summary: online schema changer for mysql
|