On Sun, Aug 21, 2011 at 2:21 PM, aaron morton <*****@thelastpickle.com> wrote: >> I am wondering if TTL values also follow gc_grace? > They are purged by the first compaction that processes them after TTL has > expired. The TTL expiry is used the same way as the expire on a Tombstone. > > Thinking out loud, is this possible…. > > t0 - write col to all 3 replicas. > t1 - overwrite col with a ttl, write to 2 out of 3 replicas. > t2 - compaction on all nodes, col removed from 2 out of 3 replicas > t3 - read at QUORUM, col written in t0 returns. >
That was the same case I was thinking about. If that case works properly in cassandra, any value with TTL would also get a tombstone marker. The value would be cleared after timestamp + TTL + gc_grace. But if I make sure TTL is always used (enforced in the model layer of my application), gc_grace=0 would be safe? > ExpiringColumn sets it localDeletionTime using the ttl, and > cfs.removeDeletedStandard() will purge the column. > >> The mutation against Column Family "CF_B" is placed last. >> If: >> get CF_B[def] is 55 >> Can I then safely assume that >> get CF_A[abc] is 10 OR a newer value > The order the changes are applied is undefined (they are pulled from the > values of a HashMap). So this should not be relied upon. Ok, thanks > Cheers > > > ----------------- > Aaron Morton > Freelance Cassandra Developer > @aaronmorton > http://www.thelastpickle.com > > On 21/08/2011, at 11:38 PM, Joris van der Wel wrote: > >> Hello, >> >> I have a ColumnFamily in which all columns are always set with a TTL, >> this would be one of the hottest column families (rows_cached is set >> to 1.0). I am wondering if TTL values also follow gc_grace? If they >> do, am I correct in thinking it would be best to set gc_grace really >> low in this case? (zero?) >> >> Another question: >> For a single key I have data in ColumnFamily "CF_A" and ColumnFamily >> "CF_B". I set their data in one thrift "batch_mutate". >> If I understood correctly, atomicity is then guaranteed (if one >> mutation fails, they all fail). But isolation is not. However if for >> example the following Mutation takes place: >> >> batch_mutate({ >> "mykey": { >> "CF_A": [ >> Mutation { >> column_or_supercolumn: ColumnOrSuperColumn { >> column: { >> name: "abc", >> value: 10, >> timestamp: 1313918714729 >> } >> } >> } >> ], >> "CF_B": [ >> Mutation { >> column_or_supercolumn: ColumnOrSuperColumn { >> column: { >> name: "def", >> value: 55, >> timestamp: 1313918714730 >> } >> } >> }, >> ] >> } >> }, QUORUM) >> >> The mutation against Column Family "CF_B" is placed last. >> If: >> get CF_B[def] is 55 >> Can I then safely assume that >> get CF_A[abc] is 10 OR a newer value >> >> >> Thanks, >> Gr. Joris > >
