Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DBMail: users

Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping)

 

 

DBMail users RSS feed   Index | Next | Previous | View Threaded


daniel at cwa

May 22, 2012, 2:51 AM

Post #1 of 15 (667 views)
Permalink
Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping)

I’m attempting a migration of a Dbmail 2.2.17 installation to 3.0.2 with a
backup of our production database on a spare machine to test the procedure.


Our dbmail installation contains some 900k messages and is some 360gig
(data; index 1.9gig). The primary reason for wishing to migrate is for the
single instance storage of mime-parts to hopefully reduce the storage space
significantly (when I tried the same migration last year with the RC there
was a reduction by some 60%).



I am at the stage of running dbmail-util –My to convert the message
attachments to the new storage system and am hitting a brick wall in the
sense that dbmail-util is repeatedly coredumping. If I run the dbmail-util
command immediately again I receive foreign key errors:



May 22 10:34:35 dbm3 dbmail-util[6041]: [0x80240b040] Error:[db]
db_exec(+319): SQLException: Cannot add or update a child row: a foreign key
constraint fails (`dbmail`.`dbmail_partlists`, CONSTRAINT
`dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
`dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

May 22 10:34:35 dbm3 dbmail-util[6041]: [0x80240b040] Error:[db]
db_exec(+320): failed query [.INSERT INTO dbmail_partlists (physmessage_id,
is_header, part_key, part_depth, part_order, part_id) VALUES
(612844,1,1,0,0,27)]

migrating physmessage_id: 612844 failed



The “show innodb status;” gives



120522 10:34:35 Transaction:

TRANSACTION 0 10128353, ACTIVE 0 sec, OS thread id 34384941632 inserting,
thread declared inside InnoDB 500

mysql tables in use 1, locked 1

3 lock struct(s), heap size 1216, 1 row lock(s)

MySQL thread id 105, query id 3033949 localhost dbmail update

INSERT INTO dbmail_partlists (physmessage_id, is_header, part_key,
part_depth, part_order, part_id) VALUES (612844,1,1,0,0,27)

Foreign key constraint fails for table `dbmail`.`dbmail_partlists`:

,

CONSTRAINT `dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`)
REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE

Trying to add in child table, in index `message_parts` tuple:

DATA TUPLE: 8 fields;

0: len 8; hex 00000000000959ec; asc Y ;; 1: len 2; hex 8001; asc ;;
2: len 2; hex 8000; asc ;; 3: len 2; hex 8000; asc ;; 4: len 6; hex
0000009a8be1; asc ;; 5: len 7; hex 800000002d0110; asc - ;; 6:
len 1; hex 81; asc ;; 7: len 8; hex 000000000000001b; asc ;;



But in parent table `dbmail`.`dbmail_physmessage`, in index `PRIMARY`,

the closest match we can find is record:

PHYSICAL RECORD: n_fields 6; compact format; info bits 0

0: len 8; hex 00000000000959ee; asc Y ;; 1: len 6; hex 00000009d994;
asc ;; 2: len 7; hex 800012000c0335; asc 5;; 3: len 8; hex
0000000000001124; asc $;; 4: len 8; hex 000000000000116f; asc
o;; 5: len 8; hex 8000124a4658ef9f; asc JFX ;;





which I can avoid by deleting the offending message i.e. “delete from
dbmail_messageblks where physmessage_id = 609063;” Deleting them is fine
for my testing purposes but obviously is going to be an issue if/when I
carry out the migration for real.



Can anyone suggest to me what might be going wrong, or if there is anything
useful I can examine? So far this has happened 7 times up to physmessage_id
612844 (out of the 900k or so) so it is infrequent but being a coredump it
does mean it halts the migration which is inconvenient. I am running MySQL
5.1.55, on freebsd 8.2 for general information.



Also, and separately, the migration is pretty slow overall which is an issue
for the downtime it will cause. Looking at the test box (4 core Xeon, 4gig
ram, standard hdd) during the conversion the processor load is low (20%
overall i.e. 1 processor at under 100%), the disk utility is low (normally
under 50%) and innodb pool is set to 500meg which is obviously full, so can
someone suggest what is rate limiting the conversion?



