Fwd: Re: local read from coordinator

2020-11-14 Thread onmstester onmstester
What if i use sstabledump? 

Because i'm going to read all data from a table that has no more 
insert/compaction(fixed list of sstables).

 For each sstable:

1. Using sstabledump -e, fetch all partition keys stored on sstable (ordered 
list)

2. Using sstabledump -k partitionKey, fetch all rows for the partitionKey on 
the sstable, by nodetool getsstables,  check if there is any other part of data 
on other sstables



This way maybe i could get 100% disk read performance (fast possible sequential 
read of all data on a table)

I will put the outcome of this experiment here






Sent using https://www.zoho.com/mail/







 Forwarded message 
From: onmstester onmstester 
To: "user"
Date: Sat, 14 Nov 2020 08:24:14 +0330
Subject: Re: local read from coordinator
 Forwarded message 



Thank you Jeff,

I disabled dynamic_snitch (after reading some Docs about how its not working 
good enough in production) and using GossipingFileProperty snitch, Is it make 
any difference to choosing the replica?



Sent using https://www.zoho.com/mail/








 On Wed, 11 Nov 2020 17:53:42 +0330 Jeff Jirsa <mailto:jji...@gmail.com> 
wrote 





This isn’t necessarily true and cassandra has no coordinator-only consistency 
level to force this behavior 



(The snitch is going to pick the best option for local_one reads and any 
compactions or latency deviations from load will make it likely that another 
replica is chosen in practice)



On Nov 11, 2020, at 3:46 AM, Alex Ott <mailto:alex...@gmail.com> wrote:





if you force routing key, then the replica that owns the data will be selected 
as coordinator



On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester 
<mailto:onmstes...@zoho.com.invalid> wrote:



Thanx,



But i'm OK with coordinator part, actually i was looking for kind of read CL to 
force to read from the coordinator only with no other connections to other 
nodes!



Sent using https://www.zoho.com/mail/








 Forwarded message 
From: Alex Ott <mailto:alex...@gmail.com>
To: "user"<mailto:user@cassandra.apache.org>
Date: Wed, 11 Nov 2020 11:28:56 +0330
Subject: Re: local read from coordinator
 Forwarded message 



token-aware policy doesn't work for token range queries (at least in the Java 
driver 3.x).  You need to force the driver to do the reading using a specific 
token as a routing key.  Here is Java implementation of the token range 
scanning algorithm that Spark uses: 
https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java



I'm not aware if Python driver is able to set routing key explicitly, but 
whitelist policy should help








On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
<mailto:erick.rami...@datastax.com> wrote:

Yes, use a token-aware policy so the driver will pick a coordinator where the 
token (partition) exists. Cheers!








-- 

With best wishes,                    Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)


















-- 

With best wishes,                    Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)

Re: local read from coordinator

2020-11-13 Thread onmstester onmstester
Thank you Jeff,

I disabled dynamic_snitch (after reading some Docs about how its not working 
good enough in production) and using GossipingFileProperty snitch, Is it make 
any difference to choosing the replica?


Sent using https://www.zoho.com/mail/






 On Wed, 11 Nov 2020 17:53:42 +0330 Jeff Jirsa  wrote 



This isn’t necessarily true and cassandra has no coordinator-only consistency 
level to force this behavior 

(The snitch is going to pick the best option for local_one reads and any 
compactions or latency deviations from load will make it likely that another 
replica is chosen in practice)

On Nov 11, 2020, at 3:46 AM, Alex Ott <mailto:alex...@gmail.com> wrote:



if you force routing key, then the replica that owns the data will be selected 
as coordinator


On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester 
<mailto:onmstes...@zoho.com.invalid> wrote:

Thanx,



But i'm OK with coordinator part, actually i was looking for kind of read CL to 
force to read from the coordinator only with no other connections to other 
nodes!


Sent using https://www.zoho.com/mail/






 Forwarded message 
