Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8FF0F189F7 for ; Wed, 14 Oct 2015 21:18:06 +0000 (UTC) Received: (qmail 40644 invoked by uid 500); 14 Oct 2015 21:18:06 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 40618 invoked by uid 500); 14 Oct 2015 21:18:06 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 40600 invoked by uid 99); 14 Oct 2015 21:18:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2015 21:18:06 +0000 Date: Wed, 14 Oct 2015 21:18:06 +0000 (UTC) From: "Ariel Weisberg (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-10421) Potential issue with LogTransaction as it only checks in a single directory for files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-10421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14957789#comment-14957789 ] Ariel Weisberg commented on CASSANDRA-10421: -------------------------------------------- I think this does what we talked about where generally speaking if anything goes wrong LogFile.verify will return false and then LogTransaction.removeUnfinishedLeftovers won't do anything. The only attempt we make to be a hero is when it's just the last record that has minor disagreement that indicates missing or partial commit in one file. bq. Most likely a corrupt sstable exception will halt start-up depending on disk failure policy. Would this be what happens? We don't validate checksums of entire files at startup. Or is there a flag somewhere else that allows us to know which files are incomplete? I just noticed that it seems to open each file every time to append a record? Since each record is only one table seems like that could end up being a little slow although most transactions won't touch that many tables so maybe it's not an issue. It syncs the folder descriptor every time it writes to a file? Seems like the folder only needs to be synced once when the file is created or is that done as a side effect for other operations? Is the intent to sync the file for each record and not the directory? LogFile.deleteRecords() applies records of a specific type? Just based on the name I thought it was modifying the log contents somehow. Seems like it and the chain of delegating calls should be named something else like applyRecords. Can you add a comment that the LogFile.records is a LinkedHashSet because it must be order preserving? When I saw it floating around without the LHS type and just Set I was confused. Wouldn't want to it change into something that is not order preserving later on. > Potential issue with LogTransaction as it only checks in a single directory for files > ------------------------------------------------------------------------------------- > > Key: CASSANDRA-10421 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10421 > Project: Cassandra > Issue Type: Bug > Reporter: Marcus Eriksson > Assignee: Stefania > Priority: Blocker > Fix For: 3.0.0 rc2 > > > When creating a new LogTransaction we try to create the new logfile in the same directory as the one we are writing to, but as we use {{[directories.getDirectoryForNewSSTables()|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/lifecycle/LogTransaction.java#L125]}} this might end up in "any" of the configured data directories. If it does, we will not be able to clean up leftovers as we check for files in the same directory as the logfile was created: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/lifecycle/LogRecord.java#L163 > cc [~Stefania] -- This message was sent by Atlassian JIRA (v6.3.4#6332)