You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by yh...@sina.com on 2015/01/07 03:19:33 UTC

转发:Re: Is it possible to implement a interface to replace a row in cassandra using cassandra.thrift?

Hi, 
I found that in my function, both delete and update  use the client side timestamp.The update timestamp should  be always bigger than the deletion timestamp.
I wonder why the update failed in some cases?
thank you.

----- 原始邮件 -----
发件人:Ryan Svihla <rs...@foundev.pro>
收件人:user@cassandra.apache.org, yhqruc@sina.com
主题:Re: Is it possible to implement a interface to replace a row in cassandra using cassandra.thrift?
日期:2015年01月06日 23点34分

replies inline
On Tue, Jan 6, 2015 at 2:28 AM,  <yh...@sina.com> wrote:
Hi, all:    I use cassandra.thrift to implement a replace row interface in this way:    First use batch_mutate to delete that row, then use batch_mutate to insert a new row.    I always find that after call this interface, the row is not exist.
    Then I doubt that it is the problem caused by the deletion, because the deleteion has a timestamp set by the client.    Maybe the time is not so sync between the client and cassandra server (1 or more seconds diff).
It's a distributed database so time synchronization really really matters so use NTP, however if you're using client side timestamps on both the insert and the delete it's not going to matter for that use case

    How to solve this?? Is it possible to implement a  interface to replace a row in cassandra.???\
yeah all updates are this way. Inserts are actually "UPSERTS" and you can go ahead and do two updates instead of insert, delete, update. 

Thanks.


-- 
Thanks,Ryan Svihla



Re: Re: Is it possible to implement a interface to replace a row in cassandra using cassandra.thrift?

Posted by Ryan Svihla <rs...@foundev.pro>.
really depends on your code for error handling, and since you're using
thrift it really depends on the client, if you're doing client side
timestamps then it's not related to time issues.

On Tue, Jan 6, 2015 at 8:19 PM, <yh...@sina.com> wrote:

> Hi,
>
> I found that in my function, both delete and update  use the client side
> timestamp.
>
> The update timestamp should  be always bigger than the deletion timestamp.
>
>
> I wonder why the update failed in some cases?
>
>
> thank you.
>
>
> ----- 原始邮件 -----
> 发件人:Ryan Svihla <rs...@foundev.pro>
> 收件人:user@cassandra.apache.org, yhqruc@sina.com
> 主题:Re: Is it possible to implement a interface to replace a row in
> cassandra using cassandra.thrift?
> 日期:2015年01月06日 23点34分
>
> replies inline
>
> On Tue, Jan 6, 2015 at 2:28 AM, <yh...@sina.com> wrote:
>
> Hi, all:
>
>     I use cassandra.thrift to implement a replace row interface in this
> way:
>
>     First use batch_mutate to delete that row, then use batch_mutate to
> insert a new row.
>
>     I always find that after call this interface, the row is not exist.
>
>
>     Then I doubt that it is the problem caused by the deletion, because
> the deleteion has a timestamp set by the client.
>
>     Maybe the time is not so sync between the client and cassandra server
> (1 or more seconds diff).
>
>
> It's a distributed database so time synchronization really really matters
> so use NTP, however if you're using client side timestamps on both the
> insert and the delete it's not going to matter for that use case
>
>
>
>     How to solve this?? Is it possible to implement a  interface to
> replace a row in cassandra.???\
>
>
> yeah all updates are this way. Inserts are actually "UPSERTS" and you can
> go ahead and do two updates instead of insert, delete, update.
>
>
>
> Thanks.
>
>
>
>
> --
>
> Thanks,
> Ryan Svihla
>
>


-- 

Thanks,
Ryan Svihla