Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domains table notified_serial needs bigint instead of integer #6815

Closed
klaus3000 opened this issue Jul 30, 2018 · 4 comments · Fixed by #8097
Closed

domains table notified_serial needs bigint instead of integer #6815

klaus3000 opened this issue Jul 30, 2018 · 4 comments · Fixed by #8097

Comments

@klaus3000
Copy link

  • Program: Authoritative
  • Issue type: Bug report

Short description

It seems there was a change from PDNS 4.0 to PDNS 4.1 (or even earlier) how serials in the range from 2^31 - 2^32-1 were handled.

Old version: internally the notified_serial was treated as unsigned, but when written into the DB, it was stored as INTEGER (signed). Hence, serials > 2^31 where stored as negative values. When read from DB the notified_serial was transparently converted again into the correct unsigned value.

PDNS 4.1: now the database code wants to write the unsigned type as unsigned type into the DB, and this fails (testet with Postgresql backend):

pdns[32458]: AXFR done for 'xxx.wien', zone committed with serial number 2824191541
pdns[32458]: Queued also-notification of domain 'xxx.wien' to 176.9.98.135:53
pdns[32458]: Unable to AXFR zone 'xxx.wien' from remote 'xx.59.115.xx' (PDNSException): GSQLBackend unable to refresh domain_id 533900: Fatal error during query: update soap_domains set notified_serial=$1 where id=$2: ERROR: value "2824191541" is out of range for type integer

Further, reading the old-style negative values will fail to:

Unable to parse record during incoming AXFR of 'xxx.ch' (std::exception): stoul returned result out of unsigned int range; data was "-1470775755"

Fix new installations:

  • In the DB schema change the notified_serial type from INTEGER to BIGINT

Fix existing installations:

ALTER TABLE domains ALTER notified_serial TYPE BIGINT;
BEGIN;
NOTE: at this point PowerDNS will receive Postgresql Errors (prepared statements) and should be restartet
UPDATE domains SET notified_serial = NULL WHERE notified_serial < 0;
COMMIT;

Environment

  • Operating system: Debian
  • Software version: PDNS 4.1 + Postgresql Backend
  • Software source: self compiled
@robert-s-lee
Copy link

Wanted check on the progress On this issue.

@Habbie Habbie modified the milestones: auth-4.1.x, auth-4.2.0 Jun 21, 2019
@Habbie
Copy link
Member

Habbie commented Jun 21, 2019

There's no progress, but I've moved it from 4.1.x to 4.2.0 so that we will likely look at it soon.

@Habbie
Copy link
Member

Habbie commented Jul 17, 2019

MSSQL mildly suffers from this issue - in 4.2, it still does the mapping to negative like older versions of pdns did with postgres, so it does not error.

@Habbie
Copy link
Member

Habbie commented Jul 17, 2019

#8097 for postgres

@Habbie Habbie changed the title domains table notified_serial needs bigint instead of interger domains table notified_serial needs bigint instead of integer Jul 17, 2019
Habbie added a commit to Habbie/pdns that referenced this issue Jul 25, 2019
Habbie added a commit to Habbie/pdns that referenced this issue Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants