[ 
https://issues.apache.org/jira/browse/CASSANDRA-10421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14959729#comment-14959729
 ] 

Ariel Weisberg commented on CASSANDRA-10421:
--------------------------------------------

So what I think I see is that when the LogTransaction completes it first writes 
to the log the commit record, and then starts making permanent changes to the 
the files on disk (deleting the old ones). But if it hasn't actually synced the 
log to disk then on a restart we could have a partial log and attempt to roll 
back, but it is too late because before the crash we had already deleted parts 
of the before state. At the end we should sync the log files before deleting 
the obsolete files right?

Before we add a new file that we want to have cleaned up maybe we also want to 
make sure the record is one disk so that it will definitely be cleaned up? 
Maybe not necessary since it is just additional data that will be compacted 
later.

Maybe optimizing for power failure isn't necessary, but then why are we syncing 
directories?

[Here it seems like you don't sync the folder when appending every 
record?|https://github.com/apache/cassandra/commit/8e02e47e1a4a86428bec61d8975a9706c544003b#diff-a7c36820cf8658b605948a23e3033f88R76].
 Was the intent to sync the folder when creating the log file or when adding a 
record which indicates the addition of other data files?

I am generally +1 other then my confusion over how syncing of the log file 
contents is handled.

The tests don't seem to match trunk. I gave them another spin on the 3.0 branch 
to get another sample. 

> 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)

Reply via email to