From: Kern Sibbald Date: Mon, 5 Apr 2004 12:38:38 +0000 (+0000) Subject: Fix restore for PostgreSQL ordering + update ChangeLog X-Git-Tag: Release-1.34.0~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b815feff318aa927c3b4b59a7fdef3424bf6de4;p=bacula%2Fbacula Fix restore for PostgreSQL ordering + update ChangeLog git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1182 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index f7f20a7c05..c846feb779 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,4 +1,44 @@ +2004-04-05 Version 1.34.0 04Apr04 Release +04Apr04 +- A good number of document updates. +- Fixed the order which multiple files are accepted for + inclusion in the restore tree due to the fact that PostgreSQL + returns files in a different order from their insertion. +02Apr04 +- Fix autochanger test in btape. It used old editing routines. +- Fix run_program to return 0 if program runs and no output. +- Add more debug to run_program. +- Make signal debug print signal string. +01Apr04 +- Build console with client-only build. +- Add better error messages to some of the db_xxx routines. +- Apply Christopher Hull's patches for proper Win32 shutdown. +- Eliminate True and False in favor of true and false. +- Put correct thread id in jcr once the correct thread is running. +- Zap head and tail pointers in dlist when everything is removed. +- Rework sm_dump() so that it won't overrun a buffer when editing + and error message. +- Fix watchdog to properly remove entries while walking the + dlist chain. +- Fix termination of last_jobs list by removing broken code. +31Mar04 +- Update dbcheck to fix Paths without a trailing slash and Filenames + with a trailing slash. +30Mar04 +- Add -p option to all SD programs including bacula-sd. It causes + Bacula to proceed or forge on in case of I/O errors. It is unlikely + this will help, and it is strongly recommended against running + the daemon with this option in production. +- Tweaked the Makefile not to create the gnome directories except + when doing a gnome install. +28Mar04 +- Implement Qmsg() queuing of messages to prevent recursion especially + for bnet.c where recursion is fatal. +- Add detection of ncurses if the termcap lib is not found. +- Tweak winabout -- start cleanup. +- Fix dlist again, when list is destroyed, be sure to null head and + tail pointers. 27Mar04 - Make the default for restore to have nothing marked. - The "all" keyword on the restore command marks everything by @@ -14,7 +54,7 @@ 24Mar04 - Apply corrected SQL to sql_get.c supplied by Dan Langille. - Implement "delete job jobid=xxx jobid=yyy ..." -- Implemente "purge volume=xxx volume=yyy ..." +- Implement "purge volume=xxx volume=yyy ..." - Fix buffer overrun in query string substitution. 22Mar04 - Fix bad format %s instead of %d for editing new slot in update volume. diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index f31e076058..6ba7273902 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -4,10 +4,11 @@ Bacula code: Total files = 306 Total lines = 91,112 (*.h *.c *.in) Major Features: -- Data spooling which eliminates tape shoe-shine during Inc backups, +- Data spooling which reduces tape shoe-shine during Inc backups, and permits multiple simultaneous backups without interleaved blocks. - Native Win32 client -- much faster and restores permissions correctly (thanks to Christopher Hull) +- New Windows style installer for the Win32 Client. - PostgreSQL database driver (thanks to Dan Langille). - Polling of devices eliminating need to unmount and mount from console. @@ -17,11 +18,13 @@ Major Features: - JobDefs resource permits smaller .conf files for Director - Access console lists for the Console - Pool level overrides. -- Daemon statistics memory. +- Daemon "status" is recovered across daemon executions. - Improved btape "test" and "fill" commands. Items to note: !!!!! +- If you have a RedHat system, be sure to delete the /lib/tls + directory from your system. It contains defective pthreads code. - The restore default is changed to have nothing selected by default. You must either enter: "restore all" or after getting into the tree selection prompt enter "mark *" to have everything selected. @@ -44,6 +47,9 @@ Items to note: !!!!! "test" command will tell you. If you get an error with TWOEOF set to yes, set it to no. +- If you want either bsmtp or bconsole on Win32, you will need + to load the 1.32 version along with cygwin1.dll. Some solution + for this will be forthcoming in a future update. - The daemon protocol has changed from version 1.32, you must update everything at once. - The database level has been updated. You must either re-initialize @@ -113,7 +119,14 @@ New Commands: Additional changes: -- Implement Gnome 2.0 restore GUI +- Slackware support +- On multiple ctl-c, exit from console quickly. +- Implement "delete job jobid=xxx jobid=yyy ..." +- Implement "purge volume=xxx volume=yyy ..." +- Add -p option to all SD programs including bacula-sd. It causes + Bacula to proceed or forge on in case of I/O errors. It is unlikely + this will help, and it is strongly recommended against running + the daemon with this option in production. - Add a missing unlock in the jobq handler. - Fix bug where a soft linked file and a directory had the same name by treating the soft link as a directory and putting the entries under diff --git a/bacula/src/dird/ua_tree.c b/bacula/src/dird/ua_tree.c index 5ebf41bf25..d383ff3bff 100644 --- a/bacula/src/dird/ua_tree.c +++ b/bacula/src/dird/ua_tree.c @@ -154,7 +154,9 @@ int insert_tree_handler(void *ctx, int num_fields, char **row) char fname[5000]; TREE_NODE *node, *new_node; int type; - bool hard_link; + bool hard_link, first_time, ok; + int FileIndex; + JobId_t JobId; strip_trailing_junk(row[1]); if (*row[1] == 0) { /* no filename => directory */ @@ -174,24 +176,39 @@ int insert_tree_handler(void *ctx, int num_fields, char **row) } hard_link = (decode_LinkFI(row[4], &statp) != 0); bsnprintf(fname, sizeof(fname), "%s%s%s", row[0], row[1], ""); -// S_ISLNK(statp.st_mode)?" ->":""); Dmsg3(200, "FI=%d type=%d fname=%s\n", node->FileIndex, type, fname); new_node = insert_tree_node(fname, node, tree->root, NULL); /* Note, if node already exists, save new one for next time */ if (new_node != node) { + first_time = false; /* we saw this file before */ tree->avail_node = node; /* node already exists */ } else { + first_time = true; /* first time we saw this file */ tree->avail_node = NULL; /* added node to tree */ } + JobId = (JobId_t)str_to_int64(row[3]); + FileIndex = atoi(row[2]); /* - * If the user has backed up a hard linked file twice, the - * second copy will be a pointer (i.e. hard link will be set), - * so we do not overwrite the original file with a pointer file. + * - The first time we see a file, we accept it. + * - In the same JobId, we accept only the first copy of a + * hard linked file (the others are simply pointers). + * - In the same JobId, we accept the last copy of any other + * file -- in particular directories. + * + * All the code to set ok could be condensed to a single + * line, but it would be even harder to read. */ - if (!new_node->hard_link || hard_link) { + ok = true; + if (!first_time && JobId == new_node->JobId) { + if ((hard_link && FileIndex > new_node->FileIndex) || + (!hard_link && FileIndex < new_node->FileIndex)) { + ok = false; + } + } + if (ok) { new_node->hard_link = hard_link; - new_node->FileIndex = atoi(row[2]); - new_node->JobId = (JobId_t)str_to_int64(row[3]); + new_node->FileIndex = FileIndex; + new_node->JobId = JobId; new_node->type = type; new_node->soft_link = S_ISLNK(statp.st_mode) != 0; if (tree->all) {