Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1EC78200D0B for ; Wed, 27 Sep 2017 15:29:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1D12C1609CA; Wed, 27 Sep 2017 13:29:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 61B4D1609BC for ; Wed, 27 Sep 2017 15:29:13 +0200 (CEST) Received: (qmail 51456 invoked by uid 500); 27 Sep 2017 13:29:12 -0000 Mailing-List: contact user-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@lucenenet.apache.org Delivered-To: mailing list user@lucenenet.apache.org Received: (qmail 51444 invoked by uid 99); 27 Sep 2017 13:29:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Sep 2017 13:29:12 +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 93DA8CE621 for ; Wed, 27 Sep 2017 13:29:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.629 X-Spam-Level: ** X-Spam-Status: No, score=2.629 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rfqZEnHTYW6I for ; Wed, 27 Sep 2017 13:29:09 +0000 (UTC) Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.161.182]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7969960DB2 for ; Wed, 27 Sep 2017 13:29:07 +0000 (UTC) Received: by mail-yw0-f182.google.com with SMTP id x131so9274668ywa.10 for ; Wed, 27 Sep 2017 06:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Z7qwlW6owu1Z5cU20tfrSttmkCcru0vGXAhtRmLrCXk=; b=UH/6EwB8ieElXGtoV9rNgAFL2DzkfWWXFo+Ivcj+yIfjki1Uq108AR17Vzfy+rHDyk Q3UDWcd1mNUa98RT4h5TP8XsWAmyfLYMwfZ3wQIOXWKueysdcAMCSiIRjpvDw/Z6O7L8 n+3MwxSfG4ZNcxk7U+GyPo5nHGxZpVGwa1NeRgESk6MqOcVEJNFmXhmeVi7MwDk+NfUR LJGIaCnoxd4M4NV7ECb4L12vCldFrlHqCO8132UbXM4FvPljHnEAN0z5hbZ3wYTolFl4 MFXb+/5werXtb6t3t/BNZzxotfUl62LWqfgJwllyNlJCezSVHtt6D3es0wR7pmLSSvA9 OP6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Z7qwlW6owu1Z5cU20tfrSttmkCcru0vGXAhtRmLrCXk=; b=Mo8ZURkHXfskkk30ZJZIE6VXvv0tDR1KxvQeilr6r8A9SGg3tJMLvwksWYdrZYsJXK Dhcb6gNsgpp7R2dO5IMJE9VF1c7RgdVMQguUKXJssusjeOHThiaqdRqYCBJL2dvcW7iX q1mJ+U3lnjWwwVJKJN6mIn7qdPD3OTRA8di5Hwrxf9q74K+Vcvo8oiOwe4fT7WGHacCe Ksjoj1Mp84dWTXtupe4LjM84f6YHG1OLeiAkQSbX3Uts4fNmnGBegvqU90sNVbuHLiQH Jz6s7zdWGM2f0TdmwDJvaPoSv1foQ0RDROTHRihWa1etDss8KMIrL+0qxYuja2AAgDiJ w/qg== X-Gm-Message-State: AHPjjUjdaOKjngPFPOdDvqieLmyjK91SaDtBBi3w7WfCEz7YssPVHWIw NWbKvTSbA4TK71CxNrSCV5grbPXURE7wgQKMTxM= X-Google-Smtp-Source: AOwi7QAgBpD5acv0Kn3f8XxfF9gKVD7kNiQBV0TMsP1hP3EuNF9u2Wy2JAh6HWle63j7OgstUNN/LhnBcJkPIegzXYU= X-Received: by 10.129.72.5 with SMTP id v5mr873577ywa.53.1506518945904; Wed, 27 Sep 2017 06:29:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: JA Purcell <9urc311@gmail.com> Date: Wed, 27 Sep 2017 13:28:55 +0000 Message-ID: Subject: Re: confused about segment merging and commits To: user@lucenenet.apache.org Content-Type: multipart/alternative; boundary="001a114dd2fe9e3f51055a2bc6a4" archived-at: Wed, 27 Sep 2017 13:29:14 -0000 --001a114dd2fe9e3f51055a2bc6a4 Content-Type: text/plain; charset="UTF-8" Hey Jonathan, I can only speak from my experience with Lucene.Net, but the XML doc comment on the Commit method states that it does not wait for any background merges to finish. There is a WaitForMerges method on the IndexWriter if you wanted to wait for those to finish. From the way I understand it, segments are still part of the searchable index; so the reader would still read them in a search. You merge them together to reduce the number of files that the reader must parse reducing search time. If you have access to the Lucene In Action book, section 2.13 goes into depth with how most of this works. The XML docs are pretty good too. I've never used it, but you can also have the IndexWriter write it's verbose logging to a file via the SetInfoStream method so that you can see exactly what it's doing. Hope that helps some, Adam On Wed, Sep 27, 2017 at 5:59 AM Jonathan Resnick wrote: > Hi, > > I am trying to understand how segment merging interacts with commits. > > Consider the following timeline of events: > > 1. IndexWriter is opened on an index. > 2. IndexWriter is used to add/update/delete docs, but not yet commit the > changes. > 3. Activity in step 2 triggers segment merging on a background thread. > 4. Commit() is called on IndexWriter while merging in step 3 has not yet > finished. > > Does the Commit() in step 4 block while the segment merge in step 3 > finishes? > If not, then when is the segment merge in 3 "committed" to the index? (i.e. > at what point would a new IndexReader see the merged segment file?) > Or does segment merging happen entirely independently of commits? > > [More context: we are trying to build a backup system that copies the index > files to a backup server after every commit. Initially I thought it would > be sufficient to just keep track of file add/update/deletes since the > previous commit, but if segment merging is happening concurrently then > perhaps it's not so simple?] > > More generally, is there any in-depth documentation available describing > how segment merging interacts with commits (even if it's for the Java > version of Lucene)? My web searches have not turned up much... > > Many thanks, > Jonathan > --001a114dd2fe9e3f51055a2bc6a4--