Skip to content

improve calculation of database size

Evan Hunt requested to merge 1661-fix-dbsize-v9_16 into v9_16

"max-journal-size" is set by default to twice the size of the zone database. however, the calculation of zone database size was flawed.

  • change the size calculations in dns_db_getsize() to more accurately represent the space needed for a journal file or *XFR message to contain the data in the database. previously we returned the sizes of all rdataslabs, including header overhead and offset tables, which resulted in the database size being reported as much larger than the equivalent journal transactions would have been.
  • map files caused a particular problem here: the full name can't be determined from the node while a file is being deserialized, because the uppernode pointers aren't set yet. so we store "full name length" in the dns_rbtnode structure while serializing, and clear it after deserialization is complete.

Closes #1661 (closed)

Merge request reports