[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/daemon cman.c gd_internal.h join ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2007-08-20 14:50:32

Modified files:
	group/daemon   : cman.c gd_internal.h joinleave.c main.c 

Log message:
	Call the new cman_set_dirty() api to disallow clusters both with
	fence/dlm/gfs state from merging.
	Adjust the oom setting for the daemon to avoid oom kills.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cman.c.diff?cvsroot=cluster&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&r1=1.57&r2=1.58

--- cluster/group/daemon/cman.c	2006/12/14 19:54:16	1.29
+++ cluster/group/daemon/cman.c	2007/08/20 14:50:30	1.30
@@ -28,6 +28,16 @@
 	return rv;
 }
 
+int set_cman_dirty(void)
+{
+	int rv;
+
+	rv = cman_set_dirty(ch);
+	if (rv)
+		log_print("cman_set_dirty error %d", rv);
+	return rv;
+}
+
 static int is_member(cman_node_t *node_list, int count, int nodeid)
 {
 	int i;
--- cluster/group/daemon/gd_internal.h	2007/02/09 16:03:15	1.47
+++ cluster/group/daemon/gd_internal.h	2007/08/20 14:50:30	1.48
@@ -277,6 +277,7 @@
 /* cman.c */
 int setup_cman(void);
 int kill_cman(int nodeid);
+int set_cman_dirty(void);
 
 /* cpg.c */
 int setup_cpg(void);
--- cluster/group/daemon/joinleave.c	2006/10/13 20:07:45	1.19
+++ cluster/group/daemon/joinleave.c	2007/08/20 14:50:30	1.20
@@ -85,6 +85,10 @@
 		goto out;
 	}
 
+	rv = set_cman_dirty();
+	if (rv)
+		goto out;
+
 	rv = create_group(name, level, &g);
 	if (rv)
 		goto out;
--- cluster/group/daemon/main.c	2007/01/11 17:59:00	1.57
+++ cluster/group/daemon/main.c	2007/08/20 14:50:30	1.58
@@ -904,6 +904,18 @@
 	}
 }
 
+void set_oom_adj(int val)
+{
+	FILE *fp;
+
+	fp = fopen("/proc/self/oom_adj", "w");
+	if (!fp)
+		return;
+
+	fprintf(fp, "%i", val);
+	fclose(fp);
+}
+
 void set_scheduler(void)
 {
 	struct sched_param sched_param;
@@ -939,8 +951,7 @@
 		write(fd, now_ascii, strlen(now_ascii));
 		write(fd, " groupd segfault log follows:\n", 30);
 		close(fd);
-	}
-	else
+	} else
 		perror(LOG_FILE);
 	if (sig == SIGSEGV)
 		exit(0);
@@ -960,10 +971,12 @@
 
 	signal(SIGSEGV, bail_with_log);
 	signal(SIGUSR1, bail_with_log);
+
 	if (!groupd_debug_opt)
 		daemonize();
 
 	set_scheduler();
+	set_oom_adj(-16);
 
 	pollfd = malloc(NALLOC * sizeof(struct pollfd));
 	if (!pollfd)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]