1

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 NULL

Here's some additional information:

  • SELECT VERSION(); returns 8.0.40 on all of these.
  • SHOW VARIABLES LIKE 'binlog_format'; shows MIXED on the primary, and ROW on replicas.
  • show replica status doesn't seem to show any issues.
  • show create table ... shows the column has the same type on both the primary and replicas.

I ran select hex(amount) ... to get these values, in case they're helpful:

  • 1DCD6500 (correct primary value)
  • FFFFFFFC9A3E4D68 (incorrect replica value)
3
  • have you a trigger tat changes the data?that looks suspicious as if a conversion went wrong. Amazon has its buggy own version of mysql, soyou should as the support there,if it is one of the many bugs they introduced
    – nbk
    Commented Apr 26 at 20:25
  • @nbk we don't use triggers at all; we pretty much only use the basics - we define indexes and that's pretty much it. We don't even use views. So, are you saying Amazon forks MySQL? That makes a big difference if that's true. RDS wasn't my decision, I wanted to host the DB myself, but we choose to use RDS to avoid the devops overhead. If this is actually an Amazon-introduced bug that might give me a better case for moving away from that. (as long as we do it on EC2 instances we won't get hit with extra bandwidth cost) Commented 2 days ago
  • It can be a bug in mysql which was already fixed, but Amazon didn't add the change to its repo
    – nbk
    Commented 2 days ago

1 Answer 1

-1

Your column is the wrong type and your data value has overflowed. Increase the size of integer it is defined as.

1
  • I just added a clarification to my question. I tried show create table table_name on both the primary and replicas. The column definition is bigint NOT NULL on both. However, the value 500000000 would not even overflow on a signed 32-bit integer. Overflow was the first thing that crossed my mind too, but I can't find any way to make that theory work. Commented Apr 24 at 20:16

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.