diff options
author | Greg Hudson <ghudson@mit.edu> | 2013-01-22 17:42:37 -0500 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2013-01-22 17:49:50 -0500 |
commit | 7665c0677b59574c2c7ccd016221f8f4beafd279 (patch) | |
tree | d1ec1717f811370bc9e0fdd0262ea7086dfd0055 /src/kadmin | |
parent | 4b3937182b75e08eaf8f259828b018a2b6d2c111 (diff) | |
download | krb5-7665c0677b59574c2c7ccd016221f8f4beafd279.tar.gz krb5-7665c0677b59574c2c7ccd016221f8f4beafd279.tar.xz krb5-7665c0677b59574c2c7ccd016221f8f4beafd279.zip |
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/kadmin')
-rw-r--r-- | src/kadmin/dbutil/dump.c | 8 | ||||
-rw-r--r-- | src/kadmin/dbutil/kdb5_create.c | 7 |
2 files changed, 2 insertions, 13 deletions
diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index 600f07f843..869724af68 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -2884,13 +2884,7 @@ load_db(argc, argv) * no advantage in incr updates when entire db is replaced */ if (!(flags & FLAG_UPDATE)) { - memset(log_ctx->ulog, 0, sizeof (kdb_hlog_t)); - - log_ctx->ulog->kdb_hmagic = KDB_ULOG_HDR_MAGIC; - log_ctx->ulog->db_version_num = KDB_VERSION; - log_ctx->ulog->kdb_state = KDB_STABLE; - log_ctx->ulog->kdb_block = ULOG_BLOCK; - + ulog_init_header(util_context); log_ctx->iproprole = IPROP_NULL; if (!add_update) { diff --git a/src/kadmin/dbutil/kdb5_create.c b/src/kadmin/dbutil/kdb5_create.c index b34219b08e..cbdea16edc 100644 --- a/src/kadmin/dbutil/kdb5_create.c +++ b/src/kadmin/dbutil/kdb5_create.c @@ -301,12 +301,7 @@ void kdb5_create(argc, argv) * We're reinitializing the update log in case one already * existed, but this should never happen. */ - (void) memset(log_ctx->ulog, 0, sizeof (kdb_hlog_t)); - - log_ctx->ulog->kdb_hmagic = KDB_ULOG_HDR_MAGIC; - log_ctx->ulog->db_version_num = KDB_VERSION; - log_ctx->ulog->kdb_state = KDB_STABLE; - log_ctx->ulog->kdb_block = ULOG_BLOCK; + ulog_init_header(util_context); /* * Since we're creating a new db we shouldn't worry about |