PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.68k stars 906 forks source link

PDNS authoritative server ID column overrun for records #14798

Closed ronnybremer closed 3 hours ago

ronnybremer commented 3 hours ago

Short description

Using MySQL as a backend the ID column did overflow after many years of operation. ID column is current type "INT" and hit the ceiling at 2147483646.

Environment

Steps to reproduce

  1. let it run for a long time with lots of dynamic updates coming in through AXFR
  2. monitor the MAX(ID) value in the DB on the records table
  3. see it reaching the maximum INT value

Expected behaviour

maybe using BIGINT?

Actual behaviour

INT column did reach the maximum value

Other information

maybe there is a way to "re-org" the table, but I wouldn't know if the ID column from the records table is referenced somewhere else.

Habbie commented 3 hours ago

What happens now that you have reached the limit? Is MySQL refusing inserts?

ronnybremer commented 3 hours ago

unable to xfr zone (PDNSException): GSQLBackend unable to feed record xxx.com|NS: Could not execute mysql statement: insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (?,?,?,?,?,?,?,?,?): Duplicate entry '2147483647' for key 'records.PRIMARY'

Habbie commented 3 hours ago

maybe using BIGINT?

the schema has said BIGINT since 4.1.0. Did you miss part of a schema migration?

ronnybremer commented 3 hours ago

@Habbie uhm ... that would be possible, I will verify it. Thank you for the hint!

ronnybremer commented 3 hours ago

grrr ... thank you again @Habbie! The schema was modified before, but the 3.4 to 4.1 was never executed. I did that now and the issue immediately went away.