Search code examples
nosqlcassandrasql-updatephpcassa

Cassandra doesn't update (after some time?)


Very weird problem, some RowKeys looks like they are getting 'locked' after some time. First they are created fine, i can update them for some time. Then after some time updates aren't working anymore but i can still update fresh created keys fine.

Anyone an idea?, phpcassa is screwing with me or cassandra?


Solution

  • Have you checked the timestamps you are using when writing to cassandra?

    The client specifies a timestamp for each column you write to cassandra. Some portion of your code could have a bug where it is setting the timestamps incorrectly, leading to updates getting dropped.

    In general, it's also worth making sure different clients are using the same timestamp granularity. The standard is microseconds-since-epoch, so if you were to use something that uses milliseconds-since-epoch it won't be able to overwrite data created with the larger timestamp numbers. In this case, both phpcassa and the cassandra cli conform to the standard so unless you are using a 3rd tool that you didn't mention that should be fine.