From: Kern S. <ke...@us...> - 2010-07-23 06:04:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Bacula". The branch, Branch-5.1 has been updated via 9bfdb2c0c6f82676297ab0e8dc4727a3a382046c (commit) via 5a20e773ef0f07266bed15b46c07d451243f4c29 (commit) via da14476eaf33bea941cdc5df029724f591c262e8 (commit) via 0d421b2e252b0b9666f0bfa3cfdf0146925748f5 (commit) via c77b7be0bf13cb8134c6dda7271630aaf09edd03 (commit) via 2ab3b4ee2f42a7d6c4cc160175ee6daf602935ff (commit) via cd6a67d7155827f19bf296ae0f4d96985a32bc34 (commit) via 2afaa1be1aac1a6965db3ecac0cdcbda581ecf09 (commit) via 4d924e0a2daad1d60da6fd905491cd300984d6e1 (commit) via fb56da1203dc9730c8866786121f087f9036fb2f (commit) via c69447cc1b0bf4cfeb5edf0d130f7f16c0bed7bc (commit) via a4952a094e2cd027eb3784a8bb8d3f6b74534ec2 (commit) via b5d3299846a2c664c0e3191b17419ebd17d904e3 (commit) via 5548fdd503dcd9c68b0ad5584bd7c7972da17ed8 (commit) via 3ba08884c7820faea2891a8f9870875e320a0070 (commit) via 325ceeb2d12846a58500db60fbcc3be7bdcf5bef (commit) via f1dc25c2a1a02609d93c255e5c7f9dfd0252a729 (commit) via a25824ee84751430e4411f1086abcf4904cc00e6 (commit) via ffbc256e9508286180e2f5cafcc4e23418ed4be5 (commit) via c0763266c9ade8be0d80258c0b0bc6df60c6f925 (commit) via 7159a3c25a6fe10e5e0922baeb904188f2093529 (commit) via bebdba3c21ad8edb10e89b078a9b59658a0a1d9f (commit) via 2fc9c0ca54ee013dba02be134073d5b4f67b55e4 (commit) via 105ad5e3ed5d323eb0e9a34ff669241e955f636e (commit) via 9b7de45c47077845e13da75aa1540f6e86b8bf82 (commit) via c9fc10ec7525ce49e9f2672e88c9f0a73f48bd3b (commit) via fbb306e4bf7354675977b8cff1a76b91c48064b4 (commit) via 0fcdd3800cdf62962b4b3696824c8b594a1a8a90 (commit) via 946a8ae46737554c456d24a6269ee7db661aabc6 (commit) via 7a839e91c7a9b2697a9d0a8417c86b44c76581c5 (commit) via 749a5a8e66d34e7a75caa159e289584832e026ff (commit) via 88f26d65d3e982ea07f231d11f8f060af1a97715 (commit) via a2523c3cb28cecd07b2b5e50a1bb18760c693b0a (commit) via 186694703732f6ca405db0a5ded854bf3616a1e4 (commit) via d7d30c611630207364a39f95bf0c7e6a0876563b (commit) via a1607ea19d8baa71b9e4b1080e47bdb60098d514 (commit) via 59636f4a08fc0ff2414ff58409f7243f460d0b2e (commit) via 7a80c508bf300556b6389b05fc4e61d534458ea5 (commit) via b5a1603e6864dc5885d993693c1e54067818db82 (commit) via de43070223821a063a2129434b26f1486d9dd968 (commit) via d43baa97c5535cf6831944d34be418a7e9ced97f (commit) via a523bb54b558761bb5741dea5374dc6bc08b1207 (commit) via cccc4a69a6abf234b42000c590f9bfa43c4721ac (commit) via 89fe44558fefda6bf608f0bde13f9e7848cb2448 (commit) via 31b5b968f674bca928b12c517950c6a240ab5fbf (commit) via e36509b0e74de13ac75ff1bc7511d566561d928d (commit) via 8f35bfe39de2ede2e801d22d5e7b339ecc829b71 (commit) via 639f1689f73390e62f7086602b9e1e48a652c43f (commit) via 61389588efcc28be2c89ca6ededa5bcb23078cb7 (commit) via 6b1fc2ea571c7f6c1d78e1417f304cabdab11efe (commit) via ea93f7ccb3a66465b4ac5b82c2ff97aa7a387f37 (commit) via ac1018fdfbac5199d2e3599b1a0ac259a897e530 (commit) via e87cdd6b56ba3aa98741e8db8ceb76498f0aa3fc (commit) via 177e149013876e53f6767fba5894838a03685804 (commit) via ce001fe2ab5aefeba6f05bfd046878f944abafc2 (commit) via 1d8a09a6c882a275bb44ae24e9c2336e3d70a6f8 (commit) via 27259e14c78396113eebf7f0fb010d7498c00717 (commit) via bd60c2daf32fffdd1a824b35644b15f79e767f89 (commit) via a71547d80ebb4b5e5343e834d4382f9f2544ad50 (commit) via 9cae081b48189c568754d9e7cc6214f18b13ae6e (commit) via f704da191a546c90c4d1ba25ba53c45ce90589c6 (commit) via b7a32ef494e0fc3f346d100a50ef678ee3b68c7d (commit) via 3816dea021c53c309405e585b2932ddf7f912ea3 (commit) via b4fd27ebce51d632d9d1bc8d6d892cda90a1d5e2 (commit) via 2922512478ea2f85f9f4a3fcef434b463089e660 (commit) via c5e02a5764b72b74fb1b5d5e9406fd03bef799e1 (commit) via 7bb5f19d138e9d0f65284544ece5a380caa6b665 (commit) via 14400873dce47a02df72b4f1181934c7d3d89306 (commit) via b29ed153fe78580ce7a783c3b1a198c5e434eebd (commit) via 0c8a79c5039973046e896accfa7549a01fcf9cd8 (commit) via 22eac4fe9a5ffa0c31914d3c04d421caff6895d0 (commit) via a0aef765cd8512a53ba897b197663caf3888a4f4 (commit) via eea6306a814a90c6738fd1d7c550436673228ab6 (commit) via a86f012299131f91f0f2d5526377dc3688f8ed3e (commit) via 65c8b7a5579437f2a435ef9c7a439adc7e69b1bb (commit) via e1cdc782e363ce79e9dba9e796dca67eeda9f1e0 (commit) via 9d69e74a087710567d7cdbb31676bd5c06ed2edb (commit) via b273773d0f3f410c3d23379b420c343219e5ed1b (commit) via 186b3a42a0187cffa75cc52c3161f0818598ac0f (commit) via 140d98e733bca8fe2d2a86b6905d72aa265c9c27 (commit) via 598e1439dabb246b3a5bcb0ff270042826dd5d2b (commit) via 9ba8437d62164c231d734ccf7f3cc55a2d973773 (commit) via b0f9af2619fdcaa49913856b413e8a14a0d32207 (commit) via 88c927ee0af16810665c9b8dfe9443b094f4595b (commit) via 99b9fab4d80b42828094558f82cc82886538b6af (commit) via 78da710e7c9f1264d89ac8ac62bbd6564a8f2d60 (commit) via 1e3a0d23a99dd3ec6650f7b5c4f021396222fdcd (commit) from fbff56e8c2a24934840ba66f196b5fa0bb4caff7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9bfdb2c0c6f82676297ab0e8dc4727a3a382046c Author: Kern Sibbald <ke...@si...> Date: Thu Jul 22 15:14:02 2010 +0200 Tweak add debug to win32-fd-test commit 5a20e773ef0f07266bed15b46c07d451243f4c29 Author: Marco van Wieringen <mv...@pl...> Date: Wed Jul 21 23:49:30 2010 +0200 Fix bug #1610 handle empty xattr values on Linux and xBSD. commit da14476eaf33bea941cdc5df029724f591c262e8 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 21 17:33:26 2010 +0200 Really free free pool memory before sm_dump commit 0d421b2e252b0b9666f0bfa3cfdf0146925748f5 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 21 17:18:17 2010 +0200 Garbage collect memory pool at end of job and before sm_dump commit c77b7be0bf13cb8134c6dda7271630aaf09edd03 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 21 17:17:51 2010 +0200 Ignore STREAM_RESTORE_OBJECTS returned by SD to FD commit 2ab3b4ee2f42a7d6c4cc160175ee6daf602935ff Author: Kern Sibbald <ke...@si...> Date: Wed Jul 21 17:16:05 2010 +0200 Tweak some copyright dates commit cd6a67d7155827f19bf296ae0f4d96985a32bc34 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 21 13:22:24 2010 +0200 Tweak add more doc to win32-fd-test commit 2afaa1be1aac1a6965db3ecac0cdcbda581ecf09 Author: Kern Sibbald <ke...@si...> Date: Tue Jul 20 19:15:33 2010 +0200 Tweak add sm_dump comments in debug code commit 4d924e0a2daad1d60da6fd905491cd300984d6e1 Author: Kern Sibbald <ke...@si...> Date: Tue Jul 20 19:14:54 2010 +0200 Tweak add sm_dump comments in debug code commit fb56da1203dc9730c8866786121f087f9036fb2f Author: Kern Sibbald <ke...@si...> Date: Mon Jul 19 16:57:22 2010 +0200 Tweak add bstrerror output if snapshot fails commit c69447cc1b0bf4cfeb5edf0d130f7f16c0bed7bc Author: Kern Sibbald <ke...@si...> Date: Mon Jul 19 07:48:06 2010 +0200 Add xattr seg fault protection suggested by Marco for bug #1610 commit a4952a094e2cd027eb3784a8bb8d3f6b74534ec2 Author: Eric Bollengier <er...@eb...> Date: Sat Jul 17 11:49:16 2010 +0200 update configure commit b5d3299846a2c664c0e3191b17419ebd17d904e3 Author: Eric Bollengier <er...@eb...> Date: Sat Jul 17 10:04:21 2010 +0200 Add archlinux to os.m4 commit 5548fdd503dcd9c68b0ad5584bd7c7972da17ed8 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 14 15:21:34 2010 +0200 More fixes for 32/64 bit problems in smartall commit 3ba08884c7820faea2891a8f9870875e320a0070 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 14 14:11:35 2010 +0200 Fix 32/64 bit problem in smartalloc dump routine commit 325ceeb2d12846a58500db60fbcc3be7bdcf5bef Author: Kern Sibbald <ke...@si...> Date: Sun Jul 11 15:06:17 2010 +0200 Tweak remove bdb from cats Makefile.in commit f1dc25c2a1a02609d93c255e5c7f9dfd0252a729 Author: Kern Sibbald <ke...@si...> Date: Sun Jul 11 14:40:33 2010 +0200 Tweak fix compile problems due to new .exit command commit a25824ee84751430e4411f1086abcf4904cc00e6 Author: Kern Sibbald <ke...@si...> Date: Sun Jul 11 14:33:31 2010 +0200 Fix .dump, .die, .exit when DEVELOPER turned off commit ffbc256e9508286180e2f5cafcc4e23418ed4be5 Author: Kern Sibbald <ke...@si...> Date: Sat Jul 10 20:20:59 2010 +0200 Tweak correct typo pointed out by Arno commit c0763266c9ade8be0d80258c0b0bc6df60c6f925 Author: Kern Sibbald <ke...@si...> Date: Sat Jul 10 18:22:56 2010 +0200 Make SD automatically fix the Volume size in the Catalog when out of sync commit 7159a3c25a6fe10e5e0922baeb904188f2093529 Author: Kern Sibbald <ke...@si...> Date: Sat Jul 10 14:23:31 2010 +0200 Tweak reduce compiler warnings commit bebdba3c21ad8edb10e89b078a9b59658a0a1d9f Author: Kern Sibbald <ke...@si...> Date: Sat Jul 10 14:22:31 2010 +0200 Add bigger print buffer for sm_dump commit 2fc9c0ca54ee013dba02be134073d5b4f67b55e4 Author: Kern Sibbald <ke...@si...> Date: Sat Jul 10 14:21:46 2010 +0200 Add .dump and .exit commands for daemons commit 105ad5e3ed5d323eb0e9a34ff669241e955f636e Author: Kern Sibbald <ke...@si...> Date: Fri Jul 9 20:57:47 2010 +0200 Use Pmsg in smartall.c rather than printf for tracing Windows commit 9b7de45c47077845e13da75aa1540f6e86b8bf82 Author: Kern Sibbald <ke...@si...> Date: Sat Jul 10 14:20:05 2010 +0200 Protect bsnprintf against NULL pointer commit c9fc10ec7525ce49e9f2672e88c9f0a73f48bd3b Author: Eric Bollengier <er...@eb...> Date: Thu Jul 8 18:57:33 2010 +0200 regress: add comment to win32-fd-test commit fbb306e4bf7354675977b8cff1a76b91c48064b4 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 7 19:31:54 2010 +0200 Up maximum block size to 20M commit 0fcdd3800cdf62962b4b3696824c8b594a1a8a90 Author: Kern Sibbald <ke...@si...> Date: Wed Jul 7 07:49:48 2010 +0200 Fix for TLS bugs #1568 and #1599 commit 946a8ae46737554c456d24a6269ee7db661aabc6 Author: Kern Sibbald <ke...@si...> Date: Fri Jul 2 17:03:36 2010 +0200 Improve comm line error handling for TLS, may fix bug #1568 and #1599 commit 7a839e91c7a9b2697a9d0a8417c86b44c76581c5 Author: Kern Sibbald <ke...@si...> Date: Sun Jul 4 22:12:51 2010 +0200 Add new tls-duplicate-job test commit 749a5a8e66d34e7a75caa159e289584832e026ff Author: Kern Sibbald <ke...@si...> Date: Sun Jul 4 20:34:15 2010 +0200 Tweak source-addr-test commit 88f26d65d3e982ea07f231d11f8f060af1a97715 Author: Kern Sibbald <ke...@si...> Date: Fri Jul 2 12:16:20 2010 +0200 Fix SD crash due to mismatched lock/unlock in error condition commit a2523c3cb28cecd07b2b5e50a1bb18760c693b0a Author: Eric Bollengier <er...@eb...> Date: Tue Jun 29 16:29:40 2010 +0200 add comments commit 186694703732f6ca405db0a5ded854bf3616a1e4 Author: Eric Bollengier <er...@eb...> Date: Tue Jun 29 15:10:39 2010 +0200 Fix #1600 about problems with Accurate code on MySQL commit d7d30c611630207364a39f95bf0c7e6a0876563b Author: Eric Bollengier <er...@eb...> Date: Tue Jun 29 09:08:29 2010 +0200 regress: update diff.pl output commit a1607ea19d8baa71b9e4b1080e47bdb60098d514 Author: Eric Bollengier <er...@eb...> Date: Mon Jun 28 22:35:59 2010 +0200 regress: tweak diff.pl output commit 59636f4a08fc0ff2414ff58409f7243f460d0b2e Author: Kern Sibbald <ke...@si...> Date: Sat Jun 26 13:17:09 2010 +0200 Tweak remove old debug code commit 7a80c508bf300556b6389b05fc4e61d534458ea5 Author: Kern Sibbald <ke...@si...> Date: Sat Jun 26 13:07:24 2010 +0200 Fix bug #1587 if you have clients with different catalogs configured, both catalogs contains all clients after a reload or restart of the dir commit b5a1603e6864dc5885d993693c1e54067818db82 Author: Kern Sibbald <ke...@si...> Date: Sat Jun 26 12:38:48 2010 +0200 Fix bug #1577 During migration: ERROR in block.c:950 Failed ASSERT: dev->is_open() by moving and commenting out the ASSERT() commit de43070223821a063a2129434b26f1486d9dd968 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 24 16:50:32 2010 +0200 Fix new killsafe code commit d43baa97c5535cf6831944d34be418a7e9ced97f Author: Eric Bollengier <er...@eb...> Date: Thu Jun 24 14:14:44 2010 +0200 Add USE_LOCKMGR_SAFEKILL in version.h commit a523bb54b558761bb5741dea5374dc6bc08b1207 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 24 14:07:56 2010 +0200 Add wrapper for pthread_kill() to check if thread exists before using kill You can enable this extra check to be sure that we use pthread_kill() only with valid pthread id USE_LOCKMGR_SAFEKILL in version.h. It looks like that some implementation, like the linux one, segfaults when you are sending a signal to a non existing thread. This problem can be fixed by using non detached thread, or by checking if the thread is still present before sending the signal. commit cccc4a69a6abf234b42000c590f9bfa43c4721ac Author: Eric Bollengier <er...@eb...> Date: Wed Jun 23 14:50:47 2010 +0200 regress: replace testls by diff.pl in weird-files-test commit 89fe44558fefda6bf608f0bde13f9e7848cb2448 Author: Eric Bollengier <er...@eb...> Date: Wed Jun 23 14:49:58 2010 +0200 regress: diff.pl - check mtime on directories with --mtime-dir, add support for pipe, char and block file Depending on the restore order, a directory could be restored before a file inside it. The resulting mtime could be wrong. Add support for special files like named pipe, char and block special devices. commit 31b5b968f674bca928b12c517950c6a240ab5fbf Author: Kern Sibbald <ke...@si...> Date: Wed Jun 23 08:26:29 2010 +0200 Skip HB kill in FD if HB thread terminated commit e36509b0e74de13ac75ff1bc7511d566561d928d Author: Eric Bollengier <er...@eb...> Date: Tue Jun 22 16:16:55 2010 +0200 regress: add new diff tool in debug mode commit 8f35bfe39de2ede2e801d22d5e7b339ecc829b71 Author: Eric Bollengier <er...@eb...> Date: Tue Jun 22 16:10:35 2010 +0200 regress: update diff.pl - Fix problem when reading filename ending with space - Use lstat for symlinks - Don't compare atime between versions - Don't compare mtime/ctime for symlinks - add windows attributes testing - Don't compare ctime between versions commit 639f1689f73390e62f7086602b9e1e48a652c43f Author: Eric Bollengier <er...@eb...> Date: Mon Jun 21 11:55:22 2010 +0200 update windows defs commit 61389588efcc28be2c89ca6ededa5bcb23078cb7 Author: Kern Sibbald <ke...@si...> Date: Sun Jun 20 17:47:29 2010 +0200 Tweak ignore dumps commit 6b1fc2ea571c7f6c1d78e1417f304cabdab11efe Author: Kern Sibbald <ke...@si...> Date: Sun Jun 20 17:44:59 2010 +0200 Fix crash from unequal volume_lock/unlock calls commit ea93f7ccb3a66465b4ac5b82c2ff97aa7a387f37 Author: Eric Bollengier <er...@eb...> Date: Sun Jun 20 13:55:11 2010 +0200 regress: add new prune test to cdash commit ac1018fdfbac5199d2e3599b1a0ac259a897e530 Author: Eric Bollengier <er...@eb...> Date: Sun Jun 20 11:50:35 2010 +0200 regress: Add prune test for copy jobs commit e87cdd6b56ba3aa98741e8db8ceb76498f0aa3fc Author: Eric Bollengier <er...@eb...> Date: Sun Jun 20 11:41:56 2010 +0200 regress: Add prune test for migration jobs commit 177e149013876e53f6767fba5894838a03685804 Author: Eric Bollengier <er...@eb...> Date: Sun Jun 20 11:39:33 2010 +0200 Fix pruning for migration jobs and do some optimization commit ce001fe2ab5aefeba6f05bfd046878f944abafc2 Author: Kern Sibbald <ke...@si...> Date: Sun Jun 20 09:19:02 2010 +0200 Print TestName at beginning of dump commit 1d8a09a6c882a275bb44ae24e9c2336e3d70a6f8 Author: Marco van Wieringen <mv...@pl...> Date: Sat Jun 19 15:23:46 2010 +0200 Remove prototypes of removed prune queries. commit 27259e14c78396113eebf7f0fb010d7498c00717 Author: Eric Bollengier <er...@eb...> Date: Fri Jun 18 09:03:28 2010 +0200 Adapt new prune code with old db_accurate_get_jobids() commit bd60c2daf32fffdd1a824b35644b15f79e767f89 Author: Eric Bollengier <er...@eb...> Date: Fri Jun 18 08:57:56 2010 +0200 regress: tweak estimate-test commit a71547d80ebb4b5e5343e834d4382f9f2544ad50 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 15:48:21 2010 +0200 regress: add new prune test to regress suite commit 9cae081b48189c568754d9e7cc6214f18b13ae6e Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 14:02:01 2010 +0200 regress: display ERROR properly commit f704da191a546c90c4d1ba25ba53c45ce90589c6 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 14:01:26 2010 +0200 tweak ua_prune commit b7a32ef494e0fc3f346d100a50ef678ee3b68c7d Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 13:53:04 2010 +0200 regress: tweak lockmgr-test commit 3816dea021c53c309405e585b2932ddf7f912ea3 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 11:11:37 2010 +0200 tweak comments commit b4fd27ebce51d632d9d1bc8d6d892cda90a1d5e2 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 10:47:47 2010 +0200 Cleanup prune queries commit 2922512478ea2f85f9f4a3fcef434b463089e660 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 10:36:15 2010 +0200 regress: add more tests to prune-base-job-test commit c5e02a5764b72b74fb1b5d5e9406fd03bef799e1 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 10:03:42 2010 +0200 regress: update prune-base-job-test commit 7bb5f19d138e9d0f65284544ece5a380caa6b665 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 09:30:59 2010 +0200 regress: update base-job-test commit 14400873dce47a02df72b4f1181934c7d3d89306 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 09:11:05 2010 +0200 regress: update prune test for base jobs commit b29ed153fe78580ce7a783c3b1a198c5e434eebd Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 09:10:37 2010 +0200 regress: add function to test pruning commit 0c8a79c5039973046e896accfa7549a01fcf9cd8 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 09:10:05 2010 +0200 update prune code commit 22eac4fe9a5ffa0c31914d3c04d421caff6895d0 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 09:08:21 2010 +0200 Fix db_get_base_jobid() commit a0aef765cd8512a53ba897b197663caf3888a4f4 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 00:21:14 2010 +0200 regress: add prune verification for base jobs commit eea6306a814a90c6738fd1d7c550436673228ab6 Author: Eric Bollengier <er...@eb...> Date: Thu Jun 17 00:12:14 2010 +0200 regress: update prune-test commit a86f012299131f91f0f2d5526377dc3688f8ed3e Author: Eric Bollengier <er...@eb...> Date: Wed Jun 16 23:48:36 2010 +0200 regress: add prune-test commit 65c8b7a5579437f2a435ef9c7a439adc7e69b1bb Author: Eric Bollengier <er...@eb...> Date: Wed Jun 16 22:42:26 2010 +0200 Cleanup prune code commit e1cdc782e363ce79e9dba9e796dca67eeda9f1e0 Author: Eric Bollengier <er...@eb...> Date: Wed Jun 16 18:33:54 2010 +0200 Make new prune algo to work with backup commit 9d69e74a087710567d7cdbb31676bd5c06ed2edb Author: Eric Bollengier <er...@eb...> Date: Wed Jun 16 08:56:03 2010 +0200 start to tweak prune algo commit b273773d0f3f410c3d23379b420c343219e5ed1b Author: Kern Sibbald <ke...@si...> Date: Sat Jun 19 16:09:51 2010 +0200 Tweak remove ref to master commit 186b3a42a0187cffa75cc52c3161f0818598ac0f Author: Kern Sibbald <ke...@si...> Date: Sat Jun 19 15:58:28 2010 +0200 Save any dumps during regression to dumps directory commit 140d98e733bca8fe2d2a86b6905d72aa265c9c27 Author: Kern Sibbald <ke...@si...> Date: Sat Jun 19 11:56:13 2010 +0200 Update LICENSE commit 598e1439dabb246b3a5bcb0ff270042826dd5d2b Author: Kern Sibbald <ke...@si...> Date: Sat Jun 19 08:45:15 2010 +0200 Tweak: remove old code commit 9ba8437d62164c231d734ccf7f3cc55a2d973773 Author: Kern Sibbald <ke...@si...> Date: Sat Jun 19 08:23:35 2010 +0200 Fix crash from rw_lock/unlock miss match commit b0f9af2619fdcaa49913856b413e8a14a0d32207 Author: Kern Sibbald <ke...@si...> Date: Fri Jun 18 23:43:38 2010 +0200 Attempt to fix duplicate job kill seg fault commit 88c927ee0af16810665c9b8dfe9443b094f4595b Author: Eric Bollengier <er...@eb...> Date: Fri Jun 18 16:00:10 2010 +0200 Replace pthread_kill by my_thread_send_signal() in jcr.c commit 99b9fab4d80b42828094558f82cc82886538b6af Author: Eric Bollengier <er...@eb...> Date: Fri Jun 18 16:38:42 2010 +0200 Fix postgresql error in grant script commit 78da710e7c9f1264d89ac8ac62bbd6564a8f2d60 Author: Eric Bollengier <er...@eb...> Date: Fri Jun 18 10:19:31 2010 +0200 update configure commit 1e3a0d23a99dd3ec6650f7b5c4f021396222fdcd Author: Eric Bollengier <er...@eb...> Date: Fri Jun 18 10:18:12 2010 +0200 fix #1595 about batch mode detection problem for postgresql with non standard install dir ----------------------------------------------------------------------- Summary of changes: diff --git a/bacula/LICENSE b/bacula/LICENSE index f8ffd5b..fa7b074 100644 --- a/bacula/LICENSE +++ b/bacula/LICENSE @@ -17,6 +17,17 @@ What follows is the addition(s) to the GPL version 2 license, that applies to code that is copyrighted by the Free Software Foundation Europe e.V. +Distribution: +In the sense used in the GPLv2 as concerns the Bacula license, +distribution includes using Bacula in an appliance or using Bacula +as a service via Internet or other electronic form that makes +Bacula, Bacula service or Bacula binaries available to other parties. +If you "distribute" Bacula in any manner, you are required to +provide the source code upon demand to the parties to whom +you "distribute" it. If you wish to distribute Bacula without +providing source code, please contact Bacula Systems SA +(www.baculasystems.com) about alternate licenses. + Linking: As a special exception to the GPLv2, the Bacula Project gives permission to link the code of its release of Bacula with the OpenSSL diff --git a/bacula/autoconf/bacula-macros/os.m4 b/bacula/autoconf/bacula-macros/os.m4 index 7a3ce55..2833e4d 100644 --- a/bacula/autoconf/bacula-macros/os.m4 +++ b/bacula/autoconf/bacula-macros/os.m4 @@ -216,6 +216,9 @@ then elif test -f /etc/engarde-version then DISTNAME=engarde +elif test -f /etc/arch-release +then + DISTNAME=archlinux elif test "$CYGWIN" = yes then DISTNAME=cygwin diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 3db0f85..0c3facb 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1746,8 +1746,12 @@ if test $pkg = 0; then ] ) fi + +dnl For postgresql checking +saved_LIBS="${LIBS}" +LIBS="${saved_LIBS} ${SQL_LFLAGS}" -dnl Check if postgresql can support batch mode +dnl Check if postgresql can support batch mode if test x$DB_TYPE = xpostgresql; then AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe])) AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData])) @@ -1797,6 +1801,9 @@ else uncomment_dbi="#" fi +dnl revert after postgresql checks +LIBS="${saved_LIBS}" + AC_SUBST(uncomment_dbi) dnl For Ingres always enable batch inserts. diff --git a/bacula/configure b/bacula/configure index 8331756..6974cd0 100755 --- a/bacula/configure +++ b/bacula/configure @@ -15963,6 +15963,9 @@ then elif test -f /etc/engarde-version then DISTNAME=engarde +elif test -f /etc/arch-release +then + DISTNAME=archlinux elif test "$CYGWIN" = yes then DISTNAME=cygwin @@ -23700,6 +23703,9 @@ fi fi +saved_LIBS="${LIBS}" +LIBS="${saved_LIBS} ${SQL_LFLAGS}" + if test x$DB_TYPE = xpostgresql; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQisthreadsafe in -lpq" >&5 $as_echo_n "checking for PQisthreadsafe in -lpq... " >&6; } @@ -23952,6 +23958,8 @@ else uncomment_dbi="#" fi +LIBS="${saved_LIBS}" + if test x$DB_TYPE = xingres; then diff --git a/bacula/scripts/btraceback.gdb b/bacula/scripts/btraceback.gdb index ec82a9f..8ef1f03 100644 --- a/bacula/scripts/btraceback.gdb +++ b/bacula/scripts/btraceback.gdb @@ -9,6 +9,7 @@ print distver print host_name print dist_name print beef +show env TestName bt thread apply all bt f 0 @@ -27,6 +28,5 @@ f 6 info locals f 7 info locals -show env TestName detach quit diff --git a/bacula/src/cats/Makefile.in b/bacula/src/cats/Makefile.in index e4c86a9..13d4f94 100644 --- a/bacula/src/cats/Makefile.in +++ b/bacula/src/cats/Makefile.in @@ -87,9 +87,6 @@ realclean: clean $(RMF) create_bacula_database update_bacula_tables make_bacula_tables $(RMF) grant_bacula_privileges drop_bacula_tables drop_bacula_database - $(RMF) create_bdb_database update_bdb_tables make_bdb_tables - $(RMF) grant_bdb_privileges drop_bdb_tables drop_bdb_database - $(RMF) create_mysql_database update_mysql_tables make_mysql_tables $(RMF) grant_mysql_privileges drop_mysql_tables drop_mysql_database diff --git a/bacula/src/cats/grant_postgresql_privileges.in b/bacula/src/cats/grant_postgresql_privileges.in index 9b7218f..fa90165 100644 --- a/bacula/src/cats/grant_postgresql_privileges.in +++ b/bacula/src/cats/grant_postgresql_privileges.in @@ -54,7 +54,7 @@ grant select, update on device_deviceid_seq to ${db_user}; grant select, update on location_locationid_seq to ${db_user}; grant select, update on locationlog_loclogid_seq to ${db_user}; grant select, update on log_logid_seq to ${db_user}; -grant select, update on restore_restoreobjectid_seq to ${db_user}; +grant select, update on restoreobject_restoreobjectid_seq to ${db_user}; END-OF-DATA if [ $? -eq 0 ] then diff --git a/bacula/src/cats/sql_cmds.c b/bacula/src/cats/sql_cmds.c index e29a055..e533639 100644 --- a/bacula/src/cats/sql_cmds.c +++ b/bacula/src/cats/sql_cmds.c @@ -121,91 +121,6 @@ const char *drop_deltabs[] = { const char *create_delindex = "CREATE INDEX DelInx1 ON DelCandidates (JobId)"; -/* Fill candidates table with all Jobs subject to being deleted. - * This is used for pruning Jobs (first the files, then the Jobs). - */ -const char *insert_delcand = - "INSERT INTO DelCandidates " - "SELECT JobId,PurgedFiles,FileSetId,JobFiles,JobStatus FROM Job " - "WHERE Type='%c' " - "AND JobTDate<%s " - "AND ClientId=%s"; - -/* - * Select Jobs from the DelCandidates table that have a - * more recent backup -- i.e. are not the only backup. - * This is the list of Jobs to delete for a Backup Job. - * At the same time, we select "orphanned" jobs - * (i.e. no files, ...) for deletion. - */ - -/* Faster way */ -const char *select_backup_del = - "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " - "FROM Job,DelCandidates " - "WHERE (Job.JobId=DelCandidates.JobId AND ((DelCandidates.JobFiles=0) OR " - "(DelCandidates.JobStatus NOT IN ('T','W')))) OR " - "(Job.JobTDate>%s " - "AND Job.ClientId=%s " - "AND Job.Level='F' AND Job.JobStatus IN ('T','W') AND Job.Type IN ('B','M') " - "AND Job.FileSetId=DelCandidates.FileSetId)"; - -/* Select Jobs from the DelCandidates table that have a - * more recent InitCatalog -- i.e. are not the only InitCatalog - * This is the list of Jobs to delete for a Verify Job. - */ -const char *select_verify_del = - "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " - "FROM Job,DelCandidates " - "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR " - "(Job.JobTDate>%s " - "AND Job.ClientId=%s " - "AND Job.Type='V' AND Job.Level='V' AND Job.JobStatus IN ('T','W') " - "AND Job.FileSetId=DelCandidates.FileSetId)"; - - -/* Select Jobs from the DelCandidates table. - * This is the list of Jobs to delete for a Restore Job. - */ -const char *select_restore_del = - "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " - "FROM Job,DelCandidates " - "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR " - "(Job.JobTDate>%s " - "AND Job.ClientId=%s " - "AND Job.Type='R')"; - -/* Select Jobs from the DelCandidates table. - * This is the list of Jobs to delete for an Admin Job. - */ -const char *select_admin_del = - "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " - "FROM Job,DelCandidates " - "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR " - "(Job.JobTDate>%s " - "AND Job.ClientId=%s " - "AND Job.Type='D')"; - -/* - * Select Jobs from the DelCandidates table. - * This is the list of Jobs to delete for an Migrate Job. - */ -const char *select_migrate_del = - "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " - "FROM Job,DelCandidates " - "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR " - "(Job.JobTDate>%s " - "AND Job.ClientId=%s " - "AND Job.Type='g')"; - -const char *select_copy_del = - "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " - "FROM Job,DelCandidates " - "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR " - "(Job.JobTDate>%s " - "AND Job.ClientId=%s " - "AND Job.Type='c')"; - /* ======= ua_restore.c */ const char *uar_count_files = "SELECT JobFiles FROM Job WHERE JobId=%s"; @@ -554,8 +469,11 @@ const char *select_recent_version[5] = { "AND j1.JobId = f1.JobId" }; +/* We don't create this table as TEMPORARY because MySQL MyISAM + * 5.0 and 5.1 are unable to run further queries in this mode + */ const char *create_temp_accurate_jobids_default = - "CREATE TEMPORARY TABLE btemp3%s AS " + "CREATE TABLE btemp3%s AS " "SELECT JobId, StartTime, EndTime, JobTDate, PurgedFiles " "FROM Job JOIN FileSet USING (FileSetId) " "WHERE ClientId = %s " diff --git a/bacula/src/cats/sql_cmds.h b/bacula/src/cats/sql_cmds.h index 4c525da..ff0ab80 100644 --- a/bacula/src/cats/sql_cmds.h +++ b/bacula/src/cats/sql_cmds.h @@ -31,13 +31,6 @@ extern const char CATS_IMP_EXP *client_backups; extern const char CATS_IMP_EXP *list_pool; extern const char CATS_IMP_EXP *drop_deltabs[]; extern const char CATS_IMP_EXP *create_delindex; -extern const char CATS_IMP_EXP *insert_delcand; -extern const char CATS_IMP_EXP *select_backup_del; -extern const char CATS_IMP_EXP *select_verify_del; -extern const char CATS_IMP_EXP *select_restore_del; -extern const char CATS_IMP_EXP *select_admin_del; -extern const char CATS_IMP_EXP *select_migrate_del; -extern const char CATS_IMP_EXP *select_copy_del; extern const char CATS_IMP_EXP *select_job; extern const char CATS_IMP_EXP *count_select_job; extern const char CATS_IMP_EXP *del_File; diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 7b9044b..c9b8077 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -1257,9 +1257,10 @@ bool db_get_base_jobid(JCR *jcr, B_DB *mdb, JOB_DBR *jr, JobId_t *jobid) db_int64_ctx lctx; char date[MAX_TIME_LENGTH]; bool ret=false; - *jobid = 0; - // char clientid[50], filesetid[50]; + *jobid = 0; + lctx.count = 0; + lctx.value = 0; StartTime = (jr->StartTime)?jr->StartTime:time(NULL); bstrutime(date, sizeof(date), StartTime + 1); diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index d71f9da..fadba9e 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -1003,6 +1003,14 @@ static bool check_catalog(cat_op mode) CLIENT *client; foreach_res(client, R_CLIENT) { CLIENT_DBR cr; + /* Create clients only if they use the current catalog */ + if (client->catalog != catalog) { + Dmsg3(500, "Skip client=%s with cat=%s not catalog=%s\n", + client->name(), client->catalog->name(), catalog->name()); + continue; + } + Dmsg2(500, "create cat=%s for client=%s\n", + client->catalog->name(), client->name()); memset(&cr, 0, sizeof(cr)); bstrncpy(cr.Name, client->name(), sizeof(cr.Name)); db_create_client_record(NULL, db, &cr); diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c index 68febb4..0e4d688 100644 --- a/bacula/src/dird/jobq.c +++ b/bacula/src/dird/jobq.c @@ -170,7 +170,7 @@ void *sched_wait(void *arg) JCR *jcr = ((wait_pkt *)arg)->jcr; jobq_t *jq = ((wait_pkt *)arg)->jq; - set_jcr_in_tsd(jcr); + set_jcr_in_tsd(INVALID_JCR); Dmsg0(2300, "Enter sched_wait.\n"); free(arg); time_t wtime = jcr->sched_time - time(NULL); @@ -437,6 +437,7 @@ void *jobq_server(void *arg) jq->running_jobs->append(je); /* Attach jcr to this thread while we run the job */ + jcr->set_killable(true); set_jcr_in_tsd(jcr); Dmsg1(2300, "Took jobid=%d from ready and appended to run\n", jcr->JobId); @@ -450,6 +451,7 @@ void *jobq_server(void *arg) /* Job finished detach from thread */ remove_jcr_from_tsd(je->jcr); + je->jcr->set_killable(false); Dmsg2(2300, "Back from user engine jobid=%d use=%d.\n", jcr->JobId, jcr->use_count()); diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index f354fb3..b8dc297 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -379,7 +379,7 @@ extern "C" void *msg_thread(void *arg) uint64_t JobBytes; pthread_detach(pthread_self()); - set_jcr_in_tsd(jcr, false /* no thread update in jcr */); + set_jcr_in_tsd(jcr); jcr->SD_msg_chan = pthread_self(); pthread_cleanup_push(msg_thread_cleanup, arg); sd = jcr->store_bsock; diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index afe4be6..3a5d3b3 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2009 Free Software Foundation Europe e.V. + Copyright (C) 2002-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -52,7 +52,7 @@ extern bool dot_status_cmd(UAContext *ua, const char *cmd); /* Forward referenced functions */ -static bool die_or_dump_cmd(UAContext *ua, const char *cmd); +static bool admin_cmds(UAContext *ua, const char *cmd); static bool jobscmd(UAContext *ua, const char *cmd); static bool filesetscmd(UAContext *ua, const char *cmd); static bool clientscmd(UAContext *ua, const char *cmd); @@ -85,9 +85,9 @@ static struct cmdstruct commands[] = { /* help */ /* can be used in runscript * { NT_(".backups"), backupscmd, NULL, false}, { NT_(".clients"), clientscmd, NULL, true}, { NT_(".defaults"), defaultscmd, NULL, false}, - { NT_(".die"), die_or_dump_cmd, NULL, false}, - { NT_(".dump"), die_or_dump_cmd, NULL, false}, - { NT_(".exit"), dot_quit_cmd, NULL, false}, + { NT_(".die"), admin_cmds, NULL, false}, + { NT_(".dump"), admin_cmds, NULL, false}, + { NT_(".exit"), admin_cmds, NULL, false}, { NT_(".filesets"), filesetscmd, NULL, false}, { NT_(".help"), dot_help_cmd, NULL, false}, { NT_(".jobs"), jobscmd, NULL, true}, @@ -419,32 +419,41 @@ static void do_client_cmd(UAContext *ua, CLIENT *client, const char *cmd) } /* - * Create segmentation fault or dump memory + * .die (seg fault) + * .dump (sm_dump) + * .exit (no arg => .quit) */ -static bool die_or_dump_cmd(UAContext *ua, const char *cmd) +static bool admin_cmds(UAContext *ua, const char *cmd) { pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; STORE *store=NULL; CLIENT *client=NULL; bool dir=false; bool do_deadlock=false; - const char *remote_cmd="sm_dump"; + const char *remote_cmd; int i; JCR *jcr = NULL; int a; - if (!strncmp(ua->argk[0], ".die", 4)) { + if (strncmp(ua->argk[0], ".die", 4) == 0) { if (find_arg(ua, "deadlock") > 0) { - do_deadlock=true; + do_deadlock = true; remote_cmd = ".die deadlock"; } else { remote_cmd = ".die"; } + } else if (strncmp(ua->argk[0], ".dump", 5) == 0) { + remote_cmd = "sm_dump"; + } else if (strncmp(ua->argk[0], ".exit", 5) == 0) { + remote_cmd = "exit"; + } else { + ua->error_msg(_("Unknown command: %s\n"), ua->argk[0]); + return true; } /* General debug? */ for (i=1; i<ua->argc; i++) { if (strcasecmp(ua->argk[i], "dir") == 0 || strcasecmp(ua->argk[i], "director") == 0) { - dir=true; + dir = true; } if (strcasecmp(ua->argk[i], "client") == 0 || strcasecmp(ua->argk[i], "fd") == 0) { @@ -503,7 +512,7 @@ static bool die_or_dump_cmd(UAContext *ua, const char *cmd) } if (dir) { - if (!strncmp(remote_cmd, ".die", 4)) { + if (strncmp(remote_cmd, ".die", 4) == 0) { if (do_deadlock) { ua->send_msg(_("The Director will generate a deadlock.\n")); P(mutex); @@ -513,8 +522,10 @@ static bool die_or_dump_cmd(UAContext *ua, const char *cmd) a = jcr->JobId; /* ref NULL pointer */ jcr->JobId = 1000; /* another ref NULL pointer */ - } else { /* .dump */ + } else if (strncmp(remote_cmd, ".dump", 5) == 0) { sm_dump(false, true); + } else if (strncmp(remote_cmd, ".exit", 5) == 0) { + dot_quit_cmd(ua, cmd); } } @@ -526,8 +537,9 @@ static bool die_or_dump_cmd(UAContext *ua, const char *cmd) /* * Dummy routine for non-development version */ -static bool die_or_dump_cmd(UAContext *ua, const char *cmd) +static bool admin_cmds(UAContext *ua, const char *cmd) { + ua->error_msg(_("Unknown command: %s\n"), ua->argk[0]); return true; } diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index 498b4da..3f03342 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -40,6 +40,7 @@ /* Imported functions */ /* Forward referenced functions */ +static bool grow_del_list(struct del_ctx *del); /* * Called here to count entries to be deleted @@ -69,16 +70,11 @@ int job_delete_handler(void *ctx, int num_fields, char **row) { struct del_ctx *del = (struct del_ctx *)ctx; - if (del->num_ids == MAX_DEL_LIST_LEN) { + if (!grow_del_list(del)) { return 1; } - if (del->num_ids == del->max_ids) { - del->max_ids = (del->max_ids * 3) / 2; - del->JobId = (JobId_t *)brealloc(del->JobId, sizeof(JobId_t) * del->max_ids); - del->PurgedFiles = (char *)brealloc(del->PurgedFiles, del->max_ids); - } del->JobId[del->num_ids] = (JobId_t)str_to_int64(row[0]); -// Dmsg2(60, "row=%d val=%d\n", del->num_ids, del->JobId[del->num_ids]); + Dmsg2(60, "job_delete_handler row=%d val=%d\n", del->num_ids, del->JobId[del->num_ids]); del->PurgedFiles[del->num_ids++] = (char)str_to_int64(row[1]); return 0; } @@ -87,14 +83,9 @@ int file_delete_handler(void *ctx, int num_fields, char **row) { struct del_ctx *del = (struct del_ctx *)ctx; - if (del->num_ids == MAX_DEL_LIST_LEN) { + if (!grow_del_list(del)) { return 1; } - if (del->num_ids == del->max_ids) { - del->max_ids = (del->max_ids * 3) / 2; - del->JobId = (JobId_t *)brealloc(del->JobId, sizeof(JobId_t) * - del->max_ids); - } del->JobId[del->num_ids++] = (JobId_t)str_to_int64(row[0]); // Dmsg2(150, "row=%d val=%d\n", del->num_ids-1, del->JobId[del->num_ids-1]); return 0; @@ -337,7 +328,61 @@ static bool create_temp_tables(UAContext *ua) return true; } +static bool grow_del_list(struct del_ctx *del) +{ + if (del->num_ids == MAX_DEL_LIST_LEN) { + return false; + } + + if (del->num_ids == del->max_ids) { + del->max_ids = (del->max_ids * 3) / 2; + del->JobId = (JobId_t *)brealloc(del->JobId, sizeof(JobId_t) * + del->max_ids); + del->PurgedFiles = (char *)brealloc(del->PurgedFiles, del->max_ids); + } + return true; +} + +struct accurate_check_ctx { + DBId_t ClientId; /* Id of client */ + DBId_t FileSetId; /* Id of FileSet */ +}; + +/* row: Job.Name, FileSet, Client.Name, FileSetId, ClientId, Type */ +static int job_select_handler(void *ctx, int num_fields, char **row) +{ + alist *lst = (alist *)ctx; + struct accurate_check_ctx *res; + ASSERT(num_fields == 6); + /* If this job doesn't exist anymore in the configuration, delete it */ + if (GetResWithName(R_JOB, row[0]) == NULL) { + return 1; + } + + /* If this fileset doesn't exist anymore in the configuration, delete it */ + if (GetResWithName(R_FILESET, row[1]) == NULL) { + return 1; + } + + /* If this client doesn't exist anymore in the configuration, delete it */ + if (GetResWithName(R_CLIENT, row[2]) == NULL) { + return 1; + } + + /* Don't compute accurate things for Verify jobs */ + if (*row[5] == 'V') { + return 1; + } + + res = (struct accurate_check_ctx*) malloc(sizeof(struct accurate_check_ctx)); + res->FileSetId = str_to_int64(row[3]); + res->ClientId = str_to_int64(row[4]); + lst->append(res); + +// Dmsg2(150, "row=%d val=%d\n", del->num_ids-1, del->JobId[del->num_ids-1]); + return 0; +} /* * Pruning Jobs is a bit more complicated than purging Files @@ -356,12 +401,15 @@ int prune_jobs(UAContext *ua, CLIENT *client, POOL *pool, int JobType) struct del_ctx del; POOL_MEM query(PM_MESSAGE); utime_t now, period; - CLIENT_DBR cr; + CLIENT_DBR cr ; char ed1[50], ed2[50]; + alist *jobids_check=NULL; + struct accurate_check_ctx *elt; + db_list_ctx jobids, tempids; + JOB_DBR jr; db_lock(ua->db); memset(&cr, 0, sizeof(cr)); - memset(&del, 0, sizeof(del)); bstrncpy(cr.Name, client->name(), sizeof(cr.Name)); if (!db_create_client_record(ua->jcr, ua->db, &cr)) { @@ -384,52 +432,114 @@ int prune_jobs(UAContext *ua, CLIENT *client, POOL *pool, int JobType) goto bail_out; } + edit_utime(period, ed1, sizeof(ed1)); + Jmsg(ua->jcr, M_INFO, 0, _("Begin pruning Jobs older than %s.\n"), ed1); + + edit_int64(now - period, ed1); /* Jobs older than ed1 are good candidates */ + edit_int64(cr.ClientId, ed2); + + memset(&del, 0, sizeof(del)); + del.max_ids = 100; + del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids); + del.PurgedFiles = (char *)malloc(del.max_ids); /* * Select all files that are older than the JobRetention period * and stuff them into the "DeletionCandidates" table. */ - edit_utime(period, ed1, sizeof(ed1)); - Jmsg(ua->jcr, M_INFO, 0, _("Begin pruning Jobs older than %s.\n"), ed1); - edit_int64(now - period, ed1); - Mmsg(query, insert_delcand, (char)JobType, ed1, - edit_int64(cr.ClientId, ed2)); + Mmsg(query, + "INSERT INTO DelCandidates " + "SELECT JobId,PurgedFiles,FileSetId,JobFiles,JobStatus " + "FROM Job " + "WHERE Type IN ('B', 'C', 'M', 'V', 'D', 'R', 'c', 'm', 'g') " + "AND JobTDate<%s AND ClientId=%s", + ed1, ed2); + if (!db_sql_query(ua->db, query.c_str(), NULL, (void *)NULL)) { if (ua->verbose) { ua->error_msg("%s", db_strerror(ua->db)); } - Dmsg0(050, "insert delcand failed\n"); goto bail_out; } - del.max_ids = 100; - del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids); - del.PurgedFiles = (char *)malloc(del.max_ids); + /* Now, for the selection, we discard some of them in order to be always + * able to restore files. (ie, last full, last diff, last incrs) + * Note: The DISTINCT could be more useful if we don't get FileSetId + */ + jobids_check = New(alist(10, owned_by_alist)); + Mmsg(query, +"SELECT DISTINCT Job.Name, FileSet, Client.Name, Job.FileSetId, " + "Job.ClientId, Job.Type " + "FROM DelCandidates " + "JOIN Job USING (JobId) " + "JOIN Client USING (ClientId) " + "JOIN FileSet ON (Job.FileSetId = FileSet.FileSetId) " + "WHERE Job.Type IN ('B') " /* Look only Backup jobs */ + "AND Job.JobStatus IN ('T', 'W') " /* Look only useful jobs */ + ); + + /* The job_select_handler will skip jobs or filesets that are no longer + * in the configuration file. Interesting ClientId/FileSetId will be + * added to jobids_check + */ + if (!db_sql_query(ua->db, query.c_str(), job_select_handler, jobids_check)) { + ua->error_msg("%s", db_strerror(ua->db)); + } - /* ed1 = JobTDate */ - edit_int64(cr.ClientId, ed2); - switch (JobType) { - case JT_BACKUP: - Mmsg(query, select_backup_del, ed1, ed2); - break; - case JT_RESTORE: - Mmsg(query, select_restore_del, ed1, ed2); - break; - case JT_VERIFY: - Mmsg(query, select_verify_del, ed1, ed2); - break; - case JT_ADMIN: - Mmsg(query, select_admin_del, ed1, ed2); - break; - case JT_COPY: - Mmsg(query, select_copy_del, ed1, ed2); - break; - case JT_MIGRATE: - Mmsg(query, select_migrate_del, ed1, ed2); - break; + /* For this selection, we exclude current jobs used for restore or + * accurate. This will prevent to prune the last full backup used for + * current backup & restore + */ + memset(&jr, 0, sizeof(jr)); + /* To find useful jobs, we do like an incremental */ + jr.JobLevel = L_INCREMENTAL; + foreach_alist(elt, jobids_check) { + jr.ClientId = elt->ClientId; /* should be always the same */ + jr.FileSetId = elt->FileSetId; + db_accurate_get_jobids(ua->jcr, ua->db, &jr, &tempids); + jobids.cat(tempids); } - Dmsg1(150, "Query=%s\n", query.c_str()); + /* Discard latest Verify level=InitCatalog job + * TODO: can have multiple fileset + */ + Mmsg(query, + "SELECT JobId, JobTDate " + "FROM Job " + "WHERE JobTDate<%s AND ClientId=%s " + "AND Type='V' AND Level='V' " + "ORDER BY JobTDate DESC LIMIT 1", + ed1, ed2); + + if (!db_sql_query(ua->db, query.c_str(), db_list_handler, &jobids)) { + ua->error_msg("%s", db_strerror(ua->db)); + } + + /* If we found jobs to exclude from the DelCandidates list, we should + * also remove BaseJobs that can be linked with them + */ + if (jobids.count > 0) { + Dmsg1(60, "jobids to exclude before basejobs = %s\n", jobids.list); + /* We also need to exclude all basejobs used */ + db_get_used_base_jobids(ua->jcr, ua->db, jobids.list, &jobids); + + /* Removing useful jobs from the DelCandidates list */ + Mmsg(query, "DELETE FROM DelCandidates " + "WHERE JobId IN (%s) " /* JobId used in accurate */ + "AND JobFiles!=0", /* Discard when JobFiles=0 */ + jobids.list); + + if (!db_sql_query(ua->db, query.c_str(), NULL, NULL)) { + ua->error_msg("%s", db_strerror(ua->db)); + goto bail_out; /* Don't continue if the list isn't clean */ + } + Dmsg1(60, "jobids to exclude = %s\n", jobids.list); + } + + /* We use DISTINCT because we can have two times the same job */ + Mmsg(query, + "SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles " + "FROM DelCandidates"); if (!db_sql_query(ua->db, query.c_str(), job_delete_handler, (void *)&del)) { ua->error_msg("%s", db_strerror(ua->db)); } @@ -452,6 +562,9 @@ bail_out: if (del.PurgedFiles) { free(del.PurgedFiles); } + if (jobids_check) { + delete jobids_check; + } return 1; } diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index 044901c..3b372c9 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -1278,7 +1278,7 @@ int main(int argc, char *argv[]) Dmsg0(dbglvl, "bacula: OK ...\n"); close_memory_pool(); - sm_dump(false); + sm_dump(false); /* unit test */ return 0; } diff --git a/bacula/src/filed/filed.c b/bacula/src/filed/filed.c index 50708d3..7ef7c6e 100644 --- a/bacula/src/filed/filed.c +++ b/bacula/src/filed/filed.c @@ -53,7 +53,6 @@ extern void *handle_client_request(void *dir_sock); extern bool parse_fd_config(CONFIG *config, const char *configfile, int exit_code); /* Forward referenced functions */ -void terminate_filed(int sig); static bool check_resources(); /* Exported variables */ diff --git a/bacula/src/filed/filed.h b/bacula/src/filed/filed.h index 6aac8f5..7a820e1 100644 --- a/bacula/src/filed/filed.h +++ b/bacula/src/filed/filed.h @@ -78,3 +78,6 @@ typedef enum { #endif extern CLIENT *me; /* "Global" Client resource */ + +void terminate_filed(int sig); + diff --git a/bacula/src/filed/heartbeat.c b/bacula/src/filed/heartbeat.c index d50eec1..7141931 100644 --- a/bacula/src/filed/heartbeat.c +++ b/bacula/src/filed/heartbeat.c @@ -139,9 +139,11 @@ void stop_heartbeat_monitor(JCR *jcr) jcr->hb_dir_bsock->set_timed_out(); /* set timed_out to terminate read */ jcr->hb_dir_bsock->set_terminated(); /* set to terminate read */ } - Dmsg0(100, "Send kill to heartbeat id\n"); - pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */ - bmicrosleep(0, 50000); + if (jcr->hb_started) { + Dmsg0(100, "Send kill to heartbeat id\n"); + pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */ + bmicrosleep(0, 50000); + } cnt = 0; /* Wait max 100 secs for heartbeat thread to stop */ while (jcr->hb_started && cnt++ < 200) { diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 0a2b8e2..d660469 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -92,6 +92,9 @@ static int restore_object_cmd(JCR *jcr); static int set_options(findFOPTS *fo, const char *opts); static void set_storage_auth_key(JCR *jcr, char *key); static int sm_dump_cmd(JCR *jcr); +#ifdef DEVELOPER +static int exit_cmd(JCR *jcr); +#endif /* Exported functions */ @@ -128,6 +131,9 @@ static struct s_cmds cmds[] = { {"accurate", accurate_cmd, 0}, {"restoreobject", restore_object_cmd, 0}, {"sm_dump", sm_dump_cmd, 0}, +#ifdef DEVELOPER + {"exit", exit_cmd, 0}, +#endif {NULL, NULL} /* list terminator */ }; @@ -396,17 +402,28 @@ void *handle_client_request(void *dirp) free_jcr(jcr); /* destroy JCR record */ Dmsg0(100, "Done with free_jcr\n"); Dsm_check(1); + garbage_collect_memory_pool(); return NULL; } static int sm_dump_cmd(JCR *jcr) { - BSOCK *dir = jcr->dir_bsock; + close_memory_pool(); sm_dump(false, true); - dir->fsend("2000 sm_dump OK\n"); + jcr->dir_bsock->fsend("2000 sm_dump OK\n"); return 1; } +#ifdef DEVELOPER +static int exit_cmd(JCR *jcr) +{ + jcr->dir_bsock->fsend("2000 exit OK\n"); + terminate_filed(0); + return 0; +} +#endif + + /** * Hello from Director he must identify himself and provide his * password. @@ -1805,8 +1822,8 @@ static int backup_cmd(JCR *jcr) if (get_win32_driveletters(jcr->ff, szWinDriveLetters)) { Jmsg(jcr, M_INFO, 0, _("Generate VSS snapshots. Driver=\"%s\", Drive(s)=\"%s\"\n"), g_pVSSClient->GetDriverName(), szWinDriveLetters); if (!g_pVSSClient->CreateSnapshots(szWinDriveLetters)) { - Jmsg(jcr, M_WARNING, 0, _("Generate VSS snapshots failed.\n")); - jcr->JobErrors++; + berrno be; + Jmsg(jcr, M_FATAL, 0, _("Generate VSS snapshots failed. ERR=%s\n"), be.bstrerror()); } else { /* tell user if snapshot creation of a specific drive failed */ int i; diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 95447e5..fc26ac0 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -762,6 +762,9 @@ void do_restore(JCR *jcr) plugin_name_stream(jcr, sd->msg); break; + case STREAM_RESTORE_OBJECT: + break; /* these are sent by Director */ + default: close_previous_stream(rctx); Jmsg(jcr, M_ERROR, 0, _("Unknown stream=%d ignored. This shouldn't happen!\n"), diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index 97e5c5c..a0ee592 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -193,7 +193,9 @@ static uint32_t serialize_xattr_stream(JCR *jcr, uint32_t expected_serialize_len ser_bytes(current_xattr->name, current_xattr->name_length); ser_uint32(current_xattr->value_length); - ser_bytes(current_xattr->value, current_xattr->value_length); + if (current_xattr->value_length > 0 && current_xattr->value) { + ser_bytes(current_xattr->value, current_xattr->value_length); + } } ser_end(jcr->xattr_data->content, expected_serialize_len + 10); @@ -236,6 +238,14 @@ static bxattr_exit_code unserialize_xattr_stream(JCR *jcr, alist *xattr_value_li * Decode the valuepair. First decode the length of the name. */ unser_uint32(current_xattr->name_length); + if (current_xattr->name_length == 0) { + Mmsg1(jcr->errmsg, _("Illegal xattr stream, xattr name length <= 0 on file \"%s\"\n"), + jcr->last_fname); + Dmsg1(100, "Illegal xattr stream, xattr name length <= 0 on file \"%s\"\n", + jcr->last_fname); + free(current_xattr); + return bxattr_exit_error; + } /* * Allocate room for the name and decode its content. @@ -253,11 +263,15 @@ static bxattr_exit_code unserialize_xattr_stream(JCR *jcr, alist *xattr_value_li */ unser_uint32(current_xattr->value_length); - /* - * Allocate room for the value and decode its content. - */ - current_xattr->value = (char *)malloc(current_xattr->value_length); - unser_bytes(current_xattr->value, current_xattr->value_length); + if (current_xattr->value_length > 0) { + /* + * Allocate room for the value and decode its content. + */ + current_xattr->value = (char *)malloc(current_xattr->value_length); + unser_bytes(current_xattr->value, current_xattr->value_length); + } else { + current_xattr->value = NULL; + } xattr_value_list->append(current_xattr); } @@ -340,7 +354,8 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) * First get the length of the available list with extended attributes. */ xattr_list_len = llistxattr(jcr->last_fname, NULL, 0); - if (xattr_list_len < 0) { + switch (xattr_list_len) { + case -1: switch (errno) { case ENOENT: return bxattr_exit_ok; @@ -351,8 +366,11 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) jcr->last_fname, be.bstrerror()); return bxattr_exit_error; } - } else if (xattr_list_len == 0) { + break; + case 0: return bxattr_exit_ok; + default: + break; } /* @@ -365,7 +383,8 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) * Get the actual list of extended attributes names for a file. */ xattr_list_len = llistxattr(jcr->last_fname, xattr_list, xattr_list_len); - if (xattr_list_len < 0) { + switch (xattr_list_len) { + case -1: switch (errno) { case ENOENT: retval = bxattr_exit_ok; @@ -377,6 +396,9 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) jcr->last_fname, be.bstrerror()); goto bail_out; } + break; + default: + break; } xattr_list[xattr_list_len] = '\0'; @@ -388,6 +410,7 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) */ bp = xattr_list; while ((bp - xattr_list) + 1 < xattr_list_len) { + int name_len; skip_xattr = false; /* @@ -416,7 +439,8 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) } } - if (skip_xattr) { + name_len = strlen(bp); + if (skip_xattr || name_len == 0) { bp = strchr(bp, '\0') + 1; continue; } @@ -431,7 +455,7 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) /* * Allocate space for storing the name. */ - current_xattr->name_length = strlen(bp); + current_xattr->name_length = name_len; current_xattr->name = (char *)malloc(current_xattr->name_length); memcpy((caddr_t)current_xattr->name, (caddr_t)bp, current_xattr->name_length); @@ -441,7 +465,8 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) * First see how long the value is for the extended attribute. */ xattr_value_len = lgetxattr(jcr->last_fname, bp, NULL, 0); - if (xattr_value_len < 0) { + switch (xattr_value_len) { + case -1: switch (errno) { case ENOENT: retval = bxattr_exit_ok; @@ -457,28 +482,51 @@ static bxattr_exit_code linux_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) free(current_xattr); goto bail_out; } - } + break; + case 0: + current_xattr->value = NULL; + current_xattr->value_length = 0; + expected_serialize_len += sizeof(current_xattr->value_length); + break; + default: + /* + * Allocate space for storing the value. + */ + current_xattr->value = (char *)malloc(xattr_value_len); + memset((caddr_t)current_xattr->value, 0, xattr_value_len); - /* - * Allocate space for storing the value. - */ - current_xattr->value = (char *)malloc(xattr_value_len); - memset((caddr_t)current_xattr->value, 0, xattr_value_len); + xattr_value_len = lgetxattr(jcr->last_fname, bp, current_xattr->value, xattr_value_len); + if (xattr_value_len < 0) { + switch (errno) { + case ENOENT: + retval = bxattr_exit_ok; + free(current_xattr->value); + free(current_xattr->name); + free(current_xattr); + goto bail_out; + default: + Mmsg2(jcr->errmsg, _("lgetxattr error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.bstrerror()); + Dmsg2(100, "lgetxattr error file=%s ERR=%s\n", + jcr->last_fname, be.bstrerror()); + free(current_xattr->value); + free(current_xattr->name); + free(current_xattr); + goto bail_out; + } + } + /* + * Store the actual length of the value. + */ + current_xattr->value_length = x... [truncated message content] |