Thank you


Daniel Schütze

------------------------

CWA International

Balmoral House

9 John Street

London
WC1N 2ES



(t) + 44 (0)20 7242 8444

(e) dms [at] cwa

(w) http://www.cwa.uk.com/


daniel at cwa

May 22, 2012, 4:17 AM

Post #2 of 15 (651 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

Just as an update to my message, it occurred to me the foreign key error
could well be a result of the core dump and nothing to do with what was
causing the error.



I’m a little out of my depth here, but a look at the core dumps seems to
point towards a problem around gmime (using gmime-24-2.4.24), is that
possible?



#0 0x0000000801e15786 in memcpy () from /lib/libc.so.7

[New Thread 8024b61c0 (LWP 100286)]

[New Thread 8024041c0 (LWP 100208)]

(gdb) where

#0 0x0000000801e15786 in memcpy () from /lib/libc.so.7

#1 0x00000008007dfe51 in rfc2047_encode ()

from /usr/local/lib/libgmime-2.4.so.6

#2 0x00007fffffffb740 in ?? ()

#3 0x00007fffffffb670 in ?? ()

#4 0x0000000801e1f41c in __uppercase_hex () from /lib/libc.so.7

#5 0x200a3e2200000001 in ?? ()



(retrieved from gdb /usr/local/sbin/dbmail-util *.core; where)



And a second dump which occurred as I was writing this e-mail



(gdb) where

#0 0x0000000801e12786 in memcpy () from /lib/libc.so.7

#1 0x00000008007dc911 in stream_read () from
/usr/local/lib/libgmime-2.4.so.6

#2 0x00000008007d8890 in g_mime_stream_write_to_stream ()

from /usr/local/lib/libgmime-2.4.so.6

#3 0x00000008007d6e81 in mime_part_write_to_stream ()

from /usr/local/lib/libgmime-2.4.so.6

#4 0x00000008007cafe2 in message_write_to_stream ()

from /usr/local/lib/libgmime-2.4.so.6

#5 0x00000008007d08c6 in g_mime_object_to_string ()

from /usr/local/lib/libgmime-2.4.so.6

#6 0x0000000800666c45 in dbmail_message_init_with_string ()

from /usr/local/lib/dbmail/libdbmail.so.0

#7 0x00000008006676d5 in _retrieve ()

from /usr/local/lib/dbmail/libdbmail.so.0

#8 0x0000000800667797 in dbmail_message_retrieve ()

from /usr/local/lib/dbmail/libdbmail.so.0

#9 0x0000000000403dc8 in do_showhelp ()

#10 0x0000000000404d6e in main ()







Daniel Schütze



------------------------

CWA International

Balmoral House

9 John Street

London
WC1N 2ES



(t) + 44 (0)20 7242 8444

(e) dms [at] cwa

(w) http://www.cwa.uk.com/



From: Daniel Schütze [mailto:daniel [at] cwa]
Sent: 22 May 2012 10:51
To: 'dbmail [at] dbmail'
Subject: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping)



I’m attempting a migration of a Dbmail 2.2.17 installation to 3.0.2 with a
backup of our production database on a spare machine to test the procedure.


Our dbmail installation contains some 900k messages and is some 360gig
(data; index 1.9gig). The primary reason for wishing to migrate is for the
single instance storage of mime-parts to hopefully reduce the storage space
significantly (when I tried the same migration last year with the RC there
was a reduction by some 60%).



I am at the stage of running dbmail-util –My to convert the message
attachments to the new storage system and am hitting a brick wall in the
sense that dbmail-util is repeatedly coredumping. If I run the dbmail-util
command immediately again I receive foreign key errors:



