Re: Reads requiring response from both servers.

2014-11-18 Thread Tyler Hobbs
On Tue, Nov 18, 2014 at 4:46 AM, Jacob Rhoden  wrote:

> I was going to report a bug, but first figured I should check its not
> “working as expected”. Is it just me or is it wrong that the following
> query needs to talk to both nodes to build a response to this query?
>

It seems to be working as expected to me, unless I'm missing something.


>
>
> Why is this a bug? It seems that this behaviour of needing a response to
> both nodes only exists if you don’t query with a clustering key, or a key
> when RF=2. However you can change this behaviour, by, for example, changing
> the table from “primary key (uuid)” to “primary key ((a), uuid)” where the
> value of a always equals “a” ( so you can query 'where a=“a”’), at which
> point, cassandra decides it only needs results from one node.
>

Can you clarify what you mean?  It sounds like you're saying "if I specify
a partition key, it only needs to query one node", which is also expected
behavior (assuming a consistency level of ONE).

By the way, this type of question is better suited for the user mailing
list than the dev mailing list.

-- 
Tyler Hobbs
DataStax 


Re: Reads requiring response from both servers.

2014-11-18 Thread Jacob Rhoden

> On 19 Nov 2014, at 4:44 am, Tyler Hobbs  wrote:
> 
>> On Tue, Nov 18, 2014 at 4:46 AM, Jacob Rhoden  wrote:
>> 
>> I was going to report a bug, but first figured I should check its not
>> “working as expected”. Is it just me or is it wrong that the following
>> query needs to talk to both nodes to build a response to this query?
> 
> It seems to be working as expected to me, unless I'm missing something.

If there are two nodes and RF=2, a simple data lookup on a very small table 
will only need to talk to one node if you put in a (fake/pointless) partition 
key, but two nodes if you don't. The impact is that if you want 1ms query time 
on a 50 row table you must use a partition key, otherwise you get 250ms query 
time.


>> Why is this a bug? It seems that this behaviour of needing a response to
>> both nodes only exists if you don’t query with a clustering key, or a key
>> when RF=2. However you can change this behaviour, by, for example, changing
>> the table from “primary key (uuid)” to “primary key ((a), uuid)” where the
>> value of a always equals “a” ( so you can query 'where a=“a”’), at which
>> point, cassandra decides it only needs results from one node.
> 
> Can you clarify what you mean?  It sounds like you're saying "if I specify
> a partition key, it only needs to query one node", which is also expected
> behavior (assuming a consistency level of ONE).

It's my understanding from the documentation that consistency level one (which 
I am using) is about write consistency, not read consistency. Actually if I 
change it in cqlsh, cqlsh refuses to run the query.

> By the way, this type of question is better suited for the user mailing
> list than the dev

Ok thanks, I'll file it as a bug request with more details.

Thanks!

Latest Code from Trunk - Server is not starting

2014-11-18 Thread Rajanarayanan Thottuvaikkatumana
I have taken the latest code from trunk, compiled (I have some changes in some 
of the local files also). But when I start the Cassandra server, I am getting 
exceptions. The exceptions are not seeming to be from the classed where I 
changed OR has any relationship with the ones that are showing error. Any idea? 
Anybody else is getting same error? 

Rajanarayanans-MacBook-Pro:cassandra-trunk RajT$ ./bin/cassandra -f
objc[4284]: Class JavaLaunchHelper is implemented in both 
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and 
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib.
 One of the two will be used. Which one is undefined.
CompilerOracle: inline org/apache/cassandra/db/AbstractNativeCell.compareTo 
(Lorg/apache/cassandra/db/composites/Composite;)I
CompilerOracle: inline 
org/apache/cassandra/db/composites/AbstractSimpleCellNameType.compareUnsigned 
(Lorg/apache/cassandra/db/composites/Composite;Lorg/apache/cassandra/db/composites/Composite;)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare 
(Ljava/nio/ByteBuffer;[B)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare 
([BLjava/nio/ByteBuffer;)I
CompilerOracle: inline 
org/apache/cassandra/utils/ByteBufferUtil.compareUnsigned 
(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
CompilerOracle: inline 
org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
(Ljava/lang/Object;JILjava/lang/Object;JI)I
CompilerOracle: inline 
org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
(Ljava/lang/Object;JILjava/nio/ByteBuffer;)I
CompilerOracle: inline 
org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
INFO  20:34:19 Hostname: Rajanarayanans-MacBook-Pro.local
INFO  20:34:19 Loading settings from 
file:/Users/RajT/cassandra-source/cassandra-trunk/conf/cassandra.yaml
INFO  20:34:19 Node configuration:[authenticator=AllowAllAuthenticator; 
authorizer=AllowAllAuthorizer; auto_snapshot=true; 
batch_size_fail_threshold_in_kb=50; batch_size_warn_threshold_in_kb=5; 
batchlog_replay_throttle_in_kb=1024; cas_contention_timeout_in_ms=1000; 
client_encryption_options=; cluster_name=Test Cluster; 
column_index_size_in_kb=64; commit_failure_policy=stop; 
commitlog_segment_size_in_mb=32; commitlog_sync=periodic; 
commitlog_sync_period_in_ms=1; compaction_throughput_mb_per_sec=16; 
concurrent_counter_writes=32; concurrent_reads=32; concurrent_writes=32; 
counter_cache_save_period=7200; counter_cache_size_in_mb=null; 
counter_write_request_timeout_in_ms=5000; cross_node_timeout=false; 
disk_failure_policy=stop; dynamic_snitch_badness_threshold=0.1; 
dynamic_snitch_reset_interval_in_ms=60; 
dynamic_snitch_update_interval_in_ms=100; endpoint_snitch=SimpleSnitch; 
hinted_handoff_enabled=true; hinted_handoff_throttle_in_kb=1024; 
incremental_backups=false; index_summary_capacity_in_mb=null; 
index_summary_resize_interval_in_minutes=60; inter_dc_tcp_nodelay=false; 
internode_compression=all; key_cache_save_period=14400; 
key_cache_size_in_mb=null; listen_address=localhost; 
max_hint_window_in_ms=1080; max_hints_delivery_threads=2; 
memtable_allocation_type=heap_buffers; native_transport_port=9042; 
num_tokens=256; partitioner=org.apache.cassandra.dht.Murmur3Partitioner; 
permissions_validity_in_ms=2000; range_request_timeout_in_ms=1; 
read_request_timeout_in_ms=5000; 
request_scheduler=org.apache.cassandra.scheduler.NoScheduler; 
request_timeout_in_ms=1; row_cache_save_period=0; row_cache_size_in_mb=0; 
rpc_address=localhost; rpc_keepalive=true; rpc_port=9160; rpc_server_type=sync; 
seed_provider=[{class_name=org.apache.cassandra.locator.SimpleSeedProvider, 
parameters=[{seeds=127.0.0.1}]}]; server_encryption_options=; 
snapshot_before_compaction=false; ssl_storage_port=7001; 
sstable_preemptive_open_interval_in_mb=50; start_native_transport=true; 
start_rpc=true; storage_port=7000; thrift_framed_transport_size_in_mb=15; 
tombstone_failure_threshold=10; tombstone_warn_threshold=1000; 
trickle_fsync=false; trickle_fsync_interval_in_kb=10240; 
truncate_request_timeout_in_ms=6; write_request_timeout_in_ms=2000]
INFO  20:34:20 DiskAccessMode 'auto' determined to be mmap, indexAccessMode is 
mmap
INFO  20:34:20 Global memtable on-heap threshold is enabled at 499MB
INFO  20:34:20 Global memtable off-heap threshold is enabled at 499MB
WARN  20:34:20 Couldn't open /proc/stats
INFO  20:34:20 Loading settings from 
file:/Users/RajT/cassandra-source/cassandra-trunk/conf/cassandra.yaml
INFO  20:34:20 Node configuration:[authenticator=AllowAllAuthenticator; 
authorizer=AllowAllAuthorizer; auto_snapshot=true; 
batch_size_fail_threshold_in_kb=50; batch_size_warn_threshold_in_kb=5; 
batchlog_replay_throttle_in_kb=1024; cas_contention_timeout_in_ms=1000; 
client_encryption_options=; cluster_name=Test Cluster; 
column_index_size_in_kb=64; commit_failure_policy

Re: Latest Code from Trunk - Server is not starting

2014-11-18 Thread Yuki Morishita
Clear your './bin/../data/data' directory, and cassandra will start up fine.

On Tue, Nov 18, 2014 at 2:43 PM, Rajanarayanan Thottuvaikkatumana
 wrote:
> I have taken the latest code from trunk, compiled (I have some changes in 
> some of the local files also). But when I start the Cassandra server, I am 
> getting exceptions. The exceptions are not seeming to be from the classed 
> where I changed OR has any relationship with the ones that are showing error. 
> Any idea? Anybody else is getting same error?
>
> Rajanarayanans-MacBook-Pro:cassandra-trunk RajT$ ./bin/cassandra -f
> objc[4284]: Class JavaLaunchHelper is implemented in both 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib.
>  One of the two will be used. Which one is undefined.
> CompilerOracle: inline org/apache/cassandra/db/AbstractNativeCell.compareTo 
> (Lorg/apache/cassandra/db/composites/Composite;)I
> CompilerOracle: inline 
> org/apache/cassandra/db/composites/AbstractSimpleCellNameType.compareUnsigned 
> (Lorg/apache/cassandra/db/composites/Composite;Lorg/apache/cassandra/db/composites/Composite;)I
> CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare 
> (Ljava/nio/ByteBuffer;[B)I
> CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare 
> ([BLjava/nio/ByteBuffer;)I
> CompilerOracle: inline 
> org/apache/cassandra/utils/ByteBufferUtil.compareUnsigned 
> (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
> CompilerOracle: inline 
> org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
> (Ljava/lang/Object;JILjava/lang/Object;JI)I
> CompilerOracle: inline 
> org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
> (Ljava/lang/Object;JILjava/nio/ByteBuffer;)I
> CompilerOracle: inline 
> org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
> (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
> INFO  20:34:19 Hostname: Rajanarayanans-MacBook-Pro.local
> INFO  20:34:19 Loading settings from 
> file:/Users/RajT/cassandra-source/cassandra-trunk/conf/cassandra.yaml
> INFO  20:34:19 Node configuration:[authenticator=AllowAllAuthenticator; 
> authorizer=AllowAllAuthorizer; auto_snapshot=true; 
> batch_size_fail_threshold_in_kb=50; batch_size_warn_threshold_in_kb=5; 
> batchlog_replay_throttle_in_kb=1024; cas_contention_timeout_in_ms=1000; 
> client_encryption_options=; cluster_name=Test Cluster; 
> column_index_size_in_kb=64; commit_failure_policy=stop; 
> commitlog_segment_size_in_mb=32; commitlog_sync=periodic; 
> commitlog_sync_period_in_ms=1; compaction_throughput_mb_per_sec=16; 
> concurrent_counter_writes=32; concurrent_reads=32; concurrent_writes=32; 
> counter_cache_save_period=7200; counter_cache_size_in_mb=null; 
> counter_write_request_timeout_in_ms=5000; cross_node_timeout=false; 
> disk_failure_policy=stop; dynamic_snitch_badness_threshold=0.1; 
> dynamic_snitch_reset_interval_in_ms=60; 
> dynamic_snitch_update_interval_in_ms=100; endpoint_snitch=SimpleSnitch; 
> hinted_handoff_enabled=true; hinted_handoff_throttle_in_kb=1024; 
> incremental_backups=false; index_summary_capacity_in_mb=null; 
> index_summary_resize_interval_in_minutes=60; inter_dc_tcp_nodelay=false; 
> internode_compression=all; key_cache_save_period=14400; 
> key_cache_size_in_mb=null; listen_address=localhost; 
> max_hint_window_in_ms=1080; max_hints_delivery_threads=2; 
> memtable_allocation_type=heap_buffers; native_transport_port=9042; 
> num_tokens=256; partitioner=org.apache.cassandra.dht.Murmur3Partitioner; 
> permissions_validity_in_ms=2000; range_request_timeout_in_ms=1; 
> read_request_timeout_in_ms=5000; 
> request_scheduler=org.apache.cassandra.scheduler.NoScheduler; 
> request_timeout_in_ms=1; row_cache_save_period=0; row_cache_size_in_mb=0; 
> rpc_address=localhost; rpc_keepalive=true; rpc_port=9160; 
> rpc_server_type=sync; 
> seed_provider=[{class_name=org.apache.cassandra.locator.SimpleSeedProvider, 
> parameters=[{seeds=127.0.0.1}]}]; server_encryption_options=; 
> snapshot_before_compaction=false; ssl_storage_port=7001; 
> sstable_preemptive_open_interval_in_mb=50; start_native_transport=true; 
> start_rpc=true; storage_port=7000; thrift_framed_transport_size_in_mb=15; 
> tombstone_failure_threshold=10; tombstone_warn_threshold=1000; 
> trickle_fsync=false; trickle_fsync_interval_in_kb=10240; 
> truncate_request_timeout_in_ms=6; write_request_timeout_in_ms=2000]
> INFO  20:34:20 DiskAccessMode 'auto' determined to be mmap, indexAccessMode 
> is mmap
> INFO  20:34:20 Global memtable on-heap threshold is enabled at 499MB
> INFO  20:34:20 Global memtable off-heap threshold is enabled at 499MB
> WARN  20:34:20 Couldn't open /proc/stats
> INFO  20:34:20 Loading settings from 
> file:/Users/RajT/cassandra-source/cassandra-trunk/conf/cassandra.yaml
> INFO  20:34:20 Node configuration:[authenticator=AllowAllAuthentic

Re: Latest Code from Trunk - Server is not starting

2014-11-18 Thread Robert Stupp
Try to clear the data + commitlog directory.
At least the primary key for system.schema_functions table has changed in an 
incompatible way.


> Am 18.11.2014 um 21:43 schrieb Rajanarayanan Thottuvaikkatumana 
> :
> 
> I have taken the latest code from trunk, compiled (I have some changes in 
> some of the local files also). But when I start the Cassandra server, I am 
> getting exceptions. The exceptions are not seeming to be from the classed 
> where I changed OR has any relationship with the ones that are showing error. 
> Any idea? Anybody else is getting same error? 
> 
> Rajanarayanans-MacBook-Pro:cassandra-trunk RajT$ ./bin/cassandra -f
> objc[4284]: Class JavaLaunchHelper is implemented in both 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib.
>  One of the two will be used. Which one is undefined.
> INFO  20:34:21 reading saved cache 
> ./bin/../data/saved_caches/system-local-7ad54392bcdd35a684174e047860b377-KeyCache-b.db
> ERROR 20:34:21 Exception encountered during startup
> java.lang.RuntimeException: java.lang.ClassCastException: 
> org.apache.cassandra.db.composites.CompoundComposite cannot be cast to 
> org.apache.cassandra.db.composites.CellName
>   at org.apache.cassandra.config.Schema.updateVersion(Schema.java:373) 
> ~[main/:na]
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.loadSchemas(DatabaseDescriptor.java:643)
>  ~[main/:na]
>   at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:257) 
> [main/:na]
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:482)
>  [main/:na]
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:574) 
> [main/:na]
> Caused by: java.lang.ClassCastException: 
> org.apache.cassandra.db.composites.CompoundComposite cannot be cast to 
> org.apache.cassandra.db.composites.CellName
>   at 
> org.apache.cassandra.db.OnDiskAtom$Serializer.deserializeFromSSTable(OnDiskAtom.java:87)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.AbstractCell$1.computeNext(AbstractCell.java:53) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.AbstractCell$1.computeNext(AbstractCell.java:47) 
> ~[main/:na]
>   at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>  ~[guava-16.0.jar:na]
>   at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) 
> ~[guava-16.0.jar:na]
>   at 
> org.apache.cassandra.io.sstable.SSTableIdentityIterator.hasNext(SSTableIdentityIterator.java:115)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.filter.QueryFilter$2.getNext(QueryFilter.java:172) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.filter.QueryFilter$2.hasNext(QueryFilter.java:155) 
> ~[main/:na]
>   at 
> org.apache.cassandra.utils.MergeIterator$Candidate.advance(MergeIterator.java:146)
>  ~[main/:na]
>   at 
> org.apache.cassandra.utils.MergeIterator$ManyToOne.(MergeIterator.java:89)
>  ~[main/:na]
>   at org.apache.cassandra.utils.MergeIterator.get(MergeIterator.java:48) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.filter.QueryFilter.collateColumns(QueryFilter.java:103)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.filter.QueryFilter.collateOnDiskAtom(QueryFilter.java:81)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.RowIteratorFactory$2.getReduced(RowIteratorFactory.java:99)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.RowIteratorFactory$2.getReduced(RowIteratorFactory.java:71)
>  ~[main/:na]
>   at 
> org.apache.cassandra.utils.MergeIterator$ManyToOne.consume(MergeIterator.java:117)
>  ~[main/:na]
>   at 
> org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext(MergeIterator.java:100)
>  ~[main/:na]
>   at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>  ~[guava-16.0.jar:na]
>   at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) 
> ~[guava-16.0.jar:na]
>   at 
> org.apache.cassandra.db.ColumnFamilyStore$8.computeNext(ColumnFamilyStore.java:1931)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.ColumnFamilyStore$8.computeNext(ColumnFamilyStore.java:1927)
>  ~[main/:na]
>   at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>  ~[guava-16.0.jar:na]
>   at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) 
> ~[guava-16.0.jar:na]
>   at 
> org.apache.cassandra.db.ColumnFamilyStore.filter(ColumnFamilyStore.java:2079) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:2038)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:1972)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.SystemKeyspace.serializedSchema(System

Re: Latest Code from Trunk - Server is not starting

2014-11-18 Thread Rajanarayanan Thottuvaikkatumana
Thanks a lot. It worked. Thanks
-Raj
On 18-Nov-2014, at 9:00 pm, Yuki Morishita  wrote:

> Clear your './bin/../data/data' directory, and cassandra will start up fine.
> 
> On Tue, Nov 18, 2014 at 2:43 PM, Rajanarayanan Thottuvaikkatumana
>  wrote:
>> I have taken the latest code from trunk, compiled (I have some changes in 
>> some of the local files also). But when I start the Cassandra server, I am 
>> getting exceptions. The exceptions are not seeming to be from the classed 
>> where I changed OR has any relationship with the ones that are showing 
>> error. Any idea? Anybody else is getting same error?
>> 
>> Rajanarayanans-MacBook-Pro:cassandra-trunk RajT$ ./bin/cassandra -f
>> objc[4284]: Class JavaLaunchHelper is implemented in both 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib.
>>  One of the two will be used. Which one is undefined.
>> CompilerOracle: inline org/apache/cassandra/db/AbstractNativeCell.compareTo 
>> (Lorg/apache/cassandra/db/composites/Composite;)I
>> CompilerOracle: inline 
>> org/apache/cassandra/db/composites/AbstractSimpleCellNameType.compareUnsigned
>>  
>> (Lorg/apache/cassandra/db/composites/Composite;Lorg/apache/cassandra/db/composites/Composite;)I
>> CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare 
>> (Ljava/nio/ByteBuffer;[B)I
>> CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare 
>> ([BLjava/nio/ByteBuffer;)I
>> CompilerOracle: inline 
>> org/apache/cassandra/utils/ByteBufferUtil.compareUnsigned 
>> (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
>> CompilerOracle: inline 
>> org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
>> (Ljava/lang/Object;JILjava/lang/Object;JI)I
>> CompilerOracle: inline 
>> org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
>> (Ljava/lang/Object;JILjava/nio/ByteBuffer;)I
>> CompilerOracle: inline 
>> org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo 
>> (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
>> INFO  20:34:19 Hostname: Rajanarayanans-MacBook-Pro.local
>> INFO  20:34:19 Loading settings from 
>> file:/Users/RajT/cassandra-source/cassandra-trunk/conf/cassandra.yaml
>> INFO  20:34:19 Node configuration:[authenticator=AllowAllAuthenticator; 
>> authorizer=AllowAllAuthorizer; auto_snapshot=true; 
>> batch_size_fail_threshold_in_kb=50; batch_size_warn_threshold_in_kb=5; 
>> batchlog_replay_throttle_in_kb=1024; cas_contention_timeout_in_ms=1000; 
>> client_encryption_options=; cluster_name=Test Cluster; 
>> column_index_size_in_kb=64; commit_failure_policy=stop; 
>> commitlog_segment_size_in_mb=32; commitlog_sync=periodic; 
>> commitlog_sync_period_in_ms=1; compaction_throughput_mb_per_sec=16; 
>> concurrent_counter_writes=32; concurrent_reads=32; concurrent_writes=32; 
>> counter_cache_save_period=7200; counter_cache_size_in_mb=null; 
>> counter_write_request_timeout_in_ms=5000; cross_node_timeout=false; 
>> disk_failure_policy=stop; dynamic_snitch_badness_threshold=0.1; 
>> dynamic_snitch_reset_interval_in_ms=60; 
>> dynamic_snitch_update_interval_in_ms=100; endpoint_snitch=SimpleSnitch; 
>> hinted_handoff_enabled=true; hinted_handoff_throttle_in_kb=1024; 
>> incremental_backups=false; index_summary_capacity_in_mb=null; 
>> index_summary_resize_interval_in_minutes=60; inter_dc_tcp_nodelay=false; 
>> internode_compression=all; key_cache_save_period=14400; 
>> key_cache_size_in_mb=null; listen_address=localhost; 
>> max_hint_window_in_ms=1080; max_hints_delivery_threads=2; 
>> memtable_allocation_type=heap_buffers; native_transport_port=9042; 
>> num_tokens=256; partitioner=org.apache.cassandra.dht.Murmur3Partitioner; 
>> permissions_validity_in_ms=2000; range_request_timeout_in_ms=1; 
>> read_request_timeout_in_ms=5000; 
>> request_scheduler=org.apache.cassandra.scheduler.NoScheduler; 
>> request_timeout_in_ms=1; row_cache_save_period=0; 
>> row_cache_size_in_mb=0; rpc_address=localhost; rpc_keepalive=true; 
>> rpc_port=9160; rpc_server_type=sync; 
>> seed_provider=[{class_name=org.apache.cassandra.locator.SimpleSeedProvider, 
>> parameters=[{seeds=127.0.0.1}]}]; server_encryption_options=; 
>> snapshot_before_compaction=false; ssl_storage_port=7001; 
>> sstable_preemptive_open_interval_in_mb=50; start_native_transport=true; 
>> start_rpc=true; storage_port=7000; thrift_framed_transport_size_in_mb=15; 
>> tombstone_failure_threshold=10; tombstone_warn_threshold=1000; 
>> trickle_fsync=false; trickle_fsync_interval_in_kb=10240; 
>> truncate_request_timeout_in_ms=6; write_request_timeout_in_ms=2000]
>> INFO  20:34:20 DiskAccessMode 'auto' determined to be mmap, indexAccessMode 
>> is mmap
>> INFO  20:34:20 Global memtable on-heap threshold is enabled at 499MB
>> INFO  20:34:20 Global memtable off-heap threshold is enabled at 499MB
>> WARN  20:34:20 Couldn't open /proc/stats
>>

Re: Reads requiring response from both servers.

2014-11-18 Thread Tyler Hobbs
On Tue, Nov 18, 2014 at 1:57 PM, Jacob Rhoden  wrote:

>
>
> If there are two nodes and RF=2, a simple data lookup on a very small
> table will only need to talk to one node if you put in a (fake/pointless)
> partition key, but two nodes if you don't. The impact is that if you want
> 1ms query time on a 50 row table you must use a partition key, otherwise
> you get 250ms query time.
>

A query that's restricted to a single partition key is fundamentally
different from an unrestricted table scan (Cassandra doesn't know that you
only have one partition).  So seeing a performance difference between the
two is not unexpected.

However, there were some semi-recent changes that improved the likelihood
that neighboring range scans will be merged if one node is a replica for
both ranges: CASSANDRA-6465 and CASSANDRA-7535.  In your case, all of the
ranges could potentially be merged to form a single range scan.  If you're
seeing this behavior on Cassandra 2.0.10+, it *may* be a bug.


>
>
> >> Why is this a bug? It seems that this behaviour of needing a response to
> >> both nodes only exists if you don’t query with a clustering key, or a
> key
> >> when RF=2. However you can change this behaviour, by, for example,
> changing
> >> the table from “primary key (uuid)” to “primary key ((a), uuid)” where
> the
> >> value of a always equals “a” ( so you can query 'where a=“a”’), at which
> >> point, cassandra decides it only needs results from one node.
> >
> > Can you clarify what you mean?  It sounds like you're saying "if I
> specify
> > a partition key, it only needs to query one node", which is also expected
> > behavior (assuming a consistency level of ONE).
>
> It's my understanding from the documentation that consistency level one
> (which I am using) is about write consistency, not read consistency.
> Actually if I change it in cqlsh, cqlsh refuses to run the query.
>

The consistency level matters for both reads and writes.


-- 
Tyler Hobbs
DataStax