logstash-integration-jdbc 5.4.2 → 5.4.3
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/docs/input-jdbc.asciidoc +3 -1
- data/lib/logstash/inputs/jdbc.rb +1 -1
- data/logstash-integration-jdbc.gemspec +1 -1
- data/spec/inputs/jdbc_spec.rb +18 -6
- 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: 0427bfc9149fd1b4751f91bda69dcbc67fe50bbb59ba331142c52b0ac79b92df
|
4
|
+
data.tar.gz: 9b89e07e05f01b5f4226cbbb452a36e0edb116ca116d843d8f578508206086b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bcc88da6e2d4de082a5547f0f273063913f2fe8e87578d7177eb4929604a66ec8be48818ba7b32a88a7bf978aad42f07c14f69f60349d82531f531c0cd77480
|
7
|
+
data.tar.gz: 76bc8bb2c010a6f6087e91be3280c1b83ae165449889cc425cb91b4e6fe0f9092b229f7ed37df5fb6ae7be3acbaa8c69541c610bbfff07c374a32be014ccdcbf
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 5.4.3
|
2
|
+
- Fix crash when metadata file can't be deleted after moving under path.data [#136](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/136)
|
3
|
+
|
1
4
|
## 5.4.2
|
2
5
|
- Doc: described default_hash and tag_on_default_use interaction filter plugin [#122](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/122)
|
3
6
|
- Added new settings `statement_retry_attempts` and `statement_retry_attempts_wait_time` for retry of failed sql statement execution [#123](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/123)
|
data/docs/input-jdbc.asciidoc
CHANGED
@@ -491,10 +491,12 @@ How often to validate a connection (in seconds)
|
|
491
491
|
===== `last_run_metadata_path`
|
492
492
|
|
493
493
|
* Value type is <<string,string>>
|
494
|
-
* Default value is `"
|
494
|
+
* Default value is `"<path.data>/plugins/inputs/jdbc/logstash_jdbc_last_run"`
|
495
495
|
|
496
496
|
Path to file with last run time
|
497
497
|
|
498
|
+
In versions prior to 5.2.6 the metadata file was written to `$HOME/.logstash_jdbc_last_run`. If during a Logstash upgrade the file is found in "$HOME" it will be moved to the default location under "path.data". If the path is defined by the user then no automatic move is performed.
|
499
|
+
|
498
500
|
[id="plugins-{type}s-{plugin}-lowercase_column_names"]
|
499
501
|
===== `lowercase_column_names`
|
500
502
|
|
data/lib/logstash/inputs/jdbc.rb
CHANGED
@@ -406,7 +406,7 @@ module LogStash module Inputs class Jdbc < LogStash::Inputs::Base
|
|
406
406
|
# the correct access rights
|
407
407
|
::File.delete(old_default_path.to_path)
|
408
408
|
@logger.info("Successfully moved the #{old_default_path.to_path} into #{metadata_new_path.to_path}")
|
409
|
-
rescue e
|
409
|
+
rescue => e
|
410
410
|
@logger.warn("Using new metadata file at #{metadata_new_path.to_path} but #{old_default_path} can't be removed.")
|
411
411
|
end
|
412
412
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-integration-jdbc'
|
3
|
-
s.version = '5.4.
|
3
|
+
s.version = '5.4.3'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "Integration with JDBC - input and filter plugins"
|
6
6
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
data/spec/inputs/jdbc_spec.rb
CHANGED
@@ -1169,19 +1169,31 @@ describe LogStash::Inputs::Jdbc do
|
|
1169
1169
|
context "when a file exists" do
|
1170
1170
|
before do
|
1171
1171
|
# in a faked HOME folder save a valid previous last_run metadata file
|
1172
|
+
allow(ENV).to receive(:[]).and_call_original
|
1172
1173
|
allow(ENV).to receive(:[]).with('HOME').and_return(fake_home)
|
1173
|
-
|
1174
|
+
|
1175
|
+
File.open("#{fake_home}/.logstash_jdbc_last_run", 'w') do |file|
|
1174
1176
|
file.write("--- !ruby/object:DateTime '2022-03-08 08:10:00.486889000 Z'")
|
1175
1177
|
end
|
1176
1178
|
end
|
1179
|
+
let(:old_path) { "#{fake_home}/.logstash_jdbc_last_run" }
|
1180
|
+
let(:path_data) { LogStash::SETTINGS.get_value("path.data") }
|
1181
|
+
let(:new_path) { "#{path_data}/plugins/inputs/jdbc/logstash_jdbc_last_run" }
|
1177
1182
|
|
1178
1183
|
it "should be moved" do
|
1179
1184
|
plugin.register
|
1180
|
-
|
1181
|
-
expect(::File.exist
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
+
expect(::File).to_not exist(old_path)
|
1186
|
+
expect(::File).to exist(new_path)
|
1187
|
+
end
|
1188
|
+
context "if the delete fails" do
|
1189
|
+
before(:each) do
|
1190
|
+
allow(File).to receive(:delete).and_raise ArgumentError
|
1191
|
+
end
|
1192
|
+
it "should be still be moved" do
|
1193
|
+
plugin.register
|
1194
|
+
expect(::File).to exist(old_path) # old still exists
|
1195
|
+
expect(::File).to exist(new_path)
|
1196
|
+
end
|
1185
1197
|
end
|
1186
1198
|
end
|
1187
1199
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-integration-jdbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.
|
4
|
+
version: 5.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -333,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
333
|
- !ruby/object:Gem::Version
|
334
334
|
version: '0'
|
335
335
|
requirements: []
|
336
|
-
rubygems_version: 3.
|
336
|
+
rubygems_version: 3.2.33
|
337
337
|
signing_key:
|
338
338
|
specification_version: 4
|
339
339
|
summary: Integration with JDBC - input and filter plugins
|