Re: Replication blocked

2004-08-16 Thread Bill Easton
A few brief comments on this one...

(1)  "Multi-threaded would probably cause thousands of problems" 
 Well, not necessarily.

Currently, the slave reads transaction A from
the relay log, executes its actions, commits it, then reads transaction
B, executes and commits.  It wouldn't be unreasonable to allow the
two transactions to execute on different threads, provided that
(a) B can't commit until A does and (b) in case of deadlock, B is rolled
back and re-executed, rather than A. 

"Small matter of programming," but not necessarily intractable.

(2)  If replication is being used for backup, a transaction on the master
is backed up as soon as it has been copied to the relay log.  A delay
in executing the relay log isn't a problem unless either (a) you are doing
queries against the slave and need timely data or (b) such delays
are so frequent that the slave can never catch up.

(3)  In the original post, the problem was that during 12 minutes to 
create an index on the slave, other transactions can be locked out.
Presumably, on the master, shared locks are set on every row
of the table as the ALTER TABLE is run, so it is certainly possible
that updates to the table can be delayed or that a deadlock can
happen on the master, as well.

= Original message follows =

Date: Fri, 13 Aug 2004 14:42:28 -0700
From: Jeremy Zawodny <[EMAIL PROTECTED]>
To: Donny Simonton <[EMAIL PROTECTED]>
Cc: "'Batara Kesuma'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: Replication blocked

On Fri, Aug 13, 2004 at 01:19:14AM -0500, Donny Simonton wrote:
>
> There is only one thread for replication on the slave.  It does one
> step a time.  If you use mysqlbinlog on one of your binary files on
> your master, you will see exactly how it all works.

No, there are 2 threads: the IO (or relay) thread, and the SQL thread.

> Multi-threaded would probably cause thousands of problems.  Unless
> it was threaded per table, but that would still cause problems
> because of multi-table deletes and updates.

Agreed.

Jeremy

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Replication blocked

2004-08-13 Thread Jeremy Zawodny
On Fri, Aug 13, 2004 at 01:19:14AM -0500, Donny Simonton wrote:
>
> There is only one thread for replication on the slave.  It does one
> step a time.  If you use mysqlbinlog on one of your binary files on
> your master, you will see exactly how it all works.

No, there are 2 threads: the IO (or relay) thread, and the SQL thread.

> Multi-threaded would probably cause thousands of problems.  Unless
> it was threaded per table, but that would still cause problems
> because of multi-table deletes and updates.

Agreed.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

[book] High Performance MySQL -- http://highperformancemysql.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Replication blocked

2004-08-12 Thread Donny Simonton
There is only one thread for replication on the slave.  It does one step a
time.  If you use mysqlbinlog on one of your binary files on your master,
you will see exactly how it all works.

Multi-threaded would probably cause thousands of problems.  Unless it was
threaded per table, but that would still cause problems because of
multi-table deletes and updates.

Donny

> -Original Message-
> From: Batara Kesuma [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:00 AM
> To: [EMAIL PROTECTED]
> Subject: Replication blocked
> 
> Hi,
> 
> I have 2 DB server, running as master and slave. I just add an index to
> one of my table on master, it took about 12 minutes. During adding the
> index, I have insert/update queries to other tables. On master this has
> no problem at all. The problem is, on slave these queries were blocked
> by the previous 12 minutes query. Does this mean that there is only 1
> thread to run the SQL from master? Can this be set to multithread? Thank
> you very much.
> 
> Regards,
> bk
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Replication blocked

2004-08-12 Thread Batara Kesuma
Hi,

I have 2 DB server, running as master and slave. I just add an index to
one of my table on master, it took about 12 minutes. During adding the
index, I have insert/update queries to other tables. On master this has
no problem at all. The problem is, on slave these queries were blocked
by the previous 12 minutes query. Does this mean that there is only 1
thread to run the SQL from master? Can this be set to multithread? Thank
you very much.

Regards,
bk

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]