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

Yifan Cai commented on CASSANDRA-15928:
---------------------------------------

It looks like that for 
{{org.apache.cassandra.io.util.FileUtils#renameWithConfirm}}, we want to not 
throw FSWE, according to the 
[comment|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/io/util/FileUtils.java#L246-L247].
 

Found another occurrence where throwing FSWE makes more sense. 
{{org.apache.cassandra.io.compress.CompressionMetadata.Writer#doPrepare}} 
re-throws IOException wrapped by RuntimeException. 

Custom inspection rules were made in Intellij to perform static analysis and 
find the occurrences that do not handle IOException with FSError. Attached the 
custom inspection config. 

cc: [~aleksey] I came across CASSANDRA-2116, which looks to be a similar task 
to this one. Would you like to take a look at the list of findings and see if 
they are valid to throw FSWE instead? 

> Throw FSWriteError upon write failures in order to apply DiskFailurePolicy
> --------------------------------------------------------------------------
>
>                 Key: CASSANDRA-15928
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15928
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Other
>            Reporter: Yifan Cai
>            Assignee: Yifan Cai
>            Priority: Normal
>         Attachments: intellij_custom_insepction.xml
>
>
> Active handling of FSError in AbstractLocalAwareExecutorService was 
> introduced in CASSANDRA-14993. 
>  
> However, in the current code base, there are places that catch the 
> IOException but not wrap it with FSError, hence not triggering the 
> DiskFailurePolicy. Especially when the bad disk no longer permits write 
> operations, it could leads to the mutation stage backup. Therefore I propose 
> to fix the IOException handling in those cases. 
>  
> From the code inspection, those 6 places are current not re-throwing an 
> IOException with FSWriteError.
>  # org.apache.cassandra.triggers.CustomClassLoader#addClassPath throws 
> IOError. Invoked in TriggerExecutor's constructor
>  # org.apache.cassandra.io.util.FileUtils#renameWithConfirm throws 
> RuntimeException
>  # org.apache.cassandra.io.util.FileUtils#truncate throws RuntimeException
>  # org.apache.cassandra.io.util.FileUtils#write throws RuntimeException
>  # org.apache.cassandra.db.compaction.LeveledManifest#sendBackToL0 throws 
> RuntimeException. Invokes rewriteSSTableMetadata
>  # org.apache.cassandra.io.sstable.SSTableHeaderFix#writeNewMetadata throws 
> RuntimeException. Invokes rewriteSSTableMetadata



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to