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

Stefania commented on CASSANDRA-7066:
-------------------------------------

I agree on stashing files with {{ignore}}, not sure for the case when we refuse 
to start though. Perhaps in this case we should add this functionality to the 
offline sstable utility tool and let the operator either clean-up or stash. 
I've opened CASSANDRA-10112, let's move the discussion there. 

[~benedict] could you commit the fix for two COVERITY defects? Commit 
[here|https://github.com/stef1927/cassandra/commit/c94d8a12dc43cd4705f1aa8cf384fb8c3290a5f9].

{code}
** CID 1316515:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
/src/java/org/apache/cassandra/db/lifecycle/TransactionLog.java: 363 in 
org.apache.cassandra.db.lifecycle.TransactionLog$TransactionFile.readRecord(java.lang.String,
 boolean)()


________________________________________________________________________________________________________
*** CID 1316515:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
/src/java/org/apache/cassandra/db/lifecycle/TransactionLog.java: 363 in 
org.apache.cassandra.db.lifecycle.TransactionLog$TransactionFile.readRecord(java.lang.String,
 boolean)()
357                 if (!matcher.matches() || matcher.groupCount() != 2)
358                 {
359                     handleReadRecordError(String.format("cannot parse line 
\"%s\"", line), isLast);
360                     return Record.make(line, isLast);
361                 }
362
>>>     CID 1316515:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
>>>     Found reliance on default encoding: String.getBytes().
363                 byte[] bytes = matcher.group(1).getBytes();
364                 checksum.update(bytes, 0, bytes.length);
365
366                 if (checksum.getValue() != Long.valueOf(matcher.group(2)))
367                     handleReadRecordError(String.format("invalid line 
checksum %s for \"%s\"", matcher.group(2), line), isLast);
368

** CID 1316514:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
/src/java/org/apache/cassandra/db/lifecycle/TransactionLog.java: 231 in 
org.apache.cassandra.db.lifecycle.TransactionLog$Record.getBytes()()


________________________________________________________________________________________________________
*** CID 1316514:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
/src/java/org/apache/cassandra/db/lifecycle/TransactionLog.java: 231 in 
org.apache.cassandra.db.lifecycle.TransactionLog$Record.getBytes()()
225             {
226                 return String.format("%s:[%s,%d,%d]", type.toString(), 
relativeFilePath, updateTime, numFiles);
227             }
228
229             public byte[] getBytes()
230             {
>>>     CID 1316514:  FindBugs: Internationalization  (FB.DM_DEFAULT_ENCODING)
>>>     Found reliance on default encoding: String.getBytes().
231                 return record.getBytes();
232             }
233
234             public boolean verify(String parentFolder, boolean 
lastRecordIsCorrupt)
235             {
236                 if (type != RecordType.REMOVE)
{code}

> Simplify (and unify) cleanup of compaction leftovers
> ----------------------------------------------------
>
>                 Key: CASSANDRA-7066
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7066
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Stefania
>            Priority: Minor
>              Labels: benedict-to-commit, compaction
>             Fix For: 3.0 alpha 1
>
>         Attachments: 7066.txt
>
>
> Currently we manage a list of in-progress compactions in a system table, 
> which we use to cleanup incomplete compactions when we're done. The problem 
> with this is that 1) it's a bit clunky (and leaves us in positions where we 
> can unnecessarily cleanup completed files, or conversely not cleanup files 
> that have been superceded); and 2) it's only used for a regular compaction - 
> no other compaction types are guarded in the same way, so can result in 
> duplication if we fail before deleting the replacements.
> I'd like to see each sstable store in its metadata its direct ancestors, and 
> on startup we simply delete any sstables that occur in the union of all 
> ancestor sets. This way as soon as we finish writing we're capable of 
> cleaning up any leftovers, so we never get duplication. It's also much easier 
> to reason about.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to