Re: Lightweight Transactions during datacenter outage

2016-06-08 Thread Romain Hardouin
> Would you know why the driver doesn't automatically change to LOCAL_SERIAL > during a DC outage ? I would say because *you* decide, not the driver ;-) This kind of fallback could be achieved with a custom downgrading policy (DowngradingConsistencyRetryPolicy [*] doesn't handle

Re: Lightweight Transactions during datacenter outage

2016-06-08 Thread Jeronimo de A. Barros
Tyler, Thank you, it's working now: self.query['online'] = SimpleStatement("UPDATE table USING ttl %s SET l = True WHERE k2 = %s IF l = False;", consistency_level=ConsistencyLevel.LOCAL_QUORUM, serial_consistency_level=ConsistencyLevel.LOCAL_SERIAL) Would you know why the driver doesn't

Re: Lightweight Transactions during datacenter outage

2016-06-07 Thread Tyler Hobbs
You can set the serial_consistency_level to LOCAL_SERIAL to tolerate a DC failure: http://datastax.github.io/python-driver/api/cassandra/query.html#cassandra.query.Statement.serial_consistency_level. It defaults to SERIAL, which ignores DCs. On Tue, Jun 7, 2016 at 12:26 PM, Jeronimo de A. Barros

Lightweight Transactions during datacenter outage

2016-06-07 Thread Jeronimo de A. Barros
Hi, I have a cluster spreaded among 2 datacenters (DC1 and DC2), two server on each DC and I have a keyspace with NetworkTopologyStrategy (DC1:2 and DC2:2) with the following table: CREATE TABLE test ( k1 int, k2 timeuuid, PRIMARY KEY ((k1), k2) ) WITH CLUSTERING ORDER BY (k2 DESC) During