I'm getting divergent versions when deploying to my production environment #265
Replies: 6 comments 5 replies
-
Hi, and thanks for the interest! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply!
I’ll look at those checksums when I get a chance, is there any way I can
compute those checksums myself?
Looking though the source it seems it is just based on the sql (in my case)
of the migration.
So hypothetically running that computation should / could return something
different on both systems?
Adding the checksum to the log would be helpful for me.
I’ll let you know what I find out, probably by Friday.
On Wed 21. Dec 2022 at 18:46, João Oliveira ***@***.***> wrote:
Hi, and thanks for the interest!
So yeah divergent migrations are verified by comparing the name and the
checksum of the migrations applied vs the ones on the filesystem
<https://github.com/rust-db/refinery/blob/main/refinery_core/src/traits/mod.rs#L19-L47>.
I don't know what might be causing your problem but I would suggest
comparing the mentioned migration checksum on both environments, If you
want we can add the checksums of the divergent migrations to the error
log here
<https://github.com/rust-db/refinery/blob/main/refinery_core/src/traits/mod.rs#L39>
—
Reply to this email directly, view it on GitHub
<#265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHQ42WEGYHVKX6NHUB3D3TWOM66VANCNFSM6AAAAAATF2F3TA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Thomas
|
Beta Was this translation helpful? Give feedback.
-
yeah, see here how we do it |
Beta Was this translation helpful? Give feedback.
-
Cool, I’ll let you know how it goes 👍
On Thu 22. Dec 2022 at 13:11, João Oliveira ***@***.***> wrote:
I’ll look at those checksums when I get a chance, is there any way I can
compute those checksums myself?
yeah see here
<https://github.com/rust-db/refinery/blob/main/refinery_core/src/runner.rs#L102-L124>
how we do it
—
Reply to this email directly, view it on GitHub
<#265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHQ42ROUJAITRJHTDTMCGDWORAQZANCNFSM6AAAAAATF2F3TA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Thomas
|
Beta Was this translation helpful? Give feedback.
-
Ok, quick update: I have confirmed that the GKE deployed version computes a
different hash vs the local version (even if run through docker).
We expected that, but it's still good to have confirmation. I'll spare you
the hashes themselves, as they are not useful here I think?
Next step would be to log all three inputs of the hash and to double check
the exact version of siphasher.
I'm out of time for now, but I'll pick it up again next week. In
the meantime brilliant ideas are of course welcome ;-).
…On Thu, Dec 22, 2022 at 1:18 PM Thomas Duindam ***@***.***> wrote:
Cool, I’ll let you know how it goes 👍
On Thu 22. Dec 2022 at 13:11, João Oliveira ***@***.***>
wrote:
> I’ll look at those checksums when I get a chance, is there any way I can
> compute those checksums myself?
>
> yeah see here
> <https://github.com/rust-db/refinery/blob/main/refinery_core/src/runner.rs#L102-L124>
> how we do it
>
> —
> Reply to this email directly, view it on GitHub
> <#265 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ASHQ42ROUJAITRJHTDTMCGDWORAQZANCNFSM6AAAAAATF2F3TA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
Thomas
|
Beta Was this translation helpful? Give feedback.
-
Having had 30 more minutes to look at this, I'm thinking 'probably not'.
I can reproduce the hashing issue locally using my production docker image,
before I was testing using a newly build image. I had assumed both to be
the same, but probably something went wrong with caching.
I have a hunch it might be related to cargo chef thinking that two version
are compatible when they are not. But I would have to look into it a bit
more to be sure. Do you know in what version you changed the hashing
algorithm?
…On Fri, Dec 23, 2022 at 7:35 PM João Oliveira ***@***.***> wrote:
are you using the same refinery version in both places? We updated it to
specifically use SipHasher13 whereas before it was using rust's Hasher.
Also for the sake of discarding hypothesis can you list the local operating
system?
—
Reply to this email directly, view it on GitHub
<#265 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHQ42US632LIYQP5BAMBPDWOXWFZANCNFSM6AAAAAATF2F3TA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I just wanted to do a quick check to see if I'm missing something super obvious here. I'm having some issues running my migrations locally vs in a GKE cluster.
I'm not sure if it is a bug, or if I'm simply doing something strange.
My app is containerized and connects through postgres through a proxy (GCP Cloud SQL Proxy). I can run the same setup connecting to the same database from my laptop and from GKE. On my laptop I can run it directly, or through a local k8s cluster (just to keep everything the same).
I always use the same proxy image and always target the same database.
On my local machine, regardless of the deployment scenario the
refinery
always correctly detects that the migrations have been applied already. However, every time I run on GKE the migration fails because it has detected a divergent migration.I think it must somehow related to the
checksum
field, and some differences between my local and GKE setups that causes the checksums to diverge...I can work around the issue by
set_abort_divergent(false)
, but that doesn't feel really safe either.I've run out of things to test, so I'm really hoping this sounds familiar to somebody. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions