From a02843effb4c0d62ab7ee24a92b0d3981423dccc Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 9 May 2007 21:39:57 +0000 Subject: [PATCH] Update ReleaseNotes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4737 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ReleaseNotes | 5 +++++ bacula/src/cats/cats.h | 3 ++- bacula/src/cats/mysql.c | 8 ++++++++ bacula/src/cats/sql.c | 2 ++ bacula/src/dird/ua_status.c | 15 +++++++++------ bacula/src/lib/watchdog.c | 2 ++ 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index dd064788d6..b91abe4b2c 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -3,6 +3,11 @@ Bacula code: Total files = 438 Total lines = 154,329 (*.h *.c *.in) +This Director and Storage daemon must be upgraded at the same time, +but they should be compatible with all 2.0.x File daemons, unless you +use some of the new features that affect the FD. In other words, you should +not have to upgrade all your File daemons. + The major features are: - First cut of bat (Bacula Administration Tool) - Red/Black restore in memory tree (500 times faster loading). diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index b6101e883e..25254d3222 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -374,7 +374,7 @@ struct B_DB { /* "Generic" names for easier conversion */ #define sql_store_result(x) mysql_store_result((x)->db) #define sql_use_result(x) mysql_use_result((x)->db) -#define sql_free_result(x) mysql_free_result((x)->result) +#define sql_free_result(x) my_mysql_free_result(x) #define sql_fetch_row(x) mysql_fetch_row((x)->result) #define sql_query(x, y) mysql_query((x)->db, (y)) #define sql_close(x) mysql_close((x)->db) @@ -404,6 +404,7 @@ extern char* my_mysql_batch_lock_filename_query; extern char* my_mysql_batch_unlock_tables_query; extern char* my_mysql_batch_fill_filename_query; extern char* my_mysql_batch_fill_path_query; +extern void my_mysql_free_result(B_DB *mdb); #else diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 0834c5392a..ab993d187b 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -373,6 +373,14 @@ int db_sql_query(B_DB *mdb, const char *query, DB_RESULT_HANDLER *result_handler } +void my_mysql_free_result(B_DB *mdb) +{ + if (mdb->result) { + mysql_free_result(mdb->result); + mdb->result = NULL; + } +} + char *my_mysql_batch_lock_path_query = "LOCK TABLES Path write, " " batch write, " " Path as p write "; diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 79296d5d00..fef68b35f6 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -118,6 +118,8 @@ int QueryDB(const char *file, int line, JCR *jcr, B_DB *mdb, char *cmd) { int status; + + sql_free_result(mdb); if ((status=sql_query(mdb, cmd)) != 0) { m_msg(file, line, &mdb->errmsg, _("query %s failed:\n%s\n"), cmd, sql_strerror(mdb)); j_msg(file, line, jcr, M_FATAL, 0, "%s", mdb->errmsg); diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index 7b264d28cd..0fd354c308 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -38,6 +38,8 @@ #include "bacula.h" #include "dird.h" +extern void *start_sbrk; + static void list_scheduled_jobs(UAContext *ua); static void list_running_jobs(UAContext *ua); static void list_terminated_jobs(UAContext *ua); @@ -256,7 +258,7 @@ static void do_all_status(UAContext *ua) void list_dir_status_header(UAContext *ua) { char dt[MAX_TIME_LENGTH]; - char b1[35], b2[35], b3[35], b4[35]; + char b1[35], b2[35], b3[35], b4[35], b5[35]; ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE, HOST_OS, DISTNAME, DISTVER); @@ -268,11 +270,12 @@ void list_dir_status_header(UAContext *ua) ua->send_msg(_("Daemon started %s, %d Jobs run since started.\n"), dt, num_jobs_run); } - ua->send_msg(_(" Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"), - edit_uint64_with_commas(sm_bytes, b1), - edit_uint64_with_commas(sm_max_bytes, b2), - edit_uint64_with_commas(sm_buffers, b3), - edit_uint64_with_commas(sm_max_buffers, b4)); + ua->send_msg(_(" Heap: sbrk=%s bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"), + edit_uint64_with_commas((uint64_t)sbrk(0)-(uint64_t)start_sbrk, b1), + edit_uint64_with_commas(sm_bytes, b2), + edit_uint64_with_commas(sm_max_bytes, b3), + edit_uint64_with_commas(sm_buffers, b4), + edit_uint64_with_commas(sm_max_buffers, b5)); } static void do_director_status(UAContext *ua) diff --git a/bacula/src/lib/watchdog.c b/bacula/src/lib/watchdog.c index e28be1161c..2cd7bbfa0e 100644 --- a/bacula/src/lib/watchdog.c +++ b/bacula/src/lib/watchdog.c @@ -40,6 +40,7 @@ /* Exported globals */ time_t watchdog_time = 0; /* this has granularity of SLEEP_TIME */ time_t watchdog_sleep_time = 60; /* examine things every 60 seconds */ +void *start_sbrk; /* Locals */ static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -75,6 +76,7 @@ int start_watchdog(void) if (wd_is_init) { return 0; } + start_sbrk = sbrk(0); Dmsg0(800, "Initialising NicB-hacked watchdog thread\n"); watchdog_time = time(NULL); -- 2.39.5