From 8a4cc0d15609b106d45e31c59cd1703fda26f71f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 21 Aug 2007 08:53:17 +0000 Subject: [PATCH] kes Fix Director crash when running bat SQL queries. kes Add David's notes on Item 8: Copy pools. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5387 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/projects | 50 ++++++++++++++++++++++++++++++++++-- bacula/src/dird/ua_dotcmds.c | 4 +-- bacula/src/version.h | 4 +-- bacula/technotes-2.3 | 3 +++ 4 files changed, 55 insertions(+), 6 deletions(-) diff --git a/bacula/projects b/bacula/projects index fca2ed9e96..3653905742 100644 --- a/bacula/projects +++ b/bacula/projects @@ -260,8 +260,54 @@ Item 8: Implement Copy pools Notes: I would commit some of my developers' time if we can agree on the design and behavior. - Notes: I get the idea, but would like more details on the precise - syntax of the necessary directives and what they would do. + Notes: Additional notes from David: + I think there's two areas where new configuration would be needed. + + 1) Identify a "SD mux" SD (specify it in the config just like a normal + SD. The SD configuration would need something like a "Daemon Type = + Normal/Mux" keyword to identify it as a multiplexor. (The director code + would need modification to add the ability to do the multiple session + setup, but the impact of the change would be new code that was invoked + only when a SDmux is needed). + + 2) Additional keywords in the Pool definition to identify the need to + create copies. Each pool would acquire a Copypool= attribute (may be + repeated to generate more than one copy. 3 is about the practical limit, + but no point in hardcoding that). + + Example: + Pool { + Name = Primary + Pool Type = Backup + Copypool = Copy1 + Copypool = OffsiteCopy2 + } + + where Copy1 and OffsiteCopy2 are valid pools. + + In terms of function (shorthand): + Backup job X is defined normally, specifying pool Primary as the pool to + use. Job gets scheduled, and Bacula starts scheduling resources. + Scheduler looks at pool definition for Primary, sees that there are a + non-zero number of copypool keywords. The director then connects to an + available SDmux, passes it the pool ids for Primary, Copy1, and + OffsiteCopy2 and waits. SDmux then goes out and reserves devices and + volumes in the normal SDs that serve Primary, Copy1 and OffsiteCopy2. + When all are ready, the SDmux signals ready back to the director, and + the FD is given the address of the SDmux as the SD to communicate with. + Backup proceeds normally, with the SDmux duplicating blocks to each + connected normal SD, and returning ready when all defined copies have + been written. At EOJ, FD shuts down connection with SDmux, which closes + down the normal SD connections and goes back to an idle state. + SDmux does not update database; normal SDs do (noting that file is + present on each volume it has been written to). + + On restore, director looks for the volume containing the file in pool + Primary first, then Copy1, then OffsiteCopy2. If the volume holding the + file in pool Primary is missing or busy (being written in another job, + etc), or one of the volumes from the copypool list that have the file in + question is already mounted and ready for some reason, use it to do the + restore, else mount one of the copypool volumes and proceed. Item 9: Scheduling syntax that permits more flexibility and options diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 6dbc8e4aa0..a87319f372 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -468,9 +468,9 @@ static int sql_handler(void *ctx, int num_field, char **row) for (int i=0; num_field--; i++) { if (i == 0) { - pm_strcpy(rows, row[0]); + pm_strcpy(rows, NPRT(row[0])); } else { - pm_strcat(rows, row[i]); + pm_strcat(rows, NPRT(row[i])); } pm_strcat(rows, "\t"); } diff --git a/bacula/src/version.h b/bacula/src/version.h index b9f5ee182a..02778fb5fd 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.1" -#define BDATE "16 August 2007" -#define LSMDATE "16Aug07" +#define BDATE "21 August 2007" +#define LSMDATE "21Aug07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index bcf9b30944..5f5235f9a0 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,9 @@ Technical notes on version 2.3 General: +21Aug07 +kes Fix Director crash when running bat SQL queries. +kes Add David's notes on Item 8: Copy pools. 18Aug07 kes Rework projects file to be current and ready for a vote. kes Enhance lex scanner error message. -- 2.39.5