r/mysql • u/KernelDeimos • Apr 23 '25
question replication corruption on bigint value
I need some assistance understanding what looks like a corrupted value in replicas.
Here's the scenario: 1 primary database, 8 read replicas. Database is MySQL, deployed with Amazon RDS. There is a single cell of data we are aware of that has the wrong value, only on read replicas. On the primary it's 500000000, on replicas it's -14592094872. Here's the column definition:
`amount` bigint NOT NULLHere's some additional information:
SELECT VERSION();returns8.0.40on all of these.SHOW VARIABLES LIKE 'binlog_format';showsMIXEDon the primary, andROWon replicas.show replica statusdoesn't seem to show any issues.
I ran select hex(amount) ... to get these values, in case they're helpful:
1DCD6500(correct primary value)FFFFFFFC9A3E4D68(incorrect replica value)
If I run a select count(*) from table_name where amount < 0 I actually get different responses too. Primary gives me 1231 and two replicas I tested give me 1203, so there's at least a handful of corrupt values.
So, what should I be looking for? How can I prevent this from happening in the future?
1
u/matt82swe Apr 24 '25
Are _all_ replicas consistent, that they all share the same corruption?
1
u/Emmanuel_BDRSuite Apr 24 '25
It seems like a replication issue due to different binlog formats , ensure all nodes use the same row binlog format
1
u/boborider Apr 26 '25
Have you check the column structure is UNSIGNED? Just curious. Also check if it is partitioned table.