You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Boris Shulman <sh...@gmail.com> on 2010/04/29 15:01:06 UTC

atomicity of writes

Hi,
I've noticed that the writing commit log is performed for a 'row',
i.e. list of ColumnFamilies for a key in: 'public
CommitLogSegment.CommitLogContext write(RowMutation rowMutation,
Object serializedRow).'
Does that mean that writes are atomic for a row and not for a CF? What
will happen if a failure will occur after writing the headers but
before writing the data & checksum? What will happen if the failure
will occur after writing the data but before the checksum? Is the
write op considered committed  only after checksum is written?

Re: atomicity of writes

Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Apr 29, 2010 at 8:01 AM, Boris Shulman <sh...@gmail.com> wrote:
> Hi,
> I've noticed that the writing commit log is performed for a 'row',
> i.e. list of ColumnFamilies for a key in: 'public
> CommitLogSegment.CommitLogContext write(RowMutation rowMutation,
> Object serializedRow).'
> Does that mean that writes are atomic for a row and not for a CF?

Yes.

> What
> will happen if a failure will occur after writing the headers but
> before writing the data & checksum?

Headers are only written after flush, so the question doesn't make sense.

> What will happen if the failure
> will occur after writing the data but before the checksum? Is the
> write op considered committed  only after checksum is written?

Yes.

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com