cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Capriolo <>
Subject Re: Determining if data will be created on Cassandra Write Exceptions
Date Tue, 14 Feb 2017 20:49:32 GMT
On Tue, Feb 14, 2017 at 2:30 PM, rouble <> wrote:

> Cassandra Gurus,
> I have a question open on stackoverlow on how to determine if data is
> actually created when a Write exception is thrown: http://stackoverflow.c
> om/questions/42231140/determining-if-data-will-be-created-
> on-cassandra-write-exceptions
> From my discussion on the question, it seems that on *any* Cassandra
> write, *any* exception, means the data may or may not be written. With the
> exception of InvalidQueryException.
> I find this unsettling. Maybe I need time to adjust from my RDBMS
> background, but how is Cassandra supposed to be used for systems that need
> user feedback? or is it?
> Let me use the simple example of account creation. User tries to create an
> account, and we need to indicate one way or the other whether the account
> was created. Lets say a WriteTimeoutException is thrown while trying to add
> the user. User may or may not be written, what do we tell the user? Should
> we just rollback the change and tell the user that it failed. This seems
> like the only thing we can do deterministically (and I notice someone doing
> just that here:
> How are people handling WriteTimeoutExceptions or UnavailableExceptions?
> Rolling back in every case does not seem practical.
> tia,
> Rouble

There is a difference between WriteTimeoutException and

UnavailableException indicates the write was never even attempted.

WriteTimeoutException means the write was attempted. I believe you can
interrogate the exception to determine if the operation was successful on
any of the natural endpoints.

The way to "cope" is idempotent writes and retries.  If that model does not
fit it is a square peg round hole discussion.

View raw message