From: Alex Ott <mailto:alex...@gmail.com>
To: "user"<mailto:user@cassandra.apache.org>
Date: Wed, 11 Nov 2020 11:28:56 +0330
Subject: Re: local read from coordinator
 Forwarded message 


token-aware policy doesn't work for token range queries (at least in the Java 
driver 3.x).  You need to force the driver to do the reading using a specific 
token as a routing key.  Here is Java implementation of the token range 
scanning algorithm that Spark uses: 
https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java



I'm not aware if Python driver is able to set routing key explicitly, but 
whitelist policy should help







On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
<mailto:erick.rami...@datastax.com> wrote:

Yes, use a token-aware policy so the driver will pick a coordinator where the 
token (partition) exists. Cheers!






-- 
With best wishes,                    Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)















-- 
With best wishes,                    Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)

Re: local read from coordinator

2020-11-11 Thread Alex Ott
Jeff, I was talking about driver -> coordinator communication, not from
where data will be read

On Wed, Nov 11, 2020 at 3:24 PM Jeff Jirsa  wrote:

>
> This isn’t necessarily true and cassandra has no coordinator-only
> consistency level to force this behavior
>
> (The snitch is going to pick the best option for local_one reads and any
> compactions or latency deviations from load will make it likely that
> another replica is chosen in practice)
>
> On Nov 11, 2020, at 3:46 AM, Alex Ott  wrote:
>
> 
> if you force routing key, then the replica that owns the data will be
> selected as coordinator
>
> On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester
>  wrote:
>
>> Thanx,
>>
>> But i'm OK with coordinator part, actually i was looking for kind of read
>> CL to force to read from the coordinator only with no other connections to
>> other nodes!
>>
>> Sent using Zoho Mail <https://www.zoho.com/mail/>
>>
>>
>>
>> ==== Forwarded message 
>> From: Alex Ott 
>> To: "user"
>> Date: Wed, 11 Nov 2020 11:28:56 +0330
>> Subject: Re: local read from coordinator
>>  Forwarded message 
>>
>> token-aware policy doesn't work for token range queries (at least in the
>> Java driver 3.x).  You need to force the driver to do the reading using a
>> specific token as a routing key.  Here is Java implementation of the token
>> range scanning algorithm that Spark uses:
>> https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java
>>
>> I'm not aware if Python driver is able to set routing key explicitly, but
>> whitelist policy should help
>>
>>
>>
>> On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
>> wrote:
>>
>> Yes, use a token-aware policy so the driver will pick a coordinator where
>> the token (partition) exists. Cheers!
>>
>>
>>
>> --
>> With best wishes,Alex Ott
>> http://alexott.net/
>> Twitter: alexott_en (English), alexott (Russian)
>>
>>
>>
>>
>
> --
> With best wishes,Alex Ott
> http://alexott.net/
> Twitter: alexott_en (English), alexott (Russian)
>
>

-- 
With best wishes,Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)


Re: local read from coordinator

2020-11-11 Thread Jeff Jirsa
What you describe is true for writes but not reads.

The read only gets sent to enough nodes to meet the consistency level,
unless/until one of two things happen:
- You trigger probabilistic read repair, in which case it's sent to all
nodes (or all nodes in a DC), or
- One of the chosen replicas is too slow to respond, in which case
speculative retry triggers and extra read commands are sent.

EVEN IF it was sent to all hosts in a DC and it responded to the client
when a sufficient CL was met (on reads), that doesn't ever guarantee that
the coordinator is the first to respond (or is guaranteed to respond, could
hit tombstone overwhelming or have very slow reads due to compaction / IO /
gc / slow disks / bad memory / etc).

On Wed, Nov 11, 2020 at 6:36 AM Durity, Sean R 
wrote:

