Re: [Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
Martin, thanks for your suggestions. I now did a test: - Noted the last fileid in db. - Ran BackupCatalog job. In the file table, one entry was added for this job (JobID=3366): select * from file where fileid 273350941; 273350942;1;3366;7656;46696;0;P0B stOS IGg B Bk Bl A FS1p6i BAA qZXI BMvvaQ BMvveo BMvveo A A C;IIuhxgZwyUMitZ4C4p5m4g - Then I ran the duplicate to tape job. One thing I note is that the copy job is running (JobId=3367), and the BackupCatalog job is also again running (JobID=3368) when I start the copy job. After copy, I checked the file entries again: select * from file where fileid 273350941; 273350942;1;3366;7656;46696;0;P0B stOS IGg B Bk Bl A FS1p6i BAA qZXI BMvvaQ BMvveo BMvveo A A C;IIuhxgZwyUMitZ4C4p5m4g 273350943;1;3368;7656;46696;0;P0B stOS IGg B Bk Bl A FS1p6i BAA qZXI BMvvaQ BMvveo BMvveo A A C;IIuhxgZwyUMitZ4C4p5m4g As you can see, one entry was added for JobID 3368. So copy seems not to be the cause of the problem. Robert Am 19.10.2010 um 16:57 schrieb Martin Simmons: I don't know if it the duplicates are caused by the copy job, but there are two interesting differences between the rows: 1) The atime (access time) field in the LStat is different (BMvLg8 vs BMvJgV), suggesting that the file's stat was read more than once. 2) The FileIndex values are different (128385 vs 86). These values increment from 1 at the start of the job, so it seems that the order of the files in the jobs is not very similar. I think you need to do some tests, maybe periodically recording the value of select max(fileid) from file; to try to discover when the rows are added. __Martin On Tue, 19 Oct 2010 14:28:24 +0200, Robert Oschwald said: Today I checked again the migrated pg82 db for last nights incremental of one of the servers. Still the same error for this backup's new entries when I click on one of the nodes in the bat restore select tree: sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=138243 FilenameId=2533203 DB entry check: SELECT * FROM public.file WHERE file.filenameid = 2533203 AND pathid=138243 and jobid = 3347; Result: FileId FileIndex JobId PathId FilenameId MarkId LStat MD5 273044923 128385 3347 138243 2533203 0 P0G VIFW IGk B A A A IB BAA I BMvLg8 BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw 273041096 86 3347 138243 2533203 0 P0G VIFW IGk B A A A IB BAA I BMvJgV BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw I then checked my old Bacula 5.0.2 MySQL Database. Here is a query for one of the oldest backups I have in the former mysql db: SELECT * FROM File WHERE filenameid = 42066 AND pathid=102145 and jobid = 2941; FileId FileIndex JobId PathIdFilenameId MarkId LStat MD5 2282473161910509 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMiHlI BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w 2299427493605942 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMkXTF BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w Even in the former MySQL DB I got two entries for each file in the db. Maybe this is related to the copy job for the Default Pool which copies to LTO-4 tapes (B2D2T) after all backups to the Default (disk) pool? Pool { Name = Default Pool Type = Backup Storage = File Recycle = yes AutoPrune = yes Volume Retention = 14 days LabelFormat = b2d- Maximum Volume Bytes = 50G # Duplicate: Next pool to use if running copy jobs NextPool = Tape } Note that the error message is only displayed if: - You start bacula-dir manually in the console or - Add 21 log_file to the init.d start() line e.g.: daemon /usr/sbin/bacula-dir $2 ${DIR_OPTIONS} -c /etc/bacula/bacula-dir.conf 21 /var/log/bacula_startup.log on CentOS5. Any ideas? Robert On Mon, 18 Oct 2010 09:54:28 +0200, Robert Oschwald said: I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. ...snip... Migration from PostgreSQL 8.1 to 8.2: pg_dumpall pg_dump.sql - install postgreSQL 8.2 (CentOS-Testing) psql pg_dump.sql Did you start with an empty database when you imported the dump after migration from PostgreSQL 8.1 to 8.2? I suspect not, because you have everything twice. Are these error messages critical? Yes. __Martin -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net
Re: [Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
Indeed, the copy job is an administative job, which creates a second job that is the copy. The latest select output shows the same FileIndex and LStat atime for both jobs as expected. __Martin On Wed, 20 Oct 2010 16:41:16 +0200, Robert Oschwald said: Martin, thanks for your suggestions. I now did a test: - Noted the last fileid in db. - Ran BackupCatalog job. In the file table, one entry was added for this job (JobID=3366): select * from file where fileid 273350941; 273350942;1;3366;7656;46696;0;P0B stOS IGg B Bk Bl A FS1p6i BAA qZXI BMvvaQ BMvveo BMvveo A A C;IIuhxgZwyUMitZ4C4p5m4g - Then I ran the duplicate to tape job. One thing I note is that the copy job is running (JobId=3367), and the BackupCatalog job is also again running (JobID=3368) when I start the copy job. After copy, I checked the file entries again: select * from file where fileid 273350941; 273350942;1;3366;7656;46696;0;P0B stOS IGg B Bk Bl A FS1p6i BAA qZXI BMvvaQ BMvveo BMvveo A A C;IIuhxgZwyUMitZ4C4p5m4g 273350943;1;3368;7656;46696;0;P0B stOS IGg B Bk Bl A FS1p6i BAA qZXI BMvvaQ BMvveo BMvveo A A C;IIuhxgZwyUMitZ4C4p5m4g As you can see, one entry was added for JobID 3368. So copy seems not to be the cause of the problem. Robert Am 19.10.2010 um 16:57 schrieb Martin Simmons: I don't know if it the duplicates are caused by the copy job, but there are two interesting differences between the rows: 1) The atime (access time) field in the LStat is different (BMvLg8 vs BMvJgV), suggesting that the file's stat was read more than once. 2) The FileIndex values are different (128385 vs 86). These values increment from 1 at the start of the job, so it seems that the order of the files in the jobs is not very similar. I think you need to do some tests, maybe periodically recording the value of select max(fileid) from file; to try to discover when the rows are added. __Martin On Tue, 19 Oct 2010 14:28:24 +0200, Robert Oschwald said: Today I checked again the migrated pg82 db for last nights incremental of one of the servers. Still the same error for this backup's new entries when I click on one of the nodes in the bat restore select tree: sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=138243 FilenameId=2533203 DB entry check: SELECT * FROM public.file WHERE file.filenameid = 2533203 AND pathid=138243 and jobid = 3347; Result: FileId FileIndex JobId PathId FilenameId MarkId LStat MD5 273044923 128385 3347 138243 2533203 0 P0G VIFW IGk B A A A IB BAA I BMvLg8 BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw 273041096 86 3347 138243 2533203 0 P0G VIFW IGk B A A A IB BAA I BMvJgV BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw I then checked my old Bacula 5.0.2 MySQL Database. Here is a query for one of the oldest backups I have in the former mysql db: SELECT * FROM File WHERE filenameid = 42066 AND pathid=102145 and jobid = 2941; FileIdFileIndex JobId PathIdFilenameId MarkId LStat MD5 228247316 1910509 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMiHlI BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w 229942749 3605942 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMkXTF BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w Even in the former MySQL DB I got two entries for each file in the db. Maybe this is related to the copy job for the Default Pool which copies to LTO-4 tapes (B2D2T) after all backups to the Default (disk) pool? Pool { Name = Default Pool Type = Backup Storage = File Recycle = yes AutoPrune = yes Volume Retention = 14 days LabelFormat = b2d- Maximum Volume Bytes = 50G # Duplicate: Next pool to use if running copy jobs NextPool = Tape } Note that the error message is only displayed if: - You start bacula-dir manually in the console or - Add 21 log_file to the init.d start() line e.g.: daemon /usr/sbin/bacula-dir $2 ${DIR_OPTIONS} -c /etc/bacula/bacula-dir.conf 21 /var/log/bacula_startup.log on CentOS5. Any ideas? Robert On Mon, 18 Oct 2010 09:54:28 +0200, Robert Oschwald said: I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. ...snip... Migration from PostgreSQL 8.1 to 8.2: pg_dumpall pg_dump.sql - install postgreSQL 8.2 (CentOS-Testing) psql pg_dump.sql Did you start with an empty database when you imported the dump after migration from PostgreSQL 8.1 to 8.2? I suspect not, because you have everything twice. Are these error messages critical? Yes. __Martin -- Download
Re: [Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
Today I checked again the migrated pg82 db for last nights incremental of one of the servers. Still the same error for this backup's new entries when I click on one of the nodes in the bat restore select tree: sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=138243 FilenameId=2533203 DB entry check: SELECT * FROM public.file WHERE file.filenameid = 2533203 AND pathid=138243 and jobid = 3347; Result: FileId FileIndex JobId PathId FilenameId MarkId LStat MD5 273044923 128385 3347 138243 2533203|0 P0G VIFW IGk B A A A IB BAA I BMvLg8 BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw 273041096 86 3347 138243 2533203|0 P0G VIFW IGk B A A A IB BAA I BMvJgV BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw I then checked my old Bacula 5.0.2 MySQL Database. Here is a query for one of the oldest backups I have in the former mysql db: SELECT * FROM File WHERE filenameid = 42066 AND pathid=102145 and jobid = 2941; FileId FileIndex JobId PathIdFilenameId MarkId LStat MD5 228247316 1910509 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMiHlI BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w 229942749 3605942 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMkXTF BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w Even in the former MySQL DB I got two entries for each file in the db. Maybe this is related to the copy job for the Default Pool which copies to LTO-4 tapes (B2D2T) after all backups to the Default (disk) pool? Pool { Name = Default Pool Type = Backup Storage = File Recycle = yes AutoPrune = yes Volume Retention = 14 days LabelFormat = b2d- Maximum Volume Bytes = 50G # Duplicate: Next pool to use if running copy jobs NextPool = Tape } Note that the error message is only displayed if: - You start bacula-dir manually in the console or - Add 21 log_file to the init.d start() line e.g.: daemon /usr/sbin/bacula-dir $2 ${DIR_OPTIONS} -c /etc/bacula/bacula-dir.conf 21 /var/log/bacula_startup.log on CentOS5. Any ideas? Robert On Mon, 18 Oct 2010 09:54:28 +0200, Robert Oschwald said: I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. ...snip... Migration from PostgreSQL 8.1 to 8.2: pg_dumpall pg_dump.sql - install postgreSQL 8.2 (CentOS-Testing) psql pg_dump.sql Did you start with an empty database when you imported the dump after migration from PostgreSQL 8.1 to 8.2? I suspect not, because you have everything twice. Are these error messages critical? Yes. __Martin -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
I don't know if it the duplicates are caused by the copy job, but there are two interesting differences between the rows: 1) The atime (access time) field in the LStat is different (BMvLg8 vs BMvJgV), suggesting that the file's stat was read more than once. 2) The FileIndex values are different (128385 vs 86). These values increment from 1 at the start of the job, so it seems that the order of the files in the jobs is not very similar. I think you need to do some tests, maybe periodically recording the value of select max(fileid) from file; to try to discover when the rows are added. __Martin On Tue, 19 Oct 2010 14:28:24 +0200, Robert Oschwald said: Today I checked again the migrated pg82 db for last nights incremental of one of the servers. Still the same error for this backup's new entries when I click on one of the nodes in the bat restore select tree: sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=138243 FilenameId=2533203 DB entry check: SELECT * FROM public.file WHERE file.filenameid = 2533203 AND pathid=138243 and jobid = 3347; Result: FileIdFileIndex JobId PathId FilenameId MarkId LStat MD5 273044923 128385 3347 138243 2533203 0 P0G VIFW IGk B A A A IB BAA I BMvLg8 BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw 273041096 86 3347 138243 2533203 0 P0G VIFW IGk B A A A IB BAA I BMvJgV BMvJIy BMvJIy A A E 3eBz2t04SgJGcJFHVq62Mw I then checked my old Bacula 5.0.2 MySQL Database. Here is a query for one of the oldest backups I have in the former mysql db: SELECT * FROM File WHERE filenameid = 42066 AND pathid=102145 and jobid = 2941; FileId FileIndex JobId PathIdFilenameId MarkId LStat MD5 228247316 1910509 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMiHlI BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w 229942749 3605942 2941 102145 42066 0 P0C OhMx IGk B A A A J8 BAA I BMkXTF BDIcWc BLkzrq A A E SiJb2FBj/EYO/nmnkj9i7w Even in the former MySQL DB I got two entries for each file in the db. Maybe this is related to the copy job for the Default Pool which copies to LTO-4 tapes (B2D2T) after all backups to the Default (disk) pool? Pool { Name = Default Pool Type = Backup Storage = File Recycle = yes AutoPrune = yes Volume Retention = 14 days LabelFormat = b2d- Maximum Volume Bytes = 50G # Duplicate: Next pool to use if running copy jobs NextPool = Tape } Note that the error message is only displayed if: - You start bacula-dir manually in the console or - Add 21 log_file to the init.d start() line e.g.: daemon /usr/sbin/bacula-dir $2 ${DIR_OPTIONS} -c /etc/bacula/bacula-dir.conf 21 /var/log/bacula_startup.log on CentOS5. Any ideas? Robert On Mon, 18 Oct 2010 09:54:28 +0200, Robert Oschwald said: I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. ...snip... Migration from PostgreSQL 8.1 to 8.2: pg_dumpall pg_dump.sql - install postgreSQL 8.2 (CentOS-Testing) psql pg_dump.sql Did you start with an empty database when you imported the dump after migration from PostgreSQL 8.1 to 8.2? I suspect not, because you have everything twice. Are these error messages critical? Yes. __Martin -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev
[Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
Hi folks, I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. Speed is dramatically better than with MySQL (I will post my postgresql settings if one is interested). Now when I use BAT to simulate a restore to recent, I get this messages in stderr when I klick on one of the files: sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=80991 FilenameId=439 sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=80796 FilenameId=439 sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=307 FilenameId=439 sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=2 FilenameId=439 sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=80992 FilenameId=439 sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=311 FilenameId=439 sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=9 FilenameId=439 This is what I got in the db (example for the first error message): select * from file where PathId=80991 and filenameId = 439; fileid;fileindex;jobid;pathid;filenameid;markid;lstat;md5 195262190;196703;2686;80991;439;0;P0G C EHt G A A A BAA BAA I BMdWat BLepez BLxIbv A A E;0 198655792;3590305;2686;80991;439;0;P0G C EHt G A A A BAA BAA I BMdY3i BLepez BLxIbv A A E;0 219621970;3509726;2860;80991;439;0;P0G C EHt G A A A BAA BAA I BMiAMX BLepez BLxIbv A A E;0 216309113;196869;2860;80991;439;0;P0G C EHt G A A A BAA BAA I BMh9us BLepez BLxIbv A A E;0 229856219;3519412;2941;80991;439;0;P0G C EHt G A A A BAA BAA I BMkT04 BLepez BLxIbv A A E;0 226533758;196951;2941;80991;439;0;P0G C EHt G A A A BAA BAA I BMkRX8 BLepez BLxIbv A A E;0 241079525;3535279;3036;80991;439;0;P0G C EHt G A A A BAA BAA I BMmzt1 BLepez BLxIbv A A E;0 237741269;197023;3036;80991;439;0;P0G C EHt G A A A BAA BAA I BMmotw BLepez BLxIbv A A E;0 247155517;197101;3121;80991;439;0;P0G C EHt G A A A BAA BAA I BMo4tF BLepez BLxIbv A A E;0 250493865;3535449;3121;80991;439;0;P0G C EHt G A A A BAA BAA I BMo7JE BLepez BLxIbv A A E;0 255954922;3541015;3203;80991;439;0;P0G C EHt G A A A BAA BAA I BMrOz/ BLepez BLxIbv A A E;0 252610691;196784;3203;80991;439;0;P0G C EHt G A A A BAA BAA I BMrMV4 BLepez BLxIbv A A E;0 257085143;196784;3210;80991;439;0;P0G C EHt G A A A BAA BAA I BMrMV4 BLepez BLxIbv A A E;0 260429374;3541015;3210;80991;439;0;P0G C EHt G A A A BAA BAA I BMrOz/ BLepez BLxIbv A A E;0 262984244;197169;3289;80991;439;0;P0G C EHt G A A A BAA BAA I BMtgAj BLepez BLxIbv A A E;0 266357999;3570924;3289;80991;439;0;P0G C EHt G A A A BAA BAA I BMtidh BLepez BLxIbv A A E;0 270866064;3570924;3296;80991;439;0;P0G C EHt G A A A BAA BAA I BMtidh BLepez BLxIbv A A E;0 267492309;197169;3296;80991;439;0;P0G C EHt G A A A BAA BAA I BMtgAj BLepez BLxIbv A A E;0 Migration from MySQL to PostgreSQL steps I've done: mysqldump -t -q -n -c --compatible=postgresql --skip-quote-names --skip-opt --disable-keys --lock-tables -u bacula -ppassword bacula \ | grep -v INSERT INTO Status \ | sed -e 's/-00-00 00:00:00/1970-01-01 00:00:00/g' \ | sed -e 's/\\0//' /B2D/bacula_mysql_dump_in_postgresql-format.sql install postgresql-8.1 (CentOS 5 x86_64) install bacula-postgresql create_postgresql_database make_postgresql_tables grant_postgresql_privileges psql -Ubacula bacula bacula_mysql_dump_in_postgresql-format.sql Reset sequences: SELECT SETVAL('basefiles_baseid_seq', (SELECT MAX(baseid) FROM basefiles)); SELECT SETVAL('client_clientid_seq', (SELECT MAX(clientid) FROM client)); SELECT SETVAL('file_fileid_seq', (SELECT MAX(fileid) FROM file)); SELECT SETVAL('filename_filenameid_seq', (SELECT MAX(filenameid) FROM filename)); SELECT SETVAL('fileset_filesetid_seq', (SELECT MAX(filesetid) FROM fileset)); SELECT SETVAL('job_jobid_seq', (SELECT MAX(jobid) FROM job)); SELECT SETVAL('jobmedia_jobmediaid_seq', (SELECT MAX(jobmediaid) FROM jobmedia)); SELECT SETVAL('media_mediaid_seq', (SELECT MAX(mediaid) FROM media)); SELECT SETVAL('path_pathid_seq', (SELECT MAX(pathid) FROM path)); SELECT SETVAL('basefiles_baseid_seq', (SELECT MAX(baseid) FROM basefiles)); SELECT SETVAL('client_clientid_seq', (SELECT MAX(clientid) FROM client)); SELECT SETVAL('file_fileid_seq', (SELECT MAX(fileid) FROM file)); SELECT SETVAL('filename_filenameid_seq', (SELECT MAX(filenameid) FROM filename)); SELECT SETVAL('fileset_filesetid_seq', (SELECT MAX(filesetid) FROM fileset)); SELECT SETVAL('job_jobid_seq', (SELECT MAX(jobid) FROM job)); SELECT SETVAL('jobmedia_jobmediaid_seq', (SELECT MAX(jobmediaid) FROM jobmedia)); SELECT SETVAL('media_mediaid_seq', (SELECT MAX(mediaid) FROM media)); SELECT SETVAL('path_pathid_seq', (SELECT MAX(pathid) FROM path)); SELECT SETVAL('pool_poolid_seq', (SELECT MAX(poolid) FROM pool)); SELECT SETVAL('device_deviceid_seq', (SELECT MAX(deviceid) FROM device)); SELECT
Re: [Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
On 18/10/10, Robert Oschwald (r...@symentis.com) wrote: I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. Speed is dramatically better than with MySQL (I will post my postgresql settings if one is interested). Now when I use BAT to simulate a restore to recent, I get this messages in stderr when I klick on one of the files: sql_get.c:156-0 === Problem! sql_get.c:155 get_file_record want 1 got rows=2 PathId=80991 FilenameId=439 Hi Robert I haven't experienced this issue myself, but what is happening is that in sql_get.c the following error is being triggered: if (QUERY_DB(jcr, mdb, mdb-cmd)) { mdb-num_rows = sql_num_rows(mdb); Dmsg1(050, get_file_record num_rows=%d\n, (int)mdb-num_rows); if (mdb-num_rows 1) { Mmsg1(mdb-errmsg, _(get_file_record want 1 got rows=%d\n), --- error mdb-num_rows); } Bacula is getting 2 records for the database records for the specified paths and files. It may be that you have inadvertently imported the data twice. -- Rory Campbell-Lange r...@campbell-lange.net -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] get_file_record want 1 got rows=2 after migration from MySQL to PostgreSQL
On Mon, 18 Oct 2010 09:54:28 +0200, Robert Oschwald said: I migrated Bacula 5.0.2 from MySQL to Bacula 5.0.3 PostgreSQL 8.1, and then migrated to PostgreSQL 8.2 using dump/restore. ...snip... Migration from PostgreSQL 8.1 to 8.2: pg_dumpall pg_dump.sql - install postgreSQL 8.2 (CentOS-Testing) psql pg_dump.sql Did you start with an empty database when you imported the dump after migration from PostgreSQL 8.1 to 8.2? I suspect not, because you have everything twice. Are these error messages critical? Yes. __Martin -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users