1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

added some debug lines to help track down a problem

(This used to be ctdb commit 2ca31e9de179f76e392a26cc8305e2473357c760)
This commit is contained in:
Andrew Tridgell 2007-10-18 16:27:36 +10:00
parent 5e3d5b1314
commit b814462c38
2 changed files with 10 additions and 1 deletions

View File

@ -773,7 +773,7 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
} }
ctdb->recovery_lock_fd = open(ctdb->recovery_lock_file, O_RDWR|O_CREAT, 0600); ctdb->recovery_lock_fd = open(ctdb->recovery_lock_file, O_RDWR|O_CREAT, 0600);
if (ctdb->recovery_lock_fd == -1) { if (ctdb->recovery_lock_fd == -1) {
DEBUG(0,("Unable to open %s - (%s)\n", DEBUG(0,("ctdb_recovery_lock: Unable to open %s - (%s)\n",
ctdb->recovery_lock_file, strerror(errno))); ctdb->recovery_lock_file, strerror(errno)));
return false; return false;
} }
@ -789,6 +789,9 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
if (fcntl(ctdb->recovery_lock_fd, F_SETLK, &lock) != 0) { if (fcntl(ctdb->recovery_lock_fd, F_SETLK, &lock) != 0) {
close(ctdb->recovery_lock_fd); close(ctdb->recovery_lock_fd);
ctdb->recovery_lock_fd = -1; ctdb->recovery_lock_fd = -1;
if (keep) {
DEBUG(0,("ctdb_recovery_lock: Failed to get recovery lock on '%s'\n", ctdb->recovery_lock_file));
}
return false; return false;
} }
@ -797,5 +800,7 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
ctdb->recovery_lock_fd = -1; ctdb->recovery_lock_fd = -1;
} }
DEBUG(0,("ctdb_recovery_lock: Got recovery lock on '%s'\n", ctdb->recovery_lock_file));
return true; return true;
} }

View File

@ -806,6 +806,8 @@ static int do_recovery(struct ctdb_recoverd *rec,
uint32_t generation; uint32_t generation;
struct ctdb_dbid_map *dbmap; struct ctdb_dbid_map *dbmap;
DEBUG(0, (__location__ " Starting do_recovery\n"));
/* if recovery fails, force it again */ /* if recovery fails, force it again */
rec->need_recovery = true; rec->need_recovery = true;
@ -1511,6 +1513,8 @@ static void monitor_cluster(struct ctdb_context *ctdb)
struct ctdb_all_public_ips *ips; struct ctdb_all_public_ips *ips;
char c; char c;
DEBUG(0,("monitor_cluster starting\n"));
rec = talloc_zero(ctdb, struct ctdb_recoverd); rec = talloc_zero(ctdb, struct ctdb_recoverd);
CTDB_NO_MEMORY_FATAL(ctdb, rec); CTDB_NO_MEMORY_FATAL(ctdb, rec);