Factor out ulog serial number status check
authorGreg Hudson <ghudson@mit.edu>
Mon, 20 Jan 2014 23:46:52 +0000 (18:46 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 20 Feb 2014 20:55:48 +0000 (15:55 -0500)
commitd1f9aa3737b2b3e62b5c5ed488d6112b7ce8a5ad
treef5f86bc7a30d0c05db26e9dacc20e875cf9bac9e
parent444ef5fe9ec8d64a5db27b3a8aaf6813dd7ef0e0
Factor out ulog serial number status check

Add a new function ulog_get_sno_status, which checks a serial number
and timestamp against the ulog for currency.  Use it in kdb5_util dump
and in ulog_get_entries.  Adjust parse_iprop_header's contract in
dump.c to better match the ulog_get_sno_status contract.

This change causes some minor behavior differences.  kadmind will
check for an empty ulog unless the last serial number matches exactly,
and will never set lastentry when returning UPDATE_FULL_RESYNC_NEEDED
(which was pointless).  kdb5_util dump will recognize a dump file as
current if it exactly matches the last serial number, even if the ulog
is empty; it will be more robust in the presence of non-monotonic
clocks; and it will properly lock around the ulog access.
src/include/kdb_log.h
src/kadmin/dbutil/dump.c
src/lib/kdb/kdb_log.c
src/lib/kdb/libkdb5.exports