flydata 0.8.6 → 0.8.7

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
  SHA1:
3
- metadata.gz: fccdf7126a1206e340ad7b7d847761999a2cc28a
4
- data.tar.gz: 8a6fbebabc89b31223fa8d8ddc23ca78a2b6380e
3
+ metadata.gz: 86638a18d82f42ee50003d03780a5e9a62b3d82a
4
+ data.tar.gz: a6d911a12d67f294d1cb855e293a0add77f99a92
5
5
  SHA512:
6
- metadata.gz: 722ed46e452d826a877e764f481ef379cf383ed2c9ebb780e5ab4a146a6277681685131da597169873cb8270c2f474209d1f2a379b72adba57bdc75992eacae8
7
- data.tar.gz: 7f010de4a37d188b05298c7cab6992627337257b040b5b0d5f0e6009cbaf9a3d7133675a37d93449e066b89ab618ccf63845dd7cf15124f7bd20af9bffa03784
6
+ metadata.gz: a97793d37523ba2319529941ff8661445b64836038bfa179e453800c45b18f4a91103174e0cc479d8ea821feb42e084f6098392ce7b9667b8d9d90e41f68f466
7
+ data.tar.gz: 94c736d7dd868e197c96ea39404e04c3f466ab8bd07ae5370872d3a11a34f77be1adcf1027df83cf272789476b451089fee682d7781fcef5b5388ad8016756fe
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.6
1
+ 0.8.7
@@ -365,13 +365,13 @@ EOT
365
365
  def check_result(result, option = @option)
366
366
  if result.first["name"] == "binlog retention hours"
367
367
  if result.first["value"].nil? ||
368
- result.first["value"].to_i <= BINLOG_RETENTION_HOURS
368
+ result.first["value"].to_i < BINLOG_RETENTION_HOURS
369
369
  raise FlydataCore::MysqlCompatibilityError,
370
370
  "Binary log retention is too short\n" +
371
371
  " We recommend setting RDS binlog retention " +
372
372
  "to be at least #{BINLOG_RETENTION_HOURS} hours. To do this, " +
373
373
  "run this on your RDS MySQL database:\n" +
374
- " $> call mysql.rds_set_configuration('binlog retention hours', 94);"
374
+ " $> call mysql.rds_set_configuration('binlog retention hours', #{BINLOG_RETENTION_HOURS});"
375
375
  end
376
376
  end
377
377
  end
Binary file
@@ -434,6 +434,8 @@ EOS
434
434
  JSON.generate(h)
435
435
  end
436
436
 
437
+ MAX_STOP_RETRIES = 5
438
+ STOP_RETRY_INTERVAL = 10
437
439
  def _check(source_pos_context, options = {})
438
440
  options[:stop_agent] ||= false
439
441
 
@@ -445,15 +447,34 @@ EOS
445
447
  data_stuck_at = nil
446
448
  abnormal_shutdown = false
447
449
  begin
448
- begin
449
- # wait until no data gets processed for 3 minutes. This is long
450
- # to wait, but there *are* cases where active data processing takes
451
- # more than 3 minutes between 2 chunk processing if COPY command
452
- # takes minutes to process.
453
- flush_buffer_and_stop(@full_tables, force: false, timeout: 180,
454
- dont_wait_upload: true)
455
- rescue ServerDataProcessingTimeout => e
456
- data_stuck_at = e.state
450
+ retry_count = 0
451
+ loop do
452
+ begin
453
+ # wait until no data gets processed for 3 minutes. This is long
454
+ # to wait, but there *are* cases where active data processing takes
455
+ # more than 3 minutes between 2 chunk processing if COPY command
456
+ # takes minutes to process.
457
+ flush_buffer_and_stop(@full_tables, force: false, timeout: 180,
458
+ dont_wait_upload: true)
459
+ rescue ServerDataProcessingTimeout => e
460
+ data_stuck_at = e.state
461
+ end
462
+
463
+ # #flush_buffer_and_stop should have stopped the agent process but
464
+ # double-check because running repair (which calls _check) while
465
+ # agent is running causes a devestating result which requires full resync.
466
+ if sender.process_exist?
467
+ if retry_count > MAX_STOP_RETRIES
468
+ raise "agent did not stop after several stop attempts. stop the agent and try again."
469
+ else
470
+ retry_count += 1
471
+ $log.warn "agent did not stop. will try again (#{retry_count})"
472
+ sleep STOP_RETRY_INTERVAL
473
+ end
474
+ else
475
+ $log.info "confirmed no agent process running. Start check"
476
+ break
477
+ end
457
478
  end
458
479
 
459
480
  # Agent is stopped but locked. There was an abnormal shutdown.
@@ -175,10 +175,10 @@ describe DataEntry do
175
175
  end
176
176
  end
177
177
  end
178
- context "with more than 50 tables" do
179
- let(:tables) { 80.times.collect{|i| "tbl#{i}"} }
180
- let(:expected_tables1) { tables[0...50].join(",") }
181
- let(:expected_tables2) { tables[50..-1].join(",") }
178
+ context "with more than 20 tables" do
179
+ let(:tables) { 30.times.collect{|i| "tbl#{i}"} }
180
+ let(:expected_tables1) { tables[0...20].join(",") }
181
+ let(:expected_tables2) { tables[20..-1].join(",") }
182
182
 
183
183
  let(:expected_message) { double('expected_message') }
184
184
 
@@ -318,10 +318,10 @@ describe DataEntry do
318
318
  let(:status21) { double('status21') }
319
319
  let(:status22) { double('status22') }
320
320
 
321
- context "with more than 50 tables" do
322
- let(:tables) { 80.times.collect {|i| "tbl#{i}"} }
323
- let(:expected_tables1) { tables[0...50].join(",") }
324
- let(:expected_tables2) { tables[50..-1].join(",") }
321
+ context "with more than 20 tables" do
322
+ let(:tables) { 30.times.collect {|i| "tbl#{i}"} }
323
+ let(:expected_tables1) { tables[0...20].join(",") }
324
+ let(:expected_tables2) { tables[20..-1].join(",") }
325
325
 
326
326
  it do
327
327
  expect(api_client).to receive(:post).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flydata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Fujikawa
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-03-08 00:00:00.000000000 Z
15
+ date: 2017-03-24 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rest-client