You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Mohica Jasha <mo...@gmail.com> on 2014/04/23 17:08:30 UTC

Cassandra hopefully durable writes (commitlog_sync)

There is a discrepancy between the two documentation:

http://wiki.apache.org/cassandra/Durability

Cassandra's default configuration sets the commitlog_sync mode to periodic,
> causing the commitlog to be synced every commitlog_sync_period_in_ms milliseconds,
> so you can potentially lose up to that much data if all replicas crash
> within that window of time.
>


http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_durability_c.html

Writes in Cassandra are durable. All writes to a replica node are recorded
> both in memory and in a commit log on disk before they are acknowledged as
> a success. If a crash or server failure occurs before the memory tables are
> flushed to disk, the commit log is replayed on restart to recover any lost
> writes.
>

I wonder which is correct?
Does Cassandra (default configuration) wait till it persists the update to
its commit log before it acks back the write? or doesn't it?

I wonder what happens if due to power outage all replicas die at the same
time? Can such a power outage cause writes kept in memory within that 10
second window to be lost?


Mohica

Re: Cassandra hopefully durable writes (commitlog_sync)

Posted by Robert Coli <rc...@eventbrite.com>.
On Wed, Apr 23, 2014 at 8:08 AM, Mohica Jasha <mo...@gmail.com>wrote:

> I wonder which is correct?
> Does Cassandra (default configuration) wait till it persists the update to
> its commit log before it acks back the write? or doesn't it?
>
> I wonder what happens if due to power outage all replicas die at the same
> time? Can such a power outage cause writes kept in memory within that 10
> second window to be lost?
>

Yes. Unless you set Cassandra to operate with a batch commit log that
doesn't ack until fsync after every batch of writes, you can lose
un-fsynced data from the commitlog. As an additional wrinkle, in 2.0 the
behavior is slightly different from the expectation from the documentation,
as of 2.1 it behaves as one would expect from the documentation of "batch".

https://issues.apache.org/jira/browse/CASSANDRA-3578

Is an issue related to the changes in this behavior, but per belliotsmith
he's not sure if this is where it's fully discussed.

=Rob
PS - I have bcc:ed docs AT datastax for their information; in general they
are quite responsive to requests of this nature, they value correctness and
clarity in their docs. :D