May 22 10:34:35 dbm3 dbmail-util[6041]: [0x80240b040] Error:[db]
db_exec(+319): SQLException: Cannot add or update a child row: a foreign key
constraint fails (`dbmail`.`dbmail_partlists`, CONSTRAINT
`dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
`dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

May 22 10:34:35 dbm3 dbmail-util[6041]: [0x80240b040] Error:[db]
db_exec(+320): failed query [.INSERT INTO dbmail_partlists (physmessage_id,
is_header, part_key, part_depth, part_order, part_id) VALUES
(612844,1,1,0,0,27)]

migrating physmessage_id: 612844 failed



The “show innodb status;” gives



120522 10:34:35 Transaction:

TRANSACTION 0 10128353, ACTIVE 0 sec, OS thread id 34384941632 inserting,
thread declared inside InnoDB 500

mysql tables in use 1, locked 1

3 lock struct(s), heap size 1216, 1 row lock(s)

MySQL thread id 105, query id 3033949 localhost dbmail update

INSERT INTO dbmail_partlists (physmessage_id, is_header, part_key,
part_depth, part_order, part_id) VALUES (612844,1,1,0,0,27)

Foreign key constraint fails for table `dbmail`.`dbmail_partlists`:

,

CONSTRAINT `dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`)
REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE

Trying to add in child table, in index `message_parts` tuple:

DATA TUPLE: 8 fields;

0: len 8; hex 00000000000959ec; asc Y ;; 1: len 2; hex 8001; asc ;;
2: len 2; hex 8000; asc ;; 3: len 2; hex 8000; asc ;; 4: len 6; hex
0000009a8be1; asc ;; 5: len 7; hex 800000002d0110; asc - ;; 6:
len 1; hex 81; asc ;; 7: len 8; hex 000000000000001b; asc ;;



But in parent table `dbmail`.`dbmail_physmessage`, in index `PRIMARY`,

the closest match we can find is record:

PHYSICAL RECORD: n_fields 6; compact format; info bits 0

0: len 8; hex 00000000000959ee; asc Y ;; 1: len 6; hex 00000009d994;
asc ;; 2: len 7; hex 800012000c0335; asc 5;; 3: len 8; hex
0000000000001124; asc $;; 4: len 8; hex 000000000000116f; asc
o;; 5: len 8; hex 8000124a4658ef9f; asc JFX ;;





which I can avoid by deleting the offending message i.e. “delete from
dbmail_messageblks where physmessage_id = 609063;” Deleting them is fine
for my testing purposes but obviously is going to be an issue if/when I
carry out the migration for real.



Can anyone suggest to me what might be going wrong, or if there is anything
useful I can examine? So far this has happened 7 times up to physmessage_id
612844 (out of the 900k or so) so it is infrequent but being a coredump it
does mean it halts the migration which is inconvenient. I am running MySQL
5.1.55, on freebsd 8.2 for general information.



Also, and separately, the migration is pretty slow overall which is an issue
for the downtime it will cause. Looking at the test box (4 core Xeon, 4gig
ram, standard hdd) during the conversion the processor load is low (20%
overall i.e. 1 processor at under 100%), the disk utility is low (normally
under 50%) and innodb pool is set to 500meg which is obviously full, so can
someone suggest what is rate limiting the conversion?



Thank you


Daniel Schütze

------------------------

CWA International

Balmoral House

9 John Street

London
WC1N 2ES



(t) + 44 (0)20 7242 8444

(e) dms [at] cwa

(w) http://www.cwa.uk.com/


daniel at cwa

May 22, 2012, 6:02 AM

Post #3 of 15 (650 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

Actually it's now gotten to the point where dbmail-util -My doesn’t run for
more than a couple of seconds before I get the errors I'm encountering. I'm
not getting so many core dumps as just simple aborts to the command line:

