Browse files

Reset ulog if database load failed.

Avoids a slave reporting it is current when a full resync fails
  • Loading branch information...
1 parent 44d4894 commit 2ef5ae0607d1c317a936e439b4be7a6f5184dc2f rbasch committed Mar 3, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/kadmin/dbutil/dump.c
View
14 src/kadmin/dbutil/dump.c
@@ -2977,6 +2977,20 @@ load_db(argc, argv)
*/
if (!(flags & FLAG_UPDATE)) {
if (exit_status) {
+
+ /* Re-init ulog so we don't accidentally think we are current */
+ if (log_ctx && log_ctx->iproprole) {
+ log_ctx->ulog->kdb_last_sno = 0;
+ log_ctx->ulog->kdb_last_time.seconds = 0;
+ log_ctx->ulog->kdb_last_time.useconds = 0;
+
+ log_ctx->ulog->kdb_first_sno = 0;
+ log_ctx->ulog->kdb_first_time.seconds = 0;
+ log_ctx->ulog->kdb_first_time.useconds = 0;
+
+ ulog_sync_header(log_ctx->ulog);
+ }
+
kret = krb5_db_destroy(kcontext, db5util_db_args);
/*
* Ignore a not supported error since there is nothing to do about

0 comments on commit 2ef5ae0

Please sign in to comment.