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

Branimir Lambov commented on CASSANDRA-15284:
---------------------------------------------

Thank you for the excellent investigation and write-up. It does look like there 
are many copies of the same position info in the writer, and that they aren't 
correctly handled. In addition to what you describe, {{padToPageBoundary}} 
isn't adjusting the compressed size, which can cause the same problem.

I agree we need to get rid of the extras: {{lastFlushOffset}} and 
{{compressedSize}} should both be eliminated, their usages replaced with 
{{bufferOffset}}, and {{compressedSize}} should be taken from {{chunkOffset}}.

Dealing with the broken full CRC is a bit more involved, but we could flag if 
{{resetAndTruncate}} needed to back through to a different chunk, and do a full 
pass over the file to recalculate it on completion if flagged.

> AssertionError while scrubbing sstable
> --------------------------------------
>
>                 Key: CASSANDRA-15284
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15284
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Feature/Compression
>            Reporter: Gianluigi Tiesi
>            Priority: Normal
>             Fix For: 3.11.x, 4.0.x, 4.1.x
>
>         Attachments: assert-comp-meta.diff
>
>
> I've got a damaged data file but while trying to run scrub (online or 
> offline) I always get this
> error:
>  
> {code:java}
> -- StackTrace --
> java.lang.AssertionError
>         at 
> org.apache.cassandra.io.compress.CompressionMetadata$Chunk.<init>(CompressionMetadata.java:474)
>         at 
> org.apache.cassandra.io.compress.CompressionMetadata.chunkFor(CompressionMetadata.java:239)
>         at 
> org.apache.cassandra.io.util.MmappedRegions.updateState(MmappedRegions.java:163)
>         at 
> org.apache.cassandra.io.util.MmappedRegions.<init>(MmappedRegions.java:73)
>         at 
> org.apache.cassandra.io.util.MmappedRegions.<init>(MmappedRegions.java:61)
>         at 
> org.apache.cassandra.io.util.MmappedRegions.map(MmappedRegions.java:104)
>         at 
> org.apache.cassandra.io.util.FileHandle$Builder.complete(FileHandle.java:362)
>         at 
> org.apache.cassandra.io.util.FileHandle$Builder.complete(FileHandle.java:331)
>         at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.openFinal(BigTableWriter.java:336)
>         at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.openFinalEarly(BigTableWriter.java:318)
>         at 
> org.apache.cassandra.io.sstable.SSTableRewriter.switchWriter(SSTableRewriter.java:322)
>         at 
> org.apache.cassandra.io.sstable.SSTableRewriter.doPrepare(SSTableRewriter.java:370)
>         at 
> org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:173)
>         at 
> org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.finish(Transactional.java:184)
>         at 
> org.apache.cassandra.io.sstable.SSTableRewriter.finish(SSTableRewriter.java:357)
>         at 
> org.apache.cassandra.db.compaction.Scrubber.scrub(Scrubber.java:291)
>         at 
> org.apache.cassandra.db.compaction.CompactionManager.scrubOne(CompactionManager.java:1010)
>         at 
> org.apache.cassandra.db.compaction.CompactionManager.access$200(CompactionManager.java:83)
>         at 
> org.apache.cassandra.db.compaction.CompactionManager$3.execute(CompactionManager.java:391)
>         at 
> org.apache.cassandra.db.compaction.CompactionManager$2.call(CompactionManager.java:312)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:81)
>         at java.lang.Thread.run(Thread.java:748)
> {code}
> At the moment I've moved away the corrupted file, If you need more info fell 
> free to ask
>   
> According to the source 
> [https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java#L474]
> looks like the requested chung length is <= 0



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to