Re: [codership-team] to causal read or to not causal read... that is the question

51 views
Skip to first unread message

seppo....@codership.com

unread,
Oct 18, 2012, 11:35:18 AM10/18/12
to codersh...@googlegroups.com
Mike,

You will need causal read guarantee if your application has causal
dependencies. e.g. you have two threads, which have private
connections to database, and which happen to go to separate cluster
nodes. And of these two threads, one performs a write operation
(UPDATE, DELETE...) and the other thread issues a SELECT to make sure
that the write operation was successful, and if not, the application
might freak out. These two threads have causal dependency, they expect
that the events were processed in the given order.

If you don't have such causal dependencies, you'd better not use
causal read feature, it would just slow down every SELECT statement.
Note that every read from the cluster, even with no causal reads, will
be consistent, you will just be reading from a consistent snapshot
which is a few milliseconds old. How long the delay is, depends on
write rate, allowed slave queue length and the how heavy the writes
will be.

-seppo

Quoting Michael Eklund <mike....@gmail.com>:

> We are beginning testing of Galera for our environment and need some more
> information. There are cases where without some major re-architecting we
> wont be able to direct clients to a specific node after inserting/updating
> some data. We are looking for some information on what kind of delay we
> can expect between certification of the transaction and when the nodes will
> actually be able to answer requests for this data. I fully realize this is
> a bit of a loaded question and probably depends on the amount of data,
> quality of hardware, etc. I am sure there are some kind of benchmark,
> guidelines out there for this though. We are also interested in what kind
> of latency overhead turning on causal reads causes, though honestly we
> don't like the thought of turning this on in order
> to guarantee consistency for a small, but very crucial, amount of our
> overall database traffic.
>
> Thanks,
>
> Mike E.
>
> --



Michael Eklund

unread,
Oct 18, 2012, 11:59:19 AM10/18/12
to codersh...@googlegroups.com
Am I correct in that wsrep_causal_read can be a session variable? 

Mike E.

Henrik Ingo

unread,
Oct 18, 2012, 4:59:19 PM10/18/12
to Michael Eklund, codersh...@googlegroups.com
On Thu, Oct 18, 2012 at 6:59 PM, Michael Eklund <mike....@gmail.com> wrote:
> Am I correct in that wsrep_causal_read can be a session variable?

Yes.

henrik
--
henri...@avoinelama.fi
+358-40-8211286 skype: henrik.ingo irc: hingo
www.openlife.cc

My LinkedIn profile: http://www.linkedin.com/profile/view?id=9522559
Reply all
Reply to author
Forward
0 new messages