Skip to content

Fix flaky PostgreSQL builds

Stan Hu requested to merge sh-fix-flaky-postgresql-builds into master

What does this MR do?

!1106 (merged) introduced three separate make invocations to build PostgreSQL to avoid including the PostgreSQL server binaries, but this change introduced some intermittent failures in the build process. In some cases, the generated pg_config_paths.h appears to be corrupted (https://gitlab.com/gitlab-org/build/CNG/-/jobs/3212627040), and in other cases it appears that binaries are not able to resolve symbols.

Whatever the cause, it appears that invoking make in three different directories with parallelization may be causing some race conditions, possibly due to clock skew or filesystem timestamp precision. To avoid this flakiness, we invoke a single parallel make world-bin to build everything but documentation (https://www.postgresql.org/docs/14/install-procedure.html), and then run make install on the three separate directories without parallelization. This appears to make the builds stable.

Related issues

Relates to gitlab-org/charts/gitlab#3924 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
Edited by Stan Hu

Merge request reports