OpenCue icon indicating copy to clipboard operation
OpenCue copied to clipboard

Upgrade embedded Postgres and fix compatibility issues.

Open bcipriano opened this issue 3 years ago • 2 comments

Link the Issue(s) this Pull Request is related to. #1196

Summarize your change. In order to get Cuebot working on the arm64v8 architecture, we need to upgrade the embedded Postgres we're using. This created some compatibility issues which are fixed here as well.

The main issue I ran into was a strange one. On ARM only, and only in Docker, it appears that SUM(bigint) does not work properly. It returns a numeric type response as expected, but the value is completely wrong -- we were getting results like 20 + 9 = 368934881474632988248, which would cause overflows in the Cuebot code. The solution I found is to CAST the input values as numeric before the SUM happens.

This only happens when building the Cuebot Docker image. When I run tests directly on my Mac i.e. through IntelliJ, the tests run fine.

There are a few other minor test fixes in here, possibly due to some differences in either the Postgres version or x86/arm differences, but I didn't see anything concerning there.

This PR contains some of the changes from #1185 to make testing easier; these will be cleaned up once that PR is merged.

bcipriano avatar Sep 16 '22 06:09 bcipriano

From TSC meeting: we're going to hold on this PR for now while we continue to investigate. The upstream ticket has some suggestions I'll look into next.

bcipriano avatar Dec 12 '22 18:12 bcipriano

Had a breakthrough on this based on the advice I got on the upstream ticket. See https://github.com/zonkyio/embedded-postgres/issues/99#issuecomment-1378159242 for details.

Hopefully we can get some updated Postgres binaries released soon, after which we can probably throw out this PR and do a simple Postgres version upgrade.

bcipriano avatar Jan 11 '23 02:01 bcipriano

Closing stale PRs

DiegoTavares avatar May 03 '24 23:05 DiegoTavares