[SCM] CTDB repository - branch master updated - ctdb-2.1-13-ga82d3ec

Amitay Isaacs amitay at samba.org
Mon Feb 4 18:37:40 MST 2013


The branch, master has been updated
       via  a82d3ec12f0fda16d6bfa8442a07595de897c10e (commit)
       via  a4f622e85168f59417c11705f1734e0352e1d44a (commit)
      from  25a20409fb39a94b64c13990c0eba4f75d482ecd (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a82d3ec12f0fda16d6bfa8442a07595de897c10e
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 5 12:09:36 2013 +1100

    Logging: Free the ringbuffer in child processes created with ctdb_fork()
    
    At the moment the log ringbuffer is duplicated in every child process.
    Althought it is copy-on-write we want to see if it is contributing to
    out-of-memory situations when there are a lot of children.
    
    The ringbuffer isn't accessible from any of the children anyway...
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a4f622e85168f59417c11705f1734e0352e1d44a
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 5 12:08:11 2013 +1100

    Logging: New function ctdb_log_ringbuffer_free()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 common/ctdb_fork.c     |    3 +++
 common/ctdb_logging.c  |    9 ++++++++-
 include/ctdb_private.h |    2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_fork.c b/common/ctdb_fork.c
index 24534e6..a11f75a 100644
--- a/common/ctdb_fork.c
+++ b/common/ctdb_fork.c
@@ -59,6 +59,9 @@ pid_t ctdb_fork(struct ctdb_context *ctdb)
 			ctdb_restore_scheduler(ctdb);
 		}
 		ctdb->can_send_controls = false;
+
+		ctdb_log_ringbuffer_free();
+
 		return 0;
 	}
 
diff --git a/common/ctdb_logging.c b/common/ctdb_logging.c
index 09b1df2..105b4df 100644
--- a/common/ctdb_logging.c
+++ b/common/ctdb_logging.c
@@ -85,7 +85,14 @@ void log_ringbuffer(const char *format, ...)
 	va_end(ap);
 }
 
-
+void ctdb_log_ringbuffer_free(void)
+{
+	if (log_entries != NULL) {
+		free(log_entries);
+		log_entries = NULL;
+	}
+	log_ringbuf_size = 0;
+}
 
 void ctdb_collect_log(struct ctdb_context *ctdb, struct ctdb_get_log_addr *log_addr)
 {
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 5b519fb..cd0feaa 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -1435,7 +1435,7 @@ void ctdb_collect_log(struct ctdb_context *ctdb, struct ctdb_get_log_addr *log_a
 void ctdb_clear_log(struct ctdb_context *ctdb);
 int32_t ctdb_control_get_log(struct ctdb_context *ctdb, TDB_DATA addr);
 int32_t ctdb_control_clear_log(struct ctdb_context *ctdb);
-
+void ctdb_log_ringbuffer_free(void);
 
 struct ctdb_log_state *ctdb_fork_with_logging(TALLOC_CTX *mem_ctx,
 					      struct ctdb_context *ctdb,


-- 
CTDB repository


More information about the samba-cvs mailing list