0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsCopyright (C) 1999-2001, 2004, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsThis Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsLicense, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsfile, You can obtain one at http://mozilla.org/MPL/2.0/.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews$Id: db_rules,v 1.8 2004/03/05 05:04:46 marka Exp $
6a93e240dc565eeec79d3cb6da665ba4e0baa46cBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyHere is a more formal statement of the important database design
6a93e240dc565eeec79d3cb6da665ba4e0baa46cBob Halleyrules. Each rule has a 5 character mnemonic, for use in source code
6a93e240dc565eeec79d3cb6da665ba4e0baa46cBob Halleycomments.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyReference Safety [DBREF]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 1) Any node reference retrieved from the database shall remain
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley valid until discarded by the caller.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 2) Any rdataset retrieved from the database shall remain valid,
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley with its rdata contents unaltered, until it has been discarded
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley by the caller.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob HalleyDatabase Type [DBTYP]
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley Every database is either a zone database or a cache database. This
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley type is chosen when the database is created and cannot be altered.
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyBasic Versioning [DBVER]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley The rdata contents of a committed version in a zone database
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley do not change.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyDatabase Future Version [DBFUV]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 1) Zone databases may have at most one open future version.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 2) When committed, the future version becomes the current version.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6a93e240dc565eeec79d3cb6da665ba4e0baa46cBob Halley 3) Until committed, the future version changes may be rolled
6a93e240dc565eeec79d3cb6da665ba4e0baa46cBob Halley back.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyNode Lookups [DBNLU]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley A node lookup shall return:
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley 1) A node handle if the node was found.
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley 2) A result code.
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley
239e16ec9e931bc94c2a00f328945951fca959f5Bob Halley 3) Ancestor information. (XXX MORE INFO XXX)
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyZone Node Lookups [DBZNL]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley A node zone lookup returns the requested node, if it exists, in the
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley version specified, or DNS_R_NONEXISTENT otherwise.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyZone Rdataset Lookups [DBZRL]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley A zone lookup returns the requested data, if any, in the
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley version specified, or DNS_R_NONEXISTENT otherwise.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyCache Node Lookups [DBCNL]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 1) A node lookup shall return a handle to the desired node,
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley if it exists.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 2) If there is a negative caching entry for the desired node,
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley DNS_R_NONEXISTENT shall be returned.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 3) If the desired node does not exist, and there is not a
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley negative caching entry, DNS_R_UNKNOWN shall be returned.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyCache Rdataset Lookups [DBCRL]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 1) A cache lookup returns the most recently written data
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley (if any).
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 2) If there is a negative caching entry for the desired data,
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley DNS_R_NONEXISTENT shall be returned.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley 3) If the requested data does not exist, and there is not a
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley negative caching entry, DNS_R_UNKNOWN shall be returned.
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob HalleyCache Updates [DBCUP]
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley Concurrent attempts to update the same rdataset type of a given
6b85b14c920fce30fead7fa9611a92d43b30876bBob Halley node must appear to execute in some order.