]> git.ipfire.org Git - thirdparty/krb5.git/commit
Maintain complete ulog on iprop slaves
authorGreg Hudson <ghudson@mit.edu>
Sat, 25 Jan 2014 19:40:41 +0000 (14:40 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 21 Feb 2014 01:45:51 +0000 (20:45 -0500)
commit406c83c835a8ce062d798a2ec4eda2eddd088450
tree75f7a673c925aa7599737ae21c5acb9e3ef3e259
parent6a4a4b7b5e3265e4a811a9fd72c2534e6c5f5fd4
Maintain complete ulog on iprop slaves

Factor out most of ulog_add_update into a helper function named
store_update, and make ulog_add_update just responsible for assigning
a serial number and timestamp to the update before storing it.  In
ulog_replay, use store_update and ulog_finish_update to add each
update to the ulog in addition to replaying it to the database.  Don't
use incr_ret->lastentry to set kdb_last_sno/kdb_last_time, since it
will have been set properly by adding the individual updates; instead,
just reinitialize the ulog on error.

Slave ulogs use serial numbers provided from upstream, and thus do not
always begin at serial number 1 after a header reset.  As a result, we
must: (A) in store_update, detect the first update (for which we must
assign kdb_first_sno/kdb_first_time) by comparing kdb_num to 0,
instead of by comparing the serial number to 1; (B) in store_update,
detect that we are overwriting the first update by comparing kdb_num
to ulogentries, instead of comparing the serial number to ulogentries;
and (C) in ulog_map, detect that ulogentries changed by verifying the
first and last serial number and timestamp against the actual ulog
entries, rather than simply comparing kdb_last_sno to kdb_num.

Based on code submitted by Richard Basch.

ticket: 7855
src/lib/kdb/kdb_log.c