Cassandra CQL: different SELECT results
I am using the latest Cassandra 2.1.0 and have different results for the following queries.
select * from zzz.contact where user_id = 53528c87-0691-46f7-81a1-77173fd8390f
and contact_id = 5ea82764-ce42-45f3-8724-e121c8b7d32e;
returns me one canceled entry, but
select * from zzz.contact where user_id = 53528c87-0691-46f7-81a1-77173fd8390f;
returns 6 other rows besides the row returned by the first SELECT.
Key space / table structure:
CREATE KEYSPACE zzz
WITH replication = { 'class' : 'NetworkTopologyStrategy', 'DC1' : '2' };
CREATE TABLE IF NOT EXISTS contact (
user_id uuid,
contact_id uuid,
approved boolean,
ignored boolean,
adding_initiator boolean,
PRIMARY KEY ( user_id, contact_id )
);
Both instances are in keyspace and UN
d:\Tools\apache-cassandra-2.1.0\bin>nodetool status
Starting NodeTool
Note: Ownership information does not include topology; for complete information, specify a keyspace
Datacenter: DC1
================
Status=Up/Down|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns Host ID Rack
UN 192.168.0.146 135.83 KB 256 51.7% 6d035991-3471-498b-8051-55f99a2fdfed RAC1
UN 192.168.0.216 3.26 MB 256 48.3% d82f3a69-c6f8-4237-b50e-d2f370ac644a RAC1
I have two instances of Cassandra.
Trial command "repair nodetool" - didn't help.
Tried adding ALLOW FILTERING at the end of the queries - it didn't help.
Any help is appreciated.
UPD : here is the query result:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
d:\Tools\apache-cassandra-2.1.0\bin>cqlsh 192.168.0.216
Connected to ClusterZzz at 192.168.0.216:9042.
[cqlsh 5.0.1 | Cassandra 2.1.0 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> select * from zzz.contact where user_id = 53528c87-0691-46f7-81a1-77173fd8390f and contact_id = 5ea82764-ce42-45f3-8724-e121c8b7d32e;
user_id | contact_id | adding_initiator | approved | ignored
--------------------------------------+--------------------------------------+------------------+----------+---------
53528c87-0691-46f7-81a1-77173fd8390f | 5ea82764-ce42-45f3-8724-e121c8b7d32e | False | True | False
(1 rows)
cqlsh> select * from zzz.contact where user_id = 53528c87-0691-46f7-81a1-77173fd8390f;
user_id | contact_id | adding_initiator | approved | ignored
--------------------------------------+--------------------------------------+------------------+----------+---------
53528c87-0691-46f7-81a1-77173fd8390f | 6fc7f6e4-ac48-484e-9660-128476ca5bf9 | False | False | False
53528c87-0691-46f7-81a1-77173fd8390f | 7a240937-8b28-4424-9772-8c4c8e381432 | False | False | False
53528c87-0691-46f7-81a1-77173fd8390f | 8e6cb13a-96e7-45af-b9d8-40ea459df996 | False | False | False
53528c87-0691-46f7-81a1-77173fd8390f | 938af09a-0fe3-4cdd-b02e-cbdfb078335c | False | True | False
53528c87-0691-46f7-81a1-77173fd8390f | d84d9e7a-e81d-42a2-87b3-f163f7a9a646 | False | True | False
53528c87-0691-46f7-81a1-77173fd8390f | fd2ec705-1661-4cf8-98ef-46f627a9a382 | False | False | False
(6 rows)
cqlsh>
UPD # 2: It's worth mentioning that my nodes are on windows7 machines. We use Linux in production, so there were no problems like me with Windows nodes.
+3
source to share
No one has answered this question yet
Check out similar questions: