You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Alain RODRIGUEZ <ar...@gmail.com> on 2016/06/08 17:10:22 UTC
Re: Consistency level ONE and using withLocalDC
Hi George,
Would that be correct?
I think it is actually quite the opposite :-).
It is very well explained here:
https://docs.datastax.com/en/drivers/java/2.0/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.Builder.html#withUsedHostsPerRemoteDc-int-
Connection is opened to the X nodes in the remote DC. But it will only be
used to indeed do a local operation as a fallback if the operation is not
using a LOCAL_* consistency level.
Sorry I have been so long answering you.
-----------------------
Alain Rodriguez - alain@thelastpickle.com
France
The Last Pickle - Apache Cassandra Consulting
http://www.thelastpickle.com
2016-05-20 17:54 GMT+02:00 George Sigletos <si...@textkernel.nl>:
> Hello,
>
> Using withLocalDC="myLocalDC" and withUsedHostsPerRemoteDc>0 will
> guarantee that you will connect to one of the nodes in "myLocalDC",
>
> but DOES NOT guarantee that your read/write request will be acknowledged
> by a "myLocalDC" node. It may well be acknowledged by a remote DC node as
> well, even if "myLocalDC" is up and running.
>
> Would that be correct? Thank you
>
> Kind regards,
> George
>
Re: Consistency level ONE and using withLocalDC
Posted by George Sigletos <si...@textkernel.nl>.
Hi Alain,
Thank you for your answer.
I recently queried multiple times my cluster with consistency ONE and
setting "myLocalDC" (withUsedHostsPerRemoteDc=1)
However sometimes (not always) I got response from the node in the remote
DC. All my nodes in "myLocalDC" were up and running.
I was facing an data inconsistency issue. When connecting to the remote
node I got empty result, while when connecting to "myLocalDC" I got the
expected result back.
I was expecting that since all nodes in "myLocalDC" were up and running, no
attempt would have been made to the remote node.
I had to solve the problem by setting consistency "LOCAL_ONE" till I repair
the remote node. Or I could alternatively have set
withUsedHostsPerRemoteDc=0.
Kind regards,
George
On Wed, Jun 8, 2016 at 7:10 PM, Alain RODRIGUEZ <ar...@gmail.com> wrote:
> Hi George,
>
> Would that be correct?
>
>
> I think it is actually quite the opposite :-).
>
> It is very well explained here:
> https://docs.datastax.com/en/drivers/java/2.0/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.Builder.html#withUsedHostsPerRemoteDc-int-
>
> Connection is opened to the X nodes in the remote DC. But it will only be
> used to indeed do a local operation as a fallback if the operation is not
> using a LOCAL_* consistency level.
>
> Sorry I have been so long answering you.
>
> -----------------------
> Alain Rodriguez - alain@thelastpickle.com
> France
>
> The Last Pickle - Apache Cassandra Consulting
> http://www.thelastpickle.com
>
> 2016-05-20 17:54 GMT+02:00 George Sigletos <si...@textkernel.nl>:
>
>> Hello,
>>
>> Using withLocalDC="myLocalDC" and withUsedHostsPerRemoteDc>0 will
>> guarantee that you will connect to one of the nodes in "myLocalDC",
>>
>> but DOES NOT guarantee that your read/write request will be acknowledged
>> by a "myLocalDC" node. It may well be acknowledged by a remote DC node as
>> well, even if "myLocalDC" is up and running.
>>
>> Would that be correct? Thank you
>>
>> Kind regards,
>> George
>>
>
>