Adrien Mogenet 2013-01-13, 00:06
Andrew Purtell 2013-01-13, 02:39
Ted Yu 2013-01-13, 02:48
Andrew Purtell 2013-01-13, 03:58
ramkrishna vasudevan 2013-01-13, 10:04
Adrien Mogenet 2013-01-13, 10:42
Anoop John 2013-01-13, 16:12
Wei Tan 2013-01-15, 18:44
Varun Sharma 2013-01-15, 18:56
Andrew Purtell 2013-01-15, 19:20
-Re: Coprocessor / threading model
Wei Tan 2013-01-15, 22:41
Thanks Andrew for your detailed clarification.
Now I understand that in general, the system is subject to CAP theorem.
You want good consistency AND latency, then partition tolerance needs to
be sacrificed: this is the "local index" approach, i.e., colocate index
and data and avoid RPC.
Otherwise, if you can tolerate consistency but not latency, you put RPCs
in a queue and process them in the background. By this means you can have
a "global" index with some lag.
Research Staff Member
IBM T. J. Watson Research Center
Yorktown Heights, NY 10598
[EMAIL PROTECTED]; 914-945-4386
From: Andrew Purtell <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>,
Date: 01/15/2013 02:20 PM
Subject: Re: Coprocessor / threading model
HTable is a blocking interface. When a client issues a put, for example,
do not want to return until we can confirm the store has been durably
persisted. For client convenience many additional details of remote region
invocation are hidden, for example META table lookups for relocated
regions, reconnection, retries. Just about all coprocessor upcalls for the
Observer interface happen with the RPC handler context. RPC handlers are
drawn from a fixed pool of threads. Your CP code is tying up one of a
resource for as long as it has control. And in here you are running the
complex HTable machinery. For many reasons your method call on HTable may
block (potentially for a long time) and therefore the RPC handler your
invocation is executing within will also block. An accidental cycle can
cause a deadlock once there are no free handlers somewhere, which will
happen as part of normal operation when the cluster is loaded, and the
higher the load the more likely.
Instead you can do what Anoop has described in this thread and install a
into the master that insures index regions are assigned to the same
regionserver as the primary table, and then call from a region of the
primary table into a colocated region of the index table, or vice versa,
bypassing HTable and the RPC stack. This is just making an in process
method call on one object from another.
Or, you could allocate a small executor pool for cross region RPC. When
upcall into your CP happens, dispatch work to the executor and return
immediately to release the RPC worker thread back to the pool. This would
avoid the possibility of deadlock but this may not give you the semantics
you want because that background work could lag unpredictably.
On Tue, Jan 15, 2013 at 10:44 AM, Wei Tan <[EMAIL PROTECTED]> wrote:
> Andrew, could you explain more, why doing cross-table operation is an
> anti-pattern of using CP?
> Durability might be an issue, as far as I understand. Thanks,
> Best Regards,
Problems worthy of attack prove their worth by hitting back. - Piet Hein
(via Tom White)
Anoop Sam John 2013-01-16, 04:39
Ted 2013-01-13, 01:38
anil gupta 2013-01-13, 02:30
Michel Segel 2013-01-13, 13:25