Hi!

Sorry it's taken a while to get back to you, I'm backed up after the
conference last week (and vacation before that). I know on IRC I said to
submit now, and that's good thing to do. Any comments below can simply
be added as a comment to the proposal. We do read them!

Ajaya Agrawal <a9460509...@gmail.com> writes:
> Regarding the "improving replication policy in drizzle" I am writing a
> project proposal. I have talked to Stewart about this project over IRC
> channel.
>
>
>    1. This project's main goal is to implement a facility to wait for an
>    event on a table.
>    2. The slave currently polls the master at regular intervals which is
>    configurable, for  replication events.If the above mentioned feature is
>    implemented, instead of polling, we could send  signals to slave regarding
>    changes in replication log.
>    3. Finally we would make sure all the test cases still pass.

I'd add that it would also be useful for applications, which may also
use this feature instead of polling.

> *Implementation Overview:*
>
>    1. There is already a plugin for  function interfaces in drizzle. We
>    would use this interface to build our function interface which would wait
>    for events on a specified table or database. The interface would be
>    something like SELECT WAIT_FOR(INSERT, "local/test/table1"). This would
>    wait for INSERT events on "table1" table and it would notify the slave of
>    an insert event on the specified table. There is already an example of how
>    to use function interface in plugin folder i.e. hello_world. I am currently
>    trying to create an interface which would take arguments from an user
>    looking at  the above hello_world plugin.
>    2. There is already a plugin for monitoring the events in drizzled which
>    is the event monitoring interface. There is also another plugin in
>    drizzle/plugin/hello_events which waits for an event on a specified
>    database or table which is specified in the command line while starting
>    drizzled and prints to the console about the changes. We would use the
>    event observer interface to create another interface which when

s/interface/function/

>    given a
>    table name or database name, notifies the observers of the changes
>    happening. For e.g. this could be a slave which is interested in changes
>    happening in the 'replication_log' table.
>    3. In part three of the project we would make sure all type of events on
>    which a slave is interested is covered in our interface and all the test
>    cases for slave still pass.

(after modifying the slave plugin)

> Am I required to produce some UML diagrams, use cases and  design
> document?

No. A good outline like this is certainly a good start. You are not
*required* to create any UML diagrams/use cases, but they may help your
understanding of parts of the ssytem... and use cases are useful in
documenting the feature!

> I have not included the time out part because I couldn't understand the
> need of it. let's say there is this statement SELECT WAIT_FOR(INSERT,
> 'replication_log', 1). Does this mean that this would notify the slave of
> inserts which takes place within 1 second of issuing this statement?

Yes. This means you could, for example, easily then write a status
update to a table saying you're there looking and haven't just died (not
having traffic on a TCP connection can get you killed by things).

We should also construct an interface so that events are not missed.

e.g.

SELECT WAIT_FOR(INSERT, replication_log)
SELECT * FROM replication_log;
(another thread inserts something)
SELECT WAIT_FOR(INSERT, replication_log) <- would hang rather than
                                            return instantly

Which could be as simple as returning an integer which is "number of
events observed." This means you could avoid the above like this:

SELECT WAIT_FOR(INSERT, replication_log, 0, 0)
Returns: 1

SELECT * FROM replication_log;
(another thread inserts something)

SELECT WAIT_FOR(INSERT, replication_log, 10, 1)
Returns: 2 (and instantly rather than waiting for 10 seconds as the
            count is higher than the one passed in)


thoughts?
-- 
Stewart Smith

Attachment: pgpnWGUcTb9EC.pgp
Description: PGP signature

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : drizzle-discuss@lists.launchpad.net
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to