Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make backup success file path configurable #1207

Merged
merged 6 commits into from
Sep 9, 2019
Merged

Make backup success file path configurable #1207

merged 6 commits into from
Sep 9, 2019

Conversation

HT43-bqxFqB
Copy link
Contributor

Using /tmp is fine until a node is rebooted and /tmp is cleared. By offering a configurable parameter, one can change the path to a non temporary one for checks, monitoring etc.

Additionally I've added a unit test for the default case. Unfortunately the test did not work on my local machine.

@sheenaajay
Copy link
Contributor

Thanks for submitting the PR @HT43-bqxFqB .

@sheenaajay
Copy link
Contributor

@HT43-bqxFqB Could you please add tests to verify the new parameter backup_success_file_path.
Could you paste the error you are seeing on unit tests. We can help you. Please let us know if you need more information.

@HT43-bqxFqB
Copy link
Contributor Author

Hey @sheenaajay,

I have tried to add some minimal default tests, but unfortunately they did not work on my local machine. There for I could only test here with Travis. Locally I got the following error while testing with the PDK:

pdk test unit --tests=spec/classes/mysql_server_backup_spec.rb
pdk (WARN): This module is compatible with an older version of PDK. Run `pdk update` to update it to your version of PDK.
pdk (INFO): Using Ruby 2.5.3
pdk (INFO): Using Puppet 6.7.2
[✖] Installing missing Gemfile dependencies.
pdk (FATAL): The dependency puppet-module-win-default-r2.5 (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32 x64-mingw32`.
The dependency puppet-module-win-dev-r2.5 (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32 x64-mingw32`.
The dependency puppet-module-win-system-r2.5 (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32 x64-mingw32`.
Fetching gem metadata from https://rubygems.org/.....
...
Installing nokogiri 1.10.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/martin/.pdk/cache/ruby/2.5.0/gems/nokogiri-1.10.4/ext/nokogiri
/opt/puppetlabs/pdk/private/ruby/2.5.3/bin/ruby -I /opt/puppetlabs/pdk/private/ruby/2.5.3/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190828-11559-19lrmmh.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/opt/puppetlabs/pdk/private/ruby/2.5.3/bin/$(RUBY_BASE_NAME)
	--help
	--clean
	--use-system-libraries
	--enable-static
	--disable-static
	--with-zlib-dir
	--without-zlib-dir
	--with-zlib-include
	--without-zlib-include=${zlib-dir}/include
	--with-zlib-lib
	--without-zlib-lib=${zlib-dir}/lib
	--enable-cross-build
	--disable-cross-build

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/martin/.pdk/cache/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/martin/.pdk/cache/ruby/2.5.0/gems/nokogiri-1.10.4 for inspection.
Results logged to /home/martin/.pdk/cache/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.4/gem_make.out

An error occurred while installing nokogiri (1.10.4), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.10.4' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  puppet-module-posix-system-r2.5 was resolved to 0.4.2, which depends on
    beaker-vcloud was resolved to 1.0.0, which depends on
      beaker-vmware was resolved to 0.3.0, which depends on
        rbvmomi was resolved to 1.13.0, which depends on
          nokogiri

NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2018-12-01.
Gem::Specification#default_executable= called from /home/martin/.pdk/cache/ruby/2.5.0/bundler/gems/github-changelog-generator-20ee04ba1234/github_changelog_generator.gemspec:10.

pdk (FATAL): Unable to install missing Gemfile dependencies.

@sheenaajay
Copy link
Contributor

@HT43-bqxFqB Could you please rebase with the latest master. Pdk update has been done recently on this module. Will execute the acceptance tests and let you know if I see the same error.Thank you.

@jas01
Copy link

jas01 commented Aug 29, 2019

Using /tmp is fine until a node is rebooted and /tmp is cleared. By offering a configurable parameter, one can change the path to a non temporary one for checks, monitoring etc.

Additionally I've added a unit test for the default case. Unfortunately the test did not work on my local machine.

Just want to say it's not only because /tmp can be erase, but if you try to use nagios/nrpe on a systemd server, the service start with PrivateTmp=true, so the process nrpe cannot access to /tmp or /var/tmp.

So we really need this config to be a parameter.

@sheenaajay
Copy link
Contributor

@HT43-bqxFqB Ran the tests against all OS. Looks Good.
Screen Shot 2019-09-02 at 14 37 21
Please find the results

Once all comments are incrporated we can merge the changes.

@sheenaajay
Copy link
Contributor

Thanks alot @HT43-bqxFqB @jas01

@sheenaajay
Copy link
Contributor

@HT43-bqxFqB Could you please rebase with the latest master to run the Travis job successfully. Thank you.

@HT43-bqxFqB
Copy link
Contributor Author

Rebase completed.

@sheenaajay
Copy link
Contributor

@HT43-bqxFqB Could you please fix the unit tests. Acceptance tests are running clean. Thank you.

@sheenaajay sheenaajay merged commit 5455568 into puppetlabs:master Sep 9, 2019
michaeltlombardi added a commit that referenced this pull request Oct 15, 2019
Fix xtrabackup regression introduced in #1207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants