Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9795A10078 for ; Tue, 8 Sep 2015 16:25:45 +0000 (UTC) Received: (qmail 82655 invoked by uid 500); 8 Sep 2015 16:25:42 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 82614 invoked by uid 500); 8 Sep 2015 16:25:42 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 82604 invoked by uid 99); 8 Sep 2015 16:25:42 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2015 16:25:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 9A6C7E02D2 for ; Tue, 8 Sep 2015 16:25:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=datastax.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id ydegafKp8mtW for ; Tue, 8 Sep 2015 16:25:36 +0000 (UTC) Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com [209.85.213.173]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 2F40620385 for ; Tue, 8 Sep 2015 16:25:36 +0000 (UTC) Received: by igbni9 with SMTP id ni9so81265167igb.0 for ; Tue, 08 Sep 2015 09:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datastax.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=alCMSqaa7YEKOkFmuRQXxQjDcs+Cv77c2RFsxlbHew0=; b=KbIzH4smZGlq4FGaF6Fd5tJPNcjkWI2NiRuCNEOu/Ep/tm/rl+zEUH3958dSZng4zL 20alIHxa5IFUgZuuUFMZdIVbis0K6EioHFWMOQxr3dujTuYLfJHhlqk9udfd/fCfsCZX 0KMKfXrdmOlvnhy6CxcsHJz6bs7et0v3wgW08= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=alCMSqaa7YEKOkFmuRQXxQjDcs+Cv77c2RFsxlbHew0=; b=NgxnxsKPhuaJraNgnz0qBu1E1nRAeZP8Q0DjFZu3iaDS1yfWEyboOq91Xs45OkJBAI iu5mW5dIJNR30M7CDpm5gyEy6ltv6/PRZ0LhI34/a7lxSnhYnL2+cpBA1d0iGr1r+KqE sRDRxmjyZ+p5K/heWfJWPN+SlM2pk7WCgqBozW3GlEBeQrEoSff4zd9vtnfZBsaRnLFn dUXxunsrNgOuZxCMFMO7h+r20y8pQF9Ke/vaZvX1wE3cbn3lwhNgv7xOFuxMHUp7qNXi 25wnFSKjpRc1oxMF1TSpj6ogqXW+VTkQMjnE3GOR3S6kXogAZybubnyhix/VxOoKW8Nz /Fww== X-Gm-Message-State: ALoCoQlWXiXp9p/+oJpnhc5BXa1U+Dip1SPAZmwtp3s8ctv9EwzR0mZlQ2jIbxfMLRzZUKVPZw1T X-Received: by 10.50.138.6 with SMTP id qm6mr43037742igb.37.1441729535621; Tue, 08 Sep 2015 09:25:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.12.65 with HTTP; Tue, 8 Sep 2015 09:25:16 -0700 (PDT) In-Reply-To: References: From: Tyler Hobbs Date: Tue, 8 Sep 2015 11:25:16 -0500 Message-ID: Subject: Re: who does generate timestamp during the write? To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001a1134cd06d56ff9051f3ed044 --001a1134cd06d56ff9051f3ed044 Content-Type: text/plain; charset=UTF-8 On Sat, Sep 5, 2015 at 8:32 AM, ibrahim El-sanosi wrote: > So in this scenario, the latest data that wrote to the replicas is [K1, > V2] which should be the correct one, but it reads [K1,V1] because of divert > clock. > > Can such scenario occur? > Yes, it most certainly can. There are a couple of pieces of advice for this. First, run NTP on all of your servers. Second, if clock drift of a second or so would cause problems for your data model (like your example), change your data model. Usually this means creating separate rows for each version of the value (by adding a timuuid to the primary key, for example), but in some cases lightweight transactions may also be suitable. -- Tyler Hobbs DataStax --001a1134cd06d56ff9051f3ed044 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Sat, Sep 5, 2015 at 8:32 AM, ibrahim El-sanosi <ibrahimsabattt@g= mail.com> wrote:

So in this scenario, the latest data that wrote to the replicas is [K1, V2] which should be the correct one= , but it reads [K1,V1] because of divert clock.

Can such scenario occur?


<= div class=3D"gmail_extra">Yes, it most certainly can.=C2=A0 There are a cou= ple of pieces of advice for this.=C2=A0 First, run NTP on all of your serve= rs.=C2=A0 Second, if clock drift of a second or so would cause problems for= your data model (like your example), change your data model.=C2=A0 Usually= this means creating separate rows for each version of the value (by adding= a timuuid to the primary key, for example), but in some cases lightweight = transactions may also be suitable.


--
Tyler Hobbs
DataStax
<= /div>
--001a1134cd06d56ff9051f3ed044--