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

Update Ubuntu plugin to use newer version of libpq libraries - release to Bonsai #179

Open
mgibson323 opened this issue Sep 23, 2021 · 29 comments

Comments

@mgibson323
Copy link

To help improve compatibility with latest versions of Postgres on Ubuntu the plugin should be updated with libpq 10+.

Once updated, please release to Bonsai.

(Follow up to #157)

@lrosenman
Copy link

Also look into having a non-nil default for -T / --timeout in all the scripts. libpq12+ breaks the scripts on libpq 12.

@lrosenman
Copy link

Note also, libpq is always able to talk to lower releases. I.E. this should be built with the latest libpq from the latest release from PGDG.

@jspaleta
Copy link
Contributor

Note 1: There is no ubuntu asset. there is at best a debian platform_family asset

Note 2: ongoing work to refactor is here:
https://github.com/sensu-plugins/sensu-plugins-postgres/tree/js/update-asset-libpq12

Dockerfiles controlling the asset build are found in the directory asset_build_scripts/
Debian platform_family asset build is controlled by Dockerfile.debian file and is making use of the upstream repository:
http://apt.postgresql.org/pub/repos/apt/

Which I thought was best practice and would provide latest libpq.

I guess the question is.. why is the upstream repository not offering the latest libpq12?
I'm not a debian user, so I may be getting the packaging commands wrong. Input from a debian user on how to ensure that the most recent libpq packages from the upstream repository are being pulled would be appreciated.

@lrosenman
Copy link

Debian's packages are generally behind PGDG's releases.

I personally pull from the apt repo referenced here:
https://wiki.postgresql.org/wiki/Apt

@lrosenman
Copy link

PostgreSQL 13 is the latest release, and 14 is starting the release process, for what it's worth.

@jspaleta
Copy link
Contributor

I didnt say debian's packages I said postgresl.org's packages FOR debian

@jspaleta
Copy link
Contributor

This is the file in question. Please review the packaging commands being used to setup the posgresql.org apt repository and then install libpq-dev package:
https://github.com/sensu-plugins/sensu-plugins-postgres/blob/js/update-asset-libpq12/asset_build_scripts/Dockerfile.debian

I have no idea why using the best practice postgresl.org repository isn't pulling a recent enough libpq version. My understanding is this is the correct source to use.

@lrosenman
Copy link

you want the libpq5 package:

postgres@postgresql-slave-000:/usr/lib/x86_64-linux-gnu$ dpkg-query -S pwd/libpq.so.5.13
libpq5:amd64: /usr/lib/x86_64-linux-gnu/libpq.so.5.13
postgres@postgresql-slave-000:/usr/lib/x86_64-linux-gnu$

@lrosenman
Copy link

sorry for not reading clearly :)

@jspaleta
Copy link
Contributor

thanks
I'll update the file and rebuild the test debian family asset in the testing bucket.

@lrosenman
Copy link

Can you also look into the -T / --timeout thing with nil, which breaks with the later libpq's?

@jspaleta
Copy link
Contributor

If you can suggest I reasonable default to replace nil to test I can change it.

@lrosenman
Copy link

I'd say 10-30 seconds. If PostgreSQL doesn't respond in that time, there's something wrong, IMO.

@jspaleta
Copy link
Contributor

I'll open a separate branch with that change. In the meantime can you test and see if explicit use of the --timeout option as an argument works with the next test asset?

@lrosenman
Copy link

using -T 10 works with the current test asset, that's how I got around it yesterday.

@lrosenman
Copy link

the Alpha @mgibson323 gave me is the test asset I'm using.

@lrosenman
Copy link

you'll have to teach me how to get my SensuGo to pull the test asset(s). Thanks in advance.

@jspaleta
Copy link
Contributor

Okay this should have an updated asset definition that points to the new alpha.2 debian build.
I've also correct the definition so that it uses platform_family filter so it should work on ubuntu without modification.
https://cre-testing.s3.us-west-2.amazonaws.com/sensu-plugins-postgres/sensu-plugins-postgres.yaml

You'll want to review it first, maybe change the asset name as needed for your test, but this should load with sensuctl create -f

@lrosenman
Copy link

Looks good. Worked just fine.

@jspaleta
Copy link
Contributor

okay let's get that timeout default fixed up now.
I wonder does timeout 0 disable timeout?

@lrosenman
Copy link

not sure. I do know that it doesn't like "" :)

@lrosenman
Copy link

connect_timeout
Maximum time to wait while connecting, in seconds (write as a decimal integer, e.g., 10). Zero, negative, or not specified means wait indefinitely. The minimum allowed timeout is 2 seconds, therefore a value of 1 is interpreted as 2. This timeout applies separately to each host name or IP address. For example, if you specify two hosts and connect_timeout is 5, each host will time out if no connection is made within 5 seconds, so the total time spent waiting for a connection might be up to 10 seconds.

from: https://www.postgresql.org/docs/13/libpq-connect.html

@jspaleta
Copy link
Contributor

next test build will have 10 second timeout default for all included check executables and should error if argument to timeout is not understandable as an integer. One of the checks already had 2 default defined instead of nil and was ensuring processing of argument as integer.

@lrosenman
Copy link

Great! let me know when it's ready, and I'll put it in, and remove my -T 10's.

@jspaleta
Copy link
Contributor

Okay repull that s3 bucket url and it will have an updated asset definition pointing to alpha.3 test build

@lrosenman
Copy link

Looks Good! removed my -T 10's and pointed to Alpha.3, and we're golden. Thanks!

@lrosenman
Copy link

can you let me know when it's pushed to Bonsai? -- Thanks!

@jspaleta
Copy link
Contributor

Well pushed to bonsai is gonna be a bit longer as these changes will need review from someone else as per normal merge/release rules.

I'll keep this issue open and close it when we have a release approved through normal channels. Until then you can use the test asset. Once the official asset is releases, we'll empty out the test bucket after you confirm the swtich.

@lrosenman
Copy link

Thanks a ton!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants