Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 48015 invoked from network); 11 Apr 2010 22:14:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Apr 2010 22:14:05 -0000 Received: (qmail 57535 invoked by uid 500); 11 Apr 2010 22:14:04 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 57470 invoked by uid 500); 11 Apr 2010 22:14:04 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 57463 invoked by uid 99); 11 Apr 2010 22:14:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Apr 2010 22:14:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Apr 2010 22:14:02 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3BMDelU020169 for ; Sun, 11 Apr 2010 18:13:40 -0400 (EDT) Message-ID: <11214705.13011271024020758.JavaMail.jira@thor> Date: Sun, 11 Apr 2010 18:13:40 -0400 (EDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2386) IndexWriter commits unnecessarily on fresh Directory In-Reply-To: <386970335.20021270756057764.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855786#action_12855786 ] Michael McCandless commented on LUCENE-2386: -------------------------------------------- Patch looks good... thanks Shai. I think the only open question is whether we should emulate the "not quite ACID" bug if Version < LUCENE_31? I don't think it's necessary (but we should advertise this in back-compat breaks in CHANGES).... anyone else? > IndexWriter commits unnecessarily on fresh Directory > ---------------------------------------------------- > > Key: LUCENE-2386 > URL: https://issues.apache.org/jira/browse/LUCENE-2386 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Reporter: Shai Erera > Assignee: Shai Erera > Fix For: 3.1 > > Attachments: LUCENE-2386.patch, LUCENE-2386.patch, LUCENE-2386.patch, LUCENE-2386.patch, LUCENE-2386.patch > > > I've noticed IndexWriter's ctor commits a first commit (empty one) if a fresh Directory is passed, w/ OpenMode.CREATE or CREATE_OR_APPEND. This seems unnecessarily, and kind of brings back an autoCommit mode, in a strange way ... why do we need that commit? Do we really expect people to open an IndexReader on an empty Directory which they just passed to an IW w/ create=true? If they want, they can simply call commit() right away on the IW they created. > I ran into this when writing a test which committed N times, then compared the number of commits (via IndexReader.listCommits) and was surprised to see N+1 commits. > Tried to change doCommit to false in IW ctor, but it got IndexFileDeleter jumping on me .. so the change might not be that simple. But I think it's manageable, so I'll try to attack it (and IFD specifically !) back :). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org