May 22 13:56:22 dbm3 dbmail-util[14952]: [0x80220b040] Error:[db]
db_exec(+319): SQLException: Cannot add or update a child row: a foreign
key constraint fails (`dbmail`.`dbmail_partlists`, CONSTRAINT
`dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
`dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
May 22 13:56:22 dbm3 dbmail-util[14952]: [0x80220b040] Error:[db]
db_exec(+320): failed query [.INSERT INTO dbmail_partlists (physmessage_id,
is_header, part_key, part_depth, part_order, part_id) VALUES
(657895,1,1,0,0,27)]
migrating physmessage_id: 657895
failed

From the messages (phymessage_id) affected it is clear that the frequency is
getting worse and high enough that the conversion exercise now seems futile.

Clearly I'll need to know/figure out what is causing this to try and
proceed.

Daniel Schütze


_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


daniel at gosi

May 22, 2012, 6:37 AM

Post #4 of 15 (648 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

Hi Daniel,

just came to my mind: did you run dbmail util on your orginal storage/version?
Maybe there is a problem in the dataset that might get fixed this way?

Otherwise I think you have to wait till Paul gets on this topic.

Greetings,
Daniel

Am 22.05.2012 um 15:02 schrieb Daniel Schütze:

> Actually it's now gotten to the point where dbmail-util -My doesn’t run for
> more than a couple of seconds before I get the errors I'm encountering. I'm
> not getting so many core dumps as just simple aborts to the command line:
>
> May 22 13:56:22 dbm3 dbmail-util[14952]: [0x80220b040] Error:[db]
> db_exec(+319): SQLException: Cannot add or update a child row: a foreign
> key constraint fails (`dbmail`.`dbmail_partlists`, CONSTRAINT
> `dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
> `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
> May 22 13:56:22 dbm3 dbmail-util[14952]: [0x80220b040] Error:[db]
> db_exec(+320): failed query [.INSERT INTO dbmail_partlists (physmessage_id,
> is_header, part_key, part_depth, part_order, part_id) VALUES
> (657895,1,1,0,0,27)]
> migrating physmessage_id: 657895
> failed
>
> From the messages (phymessage_id) affected it is clear that the frequency is
> getting worse and high enough that the conversion exercise now seems futile.
>
> Clearly I'll need to know/figure out what is causing this to try and
> proceed.
>
> Daniel Schütze
>
>
> _______________________________________________
> DBmail mailing list
> DBmail [at] dbmail
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


paul at nfg

May 24, 2012, 12:52 AM

Post #5 of 15 (646 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

On 05/22/2012 01:17 PM, Daniel Schütze wrote:
> Can anyone suggest to me what might be going wrong, or if there is
> anything useful I can examine? So far this has happened 7 times up to
> physmessage_id 612844 (out of the 900k or so) so it is infrequent but
> being a coredump it does mean it halts the migration which is
> inconvenient. I am running MySQL 5.1.55, on freebsd 8.2 for general
> information.

Did you run the full schema migration successfully first?

> Also, and separately, the migration is pretty slow overall which is an
> issue for the downtime it will cause. Looking at the test box (4 core
> Xeon, 4gig ram, standard hdd) during the conversion the processor load
> is low (20% overall i.e. 1 processor at under 100%), the disk utility is
> low (normally under 50%) and innodb pool is set to 500meg which is
> obviously full, so can someone suggest what is rate limiting the conversion?

Running dbmail-util -M is not required and does not require downtime.
The data-store is backward compatible - only body searches will not work
on messageblks.

That said: I haven't seen this problem yet.

Since the core dump seems to originate from gmime, I would advise you to
upgrade to the latest gmime-2.4. I see rfc2047 related bugfixes at least
in 2.4.30, and probably later ones as well.




--
________________________________________________________________
Paul J Stevens pjstevns @ gmail, twitter, skype, linkedin

* Premium Hosting Services and Web Application Consultancy *

www.nfg.nl/info [at] nfg/+31.85.877.99.97
________________________________________________________________
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


daniel at cwa

May 24, 2012, 8:28 AM

Post #6 of 15 (645 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

>Did you run the full schema migration successfully first?

Yes I ran it without error (took 24 hrs on the test box mind you!).

>Running dbmail-util -M is not required and does not require downtime.
>The data-store is backward compatible - only body searches will not work
>on messageblks.

I hadn't appreciated that at the time, though it is clearly laid out in the
docs which I saw when I re-read them. I will want to migrate the messages
in due course to free up space of course.

>That said: I haven't seen this problem yet.

>Since the core dump seems to originate from gmime, I would advise you to
>upgrade to the latest gmime-2.4. I see rfc2047 related bugfixes at least
>in 2.4.30, and probably later ones as well.

I am using the freebsd ports and the latest version available is 2.4.24

Given the whole run is a test anyway I've started from scratch after making
some adjustments esp. as I want to see the system in action above rebuilding
the headers but before the message migration, then I'll try the migration
and see if that gives rise to the same issue.

Daniel Schütze


_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


ahicks at p-o

May 24, 2012, 10:07 AM

Post #7 of 15 (642 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

Resending as it does not appear to have arrived!

On 24/05/2012 10:32, Alan Hicks wrote:
> On 24/05/2012 08:52, Paul J Stevens wrote:
>> On 05/22/2012 01:17 PM, Daniel Schütze wrote:
>>> Can anyone suggest to me what might be going wrong, or if there is
>>> anything useful I can examine? So far this has happened 7 times up to
>>> physmessage_id 612844 (out of the 900k or so) so it is infrequent but
>>> being a coredump it does mean it halts the migration which is
>>> inconvenient. I am running MySQL 5.1.55, on freebsd 8.2 for general
>>> information.
> Apologies I only just picked up on fbsd. I'm preparing an upgrade to
> gmime and will hopefully have this later today, the port is unmaintained
> so unless anyone else is interested I'll look after it.
Submitted as http://www.freebsd.org/cgi/query-pr.cgi?pr=168308
>
> I'm aware of issues with ldap and the latest git appears to fix those so
> they maybe related, it's been a low priority for me recently, guess this
> bumps it up.
>>
>> Did you run the full schema migration successfully first?
>>
>>> Also, and separately, the migration is pretty slow overall which is an
>>> issue for the downtime it will cause. Looking at the test box (4 core
>>> Xeon, 4gig ram, standard hdd) during the conversion the processor load
>>> is low (20% overall i.e. 1 processor at under 100%), the disk utility is
>>> low (normally under 50%) and innodb pool is set to 500meg which is
>>> obviously full, so can someone suggest what is rate limiting the
>>> conversion?
>>
>> Running dbmail-util -M is not required and does not require downtime.
>> The data-store is backward compatible - only body searches will not work
>> on messageblks.
>>
>> That said: I haven't seen this problem yet.
>>
>> Since the core dump seems to originate from gmime, I would advise you to
>> upgrade to the latest gmime-2.4. I see rfc2047 related bugfixes at least
>> in 2.4.30, and probably later ones as well.
>>
>>
>>
>>
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


ahicks at p-o

May 24, 2012, 10:10 AM

Post #8 of 15 (643 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

On 24/05/2012 16:28, Daniel Schütze wrote:
>> Did you run the full schema migration successfully first?
>
> Yes I ran it without error (took 24 hrs on the test box mind you!).
>
>> Running dbmail-util -M is not required and does not require downtime.
>> The data-store is backward compatible - only body searches will not work
>> on messageblks.
>
> I hadn't appreciated that at the time, though it is clearly laid out in the
> docs which I saw when I re-read them. I will want to migrate the messages
> in due course to free up space of course.
>
>> That said: I haven't seen this problem yet.
>
>> Since the core dump seems to originate from gmime, I would advise you to
>> upgrade to the latest gmime-2.4. I see rfc2047 related bugfixes at least
>> in 2.4.30, and probably later ones as well.
>
> I am using the freebsd ports and the latest version available is 2.4.24
I've just submitted an upgrade request,
http://www.freebsd.org/cgi/query-pr.cgi?pr=168308

Alan Hicks
>
> Given the whole run is a test anyway I've started from scratch after making
> some adjustments esp. as I want to see the system in action above rebuilding
> the headers but before the message migration, then I'll try the migration
> and see if that gives rise to the same issue.
>
> Daniel Schütze
>
>
> _______________________________________________
> DBmail mailing list
> DBmail [at] dbmail
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
>

--
Persistent Objects Ltd
128 Lilleshall Road
Morden SM4 6DR

The Home of Lasting Solutions

t 0208 544 5292
m 079 3030 5004
w p-o.co.uk
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


daniel at cwa

May 28, 2012, 9:48 AM

Post #9 of 15 (624 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

From: Alan Hicks <ahicks [at] p-o>
Subject: Re: [Dbmail] Migration of Data from 2.2.17 to 3.0.2
(dbmail-util coredumping)


Resending as it does not appear to have arrived!

On 24/05/2012 10:32, Alan Hicks wrote:
> On 24/05/2012 08:52, Paul J Stevens wrote:
>> On 05/22/2012 01:17 PM, Daniel Sch?tze wrote:
>>> Can anyone suggest to me what might be going wrong, or if there is
>>> anything useful I can examine? So far this has happened 7 times up
>>> to physmessage_id 612844 (out of the 900k or so) so it is infrequent
>>> but being a coredump it does mean it halts the migration which is
>>> inconvenient. I am running MySQL 5.1.55, on freebsd 8.2 for general
>>> information.
> Apologies I only just picked up on fbsd. I'm preparing an upgrade to
> gmime and will hopefully have this later today, the port is
> unmaintained so unless anyone else is interested I'll look after it.
Submitted as http://www.freebsd.org/cgi/query-pr.cgi?pr=168308

Thank you, I updated the ports and built gmime 2.4.32 and tried again with
the dbmail-util -yM. It ran the first batch fine (no error on exit) and
then I started dbmail-util off again and immediately received a foreign key
error for a message (exactly as before). I do not know if it was literally
the first message that was attempted to be processed but the error was
essentially instant. I then deleted the entries for that physmessage_id
from the dbmail_partlists table and reran dbmail-util which then proceeded.
Looking at dbmail_partlists it appears that the message was migrated again,
this time without throwing an error. Currently I'm leaving the migration
going with 100000 messages with the aim of hopefully getting through all of
them. Unfortunately this test box gets through them very slowly.

Daniel Schütze

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


daniel at cwa

May 29, 2012, 2:10 AM

Post #10 of 15 (622 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

I think I may have a better idea what is going on.

After leaving the migration going (using the latest gmime) the dbmail-util
core dumped again.

I ran dbmail-util with full logging and I could see what situation was
bringing up the foreign key error.

Essentially dbmail-util -My gets a list of messages present in the
dbmail_messageblks table and then proceeds to convert these, but in my case
is failing because there are messages in this table which are not present in
the other tables e.g. dbmail_physmessage and so the attempt to place their
mimeparts in the dbmail_partlists etc fails the constraints.

In fact on my test box the query:

SELECT distinct physmessage_id FROM dbmail_messageblks where physmessage_id
not in (SELECT id FROM dbmail_physmessage)

Gives over 16,000 results whereas the same on my live server and its slave
give 0 results.

This will of course explain why on my previous attempt deleting these
entries from the table kept the migration going and perhaps that the error
had nothing to do with gmime.

Now I thought that dbmail-util -ay checked for unconnected messages and
removed them which is clearly not happening on my test box; but at this
stage I am also rather perplexed as to how these entries are in the database
at all given they are not on the live / slave systems.

Daniel Schütze

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


jake at vapourforge

May 29, 2012, 5:24 AM

Post #11 of 15 (622 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

How did you do the migration of the database?

On 29/05/12 19:10, Daniel Schütze wrote:
> I think I may have a better idea what is going on.
>
> After leaving the migration going (using the latest gmime) the dbmail-util
> core dumped again.
>
> I ran dbmail-util with full logging and I could see what situation was
> bringing up the foreign key error.
>
> Essentially dbmail-util -My gets a list of messages present in the
> dbmail_messageblks table and then proceeds to convert these, but in my case
> is failing because there are messages in this table which are not present in
> the other tables e.g. dbmail_physmessage and so the attempt to place their
> mimeparts in the dbmail_partlists etc fails the constraints.
>
> In fact on my test box the query:
>
> SELECT distinct physmessage_id FROM dbmail_messageblks where physmessage_id
> not in (SELECT id FROM dbmail_physmessage)
>
> Gives over 16,000 results whereas the same on my live server and its slave
> give 0 results.
>
> This will of course explain why on my previous attempt deleting these
> entries from the table kept the migration going and perhaps that the error
> had nothing to do with gmime.
>
> Now I thought that dbmail-util -ay checked for unconnected messages and
> removed them which is clearly not happening on my test box; but at this
> stage I am also rather perplexed as to how these entries are in the database
> at all given they are not on the live / slave systems.
>
> Daniel Schütze
>
> _______________________________________________
> DBmail mailing list
> DBmail [at] dbmail
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


paul at nfg

May 29, 2012, 5:41 AM

Post #12 of 15 (622 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

On 05/29/2012 11:10 AM, Daniel Schütze wrote:

> Now I thought that dbmail-util -ay checked for unconnected messages and
> removed them which is clearly not happening on my test box; but at this
> stage I am also rather perplexed as to how these entries are in the database
> at all given they are not on the live / slave systems.

dbmail-util will check for unconnected messageblks rows, but only on 2.2!

That check was removed from the 3.x codebase.

As to how those unconnected messageblks came to be, I'm curious but
without useful ideas, alas.


--
________________________________________________________________
Paul J Stevens pjstevns @ gmail, twitter, skype, linkedin

* Premium Hosting Services and Web Application Consultancy *

www.nfg.nl/info [at] nfg/+31.85.877.99.97
________________________________________________________________
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


daniel at cwa

May 29, 2012, 6:09 AM

Post #13 of 15 (624 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

>How did you do the migration of the database?

I took a mysql dump from the replication slave, copied it over to the test
box and imported it into a completely empty mysql installation with mysql <
dumpfile.sql



Daniel Schütze



------------------------

CWA International

Balmoral House

9 John Street

London
WC1N 2ES



(t) + 44 (0)20 7242 8444

(e) dms [at] cwa

(w) http://www.cwa.uk.com/


jake at vapourforge

May 29, 2012, 6:51 AM

Post #14 of 15 (622 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

I wonder if that's where the issue came into it.
take a look at individual records, if they are in the first db, and not
in it after a restore that's where I'd be looking, are you getting any
warnings on the load?.

I also wonder if it might be something like max packet size conflicts
between the dumping and loading systems perhaps?

I'm getting closer to pulling the trigger on this myself so I'm curious
as to the result.


On 29/05/12 23:09, Daniel Schütze wrote:
>
> >How did you do the migration of the database?
>
> I took a mysql dump from the replication slave, copied it over to the
> test box and imported it into a completely empty mysql installation
> with mysql < dumpfile.sql
>
> Daniel Schütze
>
> ------------------------
>
> CWA International
>
> Balmoral House
>
> 9 John Street
>
> London
> WC1N 2ES
>
> (t) + 44 (0)20 7242 8444
>
> (e) dms [at] cwa
>
> (w) http://www.cwa.uk.com/
>
>
>
> _______________________________________________
> DBmail mailing list
> DBmail [at] dbmail
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


daniel at cwa

May 29, 2012, 7:23 AM

Post #15 of 15 (622 views)
Permalink
Re: Migration of Data from 2.2.17 to 3.0.2 (dbmail-util coredumping) [In reply to]

>I wonder if that's where the issue came into it.
>take a look at individual records, if they are in the first db, and not in
it after a restore >that's where I'd be looking, are you getting any
warnings on the load?.

>I also wonder if it might be something like max packet size conflicts
between the dumping and >loading systems perhaps?

The problem I've encountered is that the records were in the restore but "no
longer" in the original ie. The other way round. However there was some
time delay between the dump I used and when I realised there was a problem
(by which time the slave's state had of course changed). It stands to
reason though that the entries were in the replication slave at the time of
the dump and they have since been cleaned up.

For the record the max allowed packet (also in dump) is 128M in my
replication slave and 500M on the test box (given that a large attachment
would be in a single blob with dbmail3).

Now I've deleted the dangling dbmail_messageblks entries I'm trying to
migrate the entire remaining dbmail2 database on the test box. If/when that
works for belt and braces I'll restore a recent dump and search for these
oddities in both the slave/restored versions. I would be surprised if I
find them again.

When/if we do this for real though the most likely scenario is that we stop
slave replication, check the master/slave match and then carry out the
conversion of the live system (with the downtime that entails) because the
production server (with its ssd array) is orders of magnitude faster than
our slave / test boxes. In that scenario there would not necessarily be a
dump/restore operation at all, however as our server was originally set up
with an auto expanding ibdata1 and without the file_per_table setting the
schema conversion / dbmail2 to 3 conversion will hugely inflate the already
substantial ibdata file and so a dump/restore from the same machine is
likely.

Daniel Schütze



_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

DBMail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.