> Doesn’t the read get sent to all nodes that own the data in parallel (from
> the coordinator)? And the first one that is able to respond wins (for
> LOCAL_ONE). That was my understanding.
>
>
>
> Sean Durity
>
>
>
> *From:* Jeff Jirsa 
> *Sent:* Wednesday, November 11, 2020 9:24 AM
> *To:* user@cassandra.apache.org
> *Subject:* [EXTERNAL] Re: local read from coordinator
>
>
>
>
> This isn’t necessarily true and cassandra has no coordinator-only
> consistency level to force this behavior
>
>
>
> (The snitch is going to pick the best option for local_one reads and any
> compactions or latency deviations from load will make it likely that
> another replica is chosen in practice)
>
>
>
> On Nov 11, 2020, at 3:46 AM, Alex Ott  wrote:
>
> 
>
> if you force routing key, then the replica that owns the data will be
> selected as coordinator
>
>
>
> On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester <
> onmstes...@zoho.com.invalid> wrote:
>
> Thanx,
>
>
>
> But i'm OK with coordinator part, actually i was looking for kind of read
> CL to force to read from the coordinator only with no other connections to
> other nodes!
>
>
>
> Sent using Zoho Mail [zoho.com]
> <https://urldefense.com/v3/__https:/www.zoho.com/mail/__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOGg-w1A4$>
>
>
>
>
>
>
>
>  Forwarded message 
> From: Alex Ott 
> To: "user"
> Date: Wed, 11 Nov 2020 11:28:56 +0330
> Subject: Re: local read from coordinator
>  Forwarded message 
>
>
>
> token-aware policy doesn't work for token range queries (at least in the
> Java driver 3.x).  You need to force the driver to do the reading using a
> specific token as a routing key.  Here is Java implementation of the token
> range scanning algorithm that Spark uses: 
> https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java
> [github.com]
> <https://urldefense.com/v3/__https:/github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOVaOupvg$>
>
>
>
> I'm not aware if Python driver is able to set routing key explicitly, but
> whitelist policy should help
>
>
>
>
>
>
>
> On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
> wrote:
>
> Yes, use a token-aware policy so the driver will pick a coordinator where
> the token (partition) exists. Cheers!
>
>
>
> --
>
> With best wishes,Alex Ott
> http://alexott.net/ [alexott.net]
> <https://urldefense.com/v3/__http:/alexott.net/__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOea1qCGg$>
> Twitter: alexott_en (English), alexott (Russian)
>
>
>
>
>
>
>
> --
>
> With best wishes,Alex Ott
> http://alexott.net/ [alexott.net]
> <https://urldefense.com/v3/__http:/alexott.net/__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOea1qCGg$>
> Twitter: alexott_en (English), alexott (Russian)
>
>
> --
>
> The information in this Internet Email is confidential and may be legally
> privileged. It is intended solely for the addressee. Access to this Email
> by anyone else is unauthorized. If you are not the intended recipient, any
> disclosure, copying, distribution or any action taken or omitted to be
> taken in reliance on it, is prohibited and may be unlawful. When addressed
> to our clients any opinions or advice contained in this Email are subject
> to the terms and conditions expressed in any applicable governing The Home
> Depot terms of business or client engagement letter. The Home Depot
> disclaims all responsibility and liability for the accuracy and content of
> this attachment and for any damages or losses arising from any
> inaccuracies, errors, viruses, e.g., worms, trojan horses, etc., or other
> items of a destructive nature, which may be contained in this attachment
> and shall not be liable for direct, indirect, consequential or special
> damages in connection with this e-mail message or its attachment.
>


RE: local read from coordinator

2020-11-11 Thread Durity, Sean R
Doesn’t the read get sent to all nodes that own the data in parallel (from the 
coordinator)? And the first one that is able to respond wins (for LOCAL_ONE). 
That was my understanding.

Sean Durity

From: Jeff Jirsa 
Sent: Wednesday, November 11, 2020 9:24 AM
To: user@cassandra.apache.org
Subject: [EXTERNAL] Re: local read from coordinator


This isn’t necessarily true and cassandra has no coordinator-only consistency 
level to force this behavior

(The snitch is going to pick the best option for local_one reads and any 
compactions or latency deviations from load will make it likely that another 
replica is chosen in practice)


On Nov 11, 2020, at 3:46 AM, Alex Ott 
mailto:alex...@gmail.com>> wrote:

