incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ackerman, Mitchell" <>
Subject INSERT ... IF NOT EXISTS with some nodes unavailable
Date Tue, 03 Jun 2014 03:09:37 GMT
Hi, I'm trying to get a query using

               INSERT ... IF NOT EXISTS

working when not all of the nodes are available.  As a test case I have 2 nodes, one in AWS
us-west-1, another in AWS eu-west-1.  The keyspace settings are described below.  When I only
have one of the nodes available, the insert fails with an UnavaliableException (via TokenRangeOfflineException,
see below for details).

>From reading about the lightweight transactions (
and the CQL expression, it looks like this scenario should be supported. Does anyone have
any idea why it is not working?

You will notice that I'm using Astyanax, could this be a source of problems for this use case?

I presume that a Consistency Level of Serial is in use and that a quorum of 1 should suffice
for a 2 node cache.

Thanks, Mitchell


replica_placement_strategy         org.apache.cassandra.locator.NetworkTopologyStrategy
Replication Strategy Options
us-west                1
eu-west               1

CREATE TABLE conferenceassignmentcache.conferenceassignmentcache_cf (
  id text PRIMARY KEY,
  value text
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

When I try to INSERT a row with only one node available I get the following exception:

2014-06-02 20:57:59,947 [eventTaskExecutor-15] DEBUG [CassandraConferenceAssignmentManager.getInsertStatement()
53] - INSERT INTO conferenceassignmentcache_cf (id, value) VALUES (?, ?) IF NOT EXISTS USING
TTL 60;
2014-06-02 20:58:00,084 [eventTaskExecutor-15] DEBUG [ThriftConverter.ToConnectionPoolException()
157] -
2014-06-02 20:58:00,086 [eventTaskExecutor-15] ERROR [CountingConnectionPoolMonitor.trackError()
94] - TokenRangeOfflineException:
[, latency=137(137), attempts=1]UnavailableException() TokenRangeOfflineException:
[, latency=137(137), attempts=1]UnavailableException()

Caused by: UnavailableException()
       at org.apache.cassandra.thrift.Cassandra$
       at org.apache.thrift.TServiceClient.receiveBase(
       at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_prepared_cql3_query(
       at org.apache.cassandra.thrift.Cassandra$Client.execute_prepared_cql3_query(
       ... 35 more

View raw message