aboutsummaryrefslogtreecommitdiff
path: root/src/slave
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-01-22 17:42:37 -0500
committerGreg Hudson <ghudson@mit.edu>2013-01-22 17:49:50 -0500
commit7665c0677b59574c2c7ccd016221f8f4beafd279 (patch)
treed1ec1717f811370bc9e0fdd0262ea7086dfd0055 /src/slave
parent4b3937182b75e08eaf8f259828b018a2b6d2c111 (diff)
downloadkrb5-7665c0677b59574c2c7ccd016221f8f4beafd279.zip
krb5-7665c0677b59574c2c7ccd016221f8f4beafd279.tar.gz
krb5-7665c0677b59574c2c7ccd016221f8f4beafd279.tar.bz2
Fix iprop log reinitialization
If the master iprop log is reinitialized to serial number 0, slaves will need to take a full dump--but after that happens, we need to know whether the slave has taken that full dump, we we don't offering full dumps indefinitely. So, record a timestamp in kdb_last_time when we reinitialize the log header, and compare the slave timestamp to kdb_last_time whenever it has the current serial number, even if it's 0. Test this by performing a propagation with sno 0 in t_iprop.py and detecting whether kpropd gets a second UPDATE_FULL_RESYNC_NEEDED response from kadmind. ticket: 7550 (new)
Diffstat (limited to 'src/slave')
-rw-r--r--src/slave/kpropd.c2
-rw-r--r--src/slave/kproplog.c12
2 files changed, 3 insertions, 11 deletions
diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c
index 6272302..e0a8031 100644
--- a/src/slave/kpropd.c
+++ b/src/slave/kpropd.c
@@ -834,6 +834,8 @@ reinit:
now = time(NULL);
if (frrequested &&
(now - frrequested) < params.iprop_resync_timeout) {
+ if (debug)
+ fprintf(stderr, _("Still waiting for full resync\n"));
break;
} else {
frrequested = now;
diff --git a/src/slave/kproplog.c b/src/slave/kproplog.c
index c6f244b..fc4c559 100644
--- a/src/slave/kproplog.c
+++ b/src/slave/kproplog.c
@@ -566,17 +566,7 @@ main(int argc, char **argv)
}
if (reset) {
- ulog->kdb_hmagic = KDB_ULOG_HDR_MAGIC;
- ulog->db_version_num = KDB_VERSION;
- ulog->kdb_state = KDB_STABLE;
- ulog->kdb_block = ULOG_BLOCK;
- ulog->kdb_first_sno = 0;
- ulog->kdb_first_time.seconds = 0;
- ulog->kdb_first_time.useconds = 0;
- ulog->kdb_last_sno = 0;
- ulog->kdb_last_time.seconds = 0;
- ulog->kdb_last_time.useconds = 0;
- ulog_sync_header(ulog);
+ ulog_init_header(context);
printf(_("Reinitialized the ulog.\n"));
exit(0);
}