if you force routing key, then the replica that owns the data will be selected 
as coordinator

On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester 
mailto:onmstes...@zoho.com.invalid>> wrote:
Thanx,

But i'm OK with coordinator part, actually i was looking for kind of read CL to 
force to read from the coordinator only with no other connections to other 
nodes!


Sent using Zoho Mail 
[zoho.com]<https://urldefense.com/v3/__https:/www.zoho.com/mail/__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOGg-w1A4$>



 Forwarded message 
From: Alex Ott mailto:alex...@gmail.com>>
To: "user"mailto:user@cassandra.apache.org>>
Date: Wed, 11 Nov 2020 11:28:56 +0330
Subject: Re: local read from coordinator
 Forwarded message 

token-aware policy doesn't work for token range queries (at least in the Java 
driver 3.x).  You need to force the driver to do the reading using a specific 
token as a routing key.  Here is Java implementation of the token range 
scanning algorithm that Spark uses: 
https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java
 
[github.com]<https://urldefense.com/v3/__https:/github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOVaOupvg$>

I'm not aware if Python driver is able to set routing key explicitly, but 
whitelist policy should help



On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
mailto:erick.rami...@datastax.com>> wrote:
Yes, use a token-aware policy so the driver will pick a coordinator where the 
token (partition) exists. Cheers!


--
With best wishes,Alex Ott
http://alexott.net/ 
[alexott.net]<https://urldefense.com/v3/__http:/alexott.net/__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOea1qCGg$>
Twitter: alexott_en (English), alexott (Russian)




--
With best wishes,Alex Ott
http://alexott.net/ 
[alexott.net]<https://urldefense.com/v3/__http:/alexott.net/__;!!M-nmYVHPHQ!dXosmgU9wrmIw7b4y8Xioii9P_OuSN-mvaCcAKCbdGEzSRBZO20Ibpqoyl9WNDHOea1qCGg$>
Twitter: alexott_en (English), alexott (Russian)



The information in this Internet Email is confidential and may be legally 
privileged. It is intended solely for the addressee. Access to this Email by 
anyone else is unauthorized. If you are not the intended recipient, any 
disclosure, copying, distribution or any action taken or omitted to be taken in 
reliance on it, is prohibited and may be unlawful. When addressed to our 
clients any opinions or advice contained in this Email are subject to the terms 
and conditions expressed in any applicable governing The Home Depot terms of 
business or client engagement letter. The Home Depot disclaims all 
responsibility and liability for the accuracy and content of this attachment 
and for any damages or losses arising from any inaccuracies, errors, viruses, 
e.g., worms, trojan horses, etc., or other items of a destructive nature, which 
may be contained in this attachment and shall not be liable for direct, 
indirect, consequential or special damages in connection with this e-mail 
message or its attachment.


Re: local read from coordinator

2020-11-11 Thread Jeff Jirsa

This isn’t necessarily true and cassandra has no coordinator-only consistency 
level to force this behavior 

(The snitch is going to pick the best option for local_one reads and any 
compactions or latency deviations from load will make it likely that another 
replica is chosen in practice)

> On Nov 11, 2020, at 3:46 AM, Alex Ott  wrote:
> 
> 
> if you force routing key, then the replica that owns the data will be 
> selected as coordinator
> 
>> On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester 
>>  wrote:
>> Thanx,
>> 
>> But i'm OK with coordinator part, actually i was looking for kind of read CL 
>> to force to read from the coordinator only with no other connections to 
>> other nodes!
>> 
>> Sent using Zoho Mail
>> 
>> 
>> 
>> 
>>  Forwarded message ====
>> From: Alex Ott 
>> To: "user"
>> Date: Wed, 11 Nov 2020 11:28:56 +0330
>> Subject: Re: local read from coordinator
>>  Forwarded message 
>> 
>> token-aware policy doesn't work for token range queries (at least in the 
>> Java driver 3.x).  You need to force the driver to do the reading using a 
>> specific token as a routing key.  Here is Java implementation of the token 
>> range scanning algorithm that Spark uses: 
>> https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java
>> 
>> I'm not aware if Python driver is able to set routing key explicitly, but 
>> whitelist policy should help
>> 
>> 
>> 
>> On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez  
>> wrote:
>> Yes, use a token-aware policy so the driver will pick a coordinator where 
>> the token (partition) exists. Cheers!
>> 
>> 
>> -- 
>> With best wishes,Alex Ott
>> http://alexott.net/
>> Twitter: alexott_en (English), alexott (Russian)
>> 
>> 
> 
> 
> -- 
> With best wishes,Alex Ott
> http://alexott.net/
> Twitter: alexott_en (English), alexott (Russian)


