Return-Path: Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: (qmail 81088 invoked from network); 2 Nov 2010 04:41:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Nov 2010 04:41:46 -0000 Received: (qmail 52814 invoked by uid 500); 2 Nov 2010 04:42:14 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 52652 invoked by uid 500); 2 Nov 2010 04:42:14 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 52644 invoked by uid 99); 2 Nov 2010 04:42:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Nov 2010 04:42:13 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.191.84.218] (HELO web82105.mail.mud.yahoo.com) (209.191.84.218) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 02 Nov 2010 04:42:05 +0000 Received: (qmail 33055 invoked by uid 60001); 2 Nov 2010 04:41:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1288672903; bh=bisYYzPDApS3/SA0fmhVPYbP9/k/i9xkJpue5yXVf/U=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=eWj3BoXc4btAK6vT5HERvmpb3Sr0zONjKas2pdJtLLiaDmJFrg539s8aHcAPYfSDWFe0kxLaO7jepRGs7BksTbiaLZBWpLNmO5NeDJb8j/qXxRyPmbStLfFr1cmw8bAaswS9scjtl1516YyDUV3R4V6pcGfScsHGE2s1JH7IkLU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=cHEF20SC/WXuo0OYNA2Kq2ermzMpyuv0XDi+oq1kJwgLr65CxP38pezm/DAAYfUaVT0fsD3APVCphHR1knOkkfCGMpQaV+SeL7AhU/298OR3zJhvrQKFwh7CQsnqbutlffkfcMXi3QdBjhCSg7vVt+iCao+Dl1guDGW0NSBGQgo=; Message-ID: <501613.31980.qm@web82105.mail.mud.yahoo.com> X-YMail-OSG: QdQxiMQVM1k_Yy7LUr14AA9E.lMfjjJJNPnsUqb5JfhNFmm oeEWN2QymEO1rLyqSN8bUJzKhqn_bVSa7_Zgdz0VAJMT0zSssAy5Q.LyfwU0 qzCqVQTAa_6nl13jY.EcaFe3bwN1l3TPDx1.9LTOHlvUNrz0EBUv.VqpdS4s mrxYJCTWplaY.nIWX3FZ36wPmxhOgcMgksTpE1NRfhC90BdHkpUtBhfDbOvg loyDVsDW6vuluGRnEpNN1RELQ4yn5NgGtt.NO3OBq9qVceajmVNdlNn6qF_F RcYOgX0uBdMoasETL425aTSFEbS5bP5qzHJYsERhmVSAEcRFxt_7E6RZ5rVy ufOnCsRBRVgEqgg2lYAQyapxZUHO4ok.Ph6NvCw-- Received: from [64.134.222.41] by web82105.mail.mud.yahoo.com via HTTP; Mon, 01 Nov 2010 21:41:43 PDT X-Mailer: YahooMailClassic/11.4.9 YahooMailWebService/0.8.107.284920 Date: Mon, 1 Nov 2010 21:41:43 -0700 (PDT) From: Dennis Gearon Subject: RE: Ensuring stable timestamp ordering To: solr-user@lucene.apache.org In-Reply-To: <2E6A89A648463A4EBF093A9062C16683032C20309521@SBMAILBOX1.sb.statsbiblioteket.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org how about a timrstamp with either a GUID appended on the end of it?=0A=0A= =0ADennis Gearon=0A=0ASignature Warning=0A----------------=0AIt is always a= good idea to learn from your own mistakes. It is usually a better idea to = learn from others=E2=80=99 mistakes, so you do not have to make them yourse= lf. from 'http://blogs.techrepublic.com.com/security/?p=3D4501&tag=3Dnl.e03= 6'=0A=0AEARTH has a Right To Life,=0A otherwise we all die.=0A=0A=0A--- On= Sun, 10/31/10, Toke Eskildsen wrote:=0A=0A> From:= Toke Eskildsen =0A> Subject: RE: Ensuring stable t= imestamp ordering=0A> To: "solr-user@lucene.apache.org" =0A> Date: Sunday, October 31, 2010, 12:18 PM=0A> Dennis Gearon [= gearond@sbcglobal.net]=0A> wrote:=0A> > Even microseconds may not be enough= on some really=0A> good, fast machine.=0A> =0A> True, especially since the= timer might not provide=0A> microsecond granularity although the returned = value is in=0A> microseconds. However, an unique timestamp generator should= =0A> keep track of the previous timestamp to guard against=0A> duplicates. = Uniqueness can thus be guaranteed by waiting a=0A> bit or cheating on the d= ecimals. With microseconds can=0A> produce 1 million timestamps / second. W= hile I agree that=0A> duplicates within microseconds can occur on a fast ma= chine,=0A> guaranteeing uniqueness by waiting should only be a=0A> performa= nce problem when the number of duplicates is high.=0A> That's still a few y= ears off, I think.=0A> =0A> As Michael pointed out, using normal timestamps= as unique=0A> IDs might not be such a great idea as it effectively locks= =0A> index-building to a single JVM. By going the ugly route and=0A> expres= sing the time in nanos with only microsecond=0A> granularity and use the la= st 3 decimals for a builder ID=0A> this could be fixed. Not very clean thou= gh, as the contract=0A> is not expressed in the data themselves but must=0A= > nevertheless be obeyed by all builders to avoid collisions.=0A> It also r= aises the question of who should assign the builder=0A> IDs. Not trivial in= an anarchistic setup where new builders=0A> can be added by different cont= rollers.=0A> =0A> Pragmatists might use the PID % 1000 or similar for the= =0A> builder ID as it does not require coordination, but this is=0A> where = the Birthday Paradox hits us again: The chance of two=0A> processes on diff= erent machines having the same PID is 10%=0A> if just 15 machines are used = (1% for 5 machines, 50% for 37=0A> machines). I don't like those odds and t= hat's assuming that=0A> the PIDs will be randomly distributed, which they w= on't. It=0A> could be lowered by reserving more decimals for the salt,=0A> = but then we would decrease the maximum amount of timestamps=0A> / second, s= till without guaranteed uniqueness. Guys a lot=0A> smarter than me has spen= d time on the unique ID problem and=0A> it's clearly not easy: Java's UUID = takes up 128 bits.=0A> =0A> - Toke