[28394] in CVS-changelog-for-Kerberos-V5
krb5 commit [krb5-1.12]: Check for unstable ulog in ulog_get_entries
daemon@ATHENA.MIT.EDU (Tom Yu)
Thu Jun 26 16:06:56 2014
Date: Thu, 26 Jun 2014 16:06:35 -0400
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201406262006.s5QK6ZqC004752@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/ac93fc8f231f4dc152dcd24e7277dde12d595efe
commit ac93fc8f231f4dc152dcd24e7277dde12d595efe
Author: Greg Hudson <ghudson@mit.edu>
Date: Sun Jan 26 17:23:53 2014 -0500
Check for unstable ulog in ulog_get_entries
If a process terminates in the middle of a logged database update, it
will release its lock and leave the ulog in the KDB_UNSTABLE state.
kadmind should notice this when it calls ulog_get_entries, but right
now it only checks for the KDB_CORRUPT state (which is never set any
more) and does not recover. Check for any state other than KDB_STABLE
and recover by resetting the ulog and forcing full resyncs to slaves.
(cherry picked from commit 91ef7d4c3f892b99630422a71780788f2d1c04d7)
ticket: 7853
version_fixed: 1.12.2
status: resolved
src/lib/kdb/kdb_log.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/lib/kdb/kdb_log.c b/src/lib/kdb/kdb_log.c
index 21cb09d..71f0a33 100644
--- a/src/lib/kdb/kdb_log.c
+++ b/src/lib/kdb/kdb_log.c
@@ -561,12 +561,10 @@ ulog_get_entries(krb5_context context, kdb_last_t last,
if (retval)
return retval;
- /* Check to make sure we don't have a corrupt ulog first. */
- if (ulog->kdb_state == KDB_CORRUPT) {
- ulog_handle->ret = UPDATE_ERROR;
- (void)ulog_lock(context, KRB5_LOCKMODE_UNLOCK);
- return KRB5_LOG_CORRUPT;
- }
+ /* If another process terminated mid-update, reset the ulog and force full
+ * resyncs. */
+ if (ulog->kdb_state != KDB_STABLE)
+ ulog_reset(ulog);
/*
* We need to lock out other processes here, such as kadmin.local, since we
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5