Re: Re: local read from coordinator

2020-11-11 Thread Alex Ott
if you force routing key, then the replica that owns the data will be
selected as coordinator

On Wed, Nov 11, 2020 at 12:35 PM onmstester onmstester
 wrote:

> Thanx,
>
> But i'm OK with coordinator part, actually i was looking for kind of read
> CL to force to read from the coordinator only with no other connections to
> other nodes!
>
> Sent using Zoho Mail <https://www.zoho.com/mail/>
>
>
>
>  Forwarded message 
> From: Alex Ott 
> To: "user"
> Date: Wed, 11 Nov 2020 11:28:56 +0330
> Subject: Re: local read from coordinator
>  Forwarded message 
>
> token-aware policy doesn't work for token range queries (at least in the
> Java driver 3.x).  You need to force the driver to do the reading using a
> specific token as a routing key.  Here is Java implementation of the token
> range scanning algorithm that Spark uses:
> https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java
>
> I'm not aware if Python driver is able to set routing key explicitly, but
> whitelist policy should help
>
>
>
> On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
> wrote:
>
> Yes, use a token-aware policy so the driver will pick a coordinator where
> the token (partition) exists. Cheers!
>
>
>
> --
> With best wishes,Alex Ott
> http://alexott.net/
> Twitter: alexott_en (English), alexott (Russian)
>
>
>
>

-- 
With best wishes,Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)


Fwd: Re: local read from coordinator

2020-11-11 Thread onmstester onmstester
Thanx,



But i'm OK with coordinator part, actually i was looking for kind of read CL to 
force to read from the coordinator only with no other connections to other 
nodes!

Sent using https://www.zoho.com/mail/






 Forwarded message 
From: Alex Ott 
To: "user"
Date: Wed, 11 Nov 2020 11:28:56 +0330
Subject: Re: local read from coordinator
 Forwarded message 


token-aware policy doesn't work for token range queries (at least in the Java 
driver 3.x).  You need to force the driver to do the reading using a specific 
token as a routing key.  Here is Java implementation of the token range 
scanning algorithm that Spark uses: 
https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java



I'm not aware if Python driver is able to set routing key explicitly, but 
whitelist policy should help







On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
<mailto:erick.rami...@datastax.com> wrote:

Yes, use a token-aware policy so the driver will pick a coordinator where the 
token (partition) exists. Cheers!






-- 
With best wishes,                    Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)

Re: local read from coordinator

2020-11-10 Thread Alex Ott
token-aware policy doesn't work for token range queries (at least in the
Java driver 3.x).  You need to force the driver to do the reading using a
specific token as a routing key.  Here is Java implementation of the token
range scanning algorithm that Spark uses:
https://github.com/alexott/cassandra-dse-playground/blob/master/driver-1.x/src/main/java/com/datastax/alexott/demos/TokenRangesScan.java

I'm not aware if Python driver is able to set routing key explicitly, but
whitelist policy should help



On Wed, Nov 11, 2020 at 7:03 AM Erick Ramirez 
wrote:

> Yes, use a token-aware policy so the driver will pick a coordinator where
> the token (partition) exists. Cheers!
>


-- 
With best wishes,Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)


Re: local read from coordinator

2020-11-10 Thread Erick Ramirez
Yes, use a token-aware policy so the driver will pick a coordinator where
the token (partition) exists. Cheers!