zonkyio / embedded-postgres

Java embedded PostgreSQL component for testing
Apache License 2.0
341 stars 41 forks source link

SUM(bigint) produces strange results on M1 mac in Docker #99

Closed bcipriano closed 1 year ago

bcipriano commented 1 year ago

https://github.com/AcademySoftwareFoundation/OpenCue/pull/1199 has a full description of the issue.

Over on the OpenCue project we use embedded-postgres for unit tests.

Basically we are seeing strange results from SUM(bigint) on arm64+Docker where the result is wildly incorrect.

Our build.gradle.

Any ideas here?

tomix26 commented 1 year ago

Hi @bcipriano, thanks for the report.

Actually, I'm quite surprised that it works at all. Because there is a similar issue, where the process crashes immediately at the beginning when the database is being initialized, see https://github.com/zonkyio/embedded-postgres/issues/95

As I wrote in the linked issue, maybe the problem is caused by using an outdated version of Ubuntu during the build. So you can try to upgrade it - https://github.com/zonkyio/embedded-postgres-binaries/blob/master/build.gradle#L590

You can also try to compare the build scripts between this project and the postgres Docker image. Maybe you will find some major differences that could be causing this. https://github.com/zonkyio/embedded-postgres-binaries/blob/master/scripts/build-postgres-debian.sh https://github.com/docker-library/postgres/blob/master/15/bullseye/Dockerfile

bcipriano commented 1 year ago

Thanks, I'll check these out when I can.

FWIW, the base image I'm using is gradle:6.0.1-jdk13, with basically no modifications.

bcipriano commented 1 year ago

Made some progress here by playing around with the Ubuntu version used for the build.

I sent https://github.com/zonkyio/embedded-postgres-binaries/pull/64 with my 18.04 changes. My branch list has my changes for the other Ubuntu versions in case that's helpful.

tomix26 commented 1 year ago

@bcipriano Thank you very much for your pull request. All tests passed, everything seems to be working fine. New versions of the binaries have been released, so you can try them out. Great job!