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

Alexey Zotov edited comment on CASSANDRA-15669 at 5/30/21, 7:57 PM:
--------------------------------------------------------------------

[~yifanc] [~marcuse]

I'm attaching patches for 3.11, 4.0 and trunk branches. In order to make the 
unit test working in 3.11 branch, I've had to onboard these changes:
 * 
[https://github.com/apache/cassandra/commit/546331037ee8218208b61a26ecbc12ab8dd7eace#diff-d2993d01b021fb5e2ed23171c0bf5f1abb2f13d1d9ef67d089bb2cf8108ff64c]
 * 
[https://github.com/apache/cassandra/commit/54d297a192ca452dab5640f33fd6c22fd31e2f9c#diff-d2993d01b021fb5e2ed23171c0bf5f1abb2f13d1d9ef67d089bb2cf8108ff64c]

I run the {{LeveledCompactionStrategyTest}} on every branch and it worked fine 
for me locally. Please, let me know if you encounter any issues with that test 
on CI.

PS:
 Initially I misread the comment and tried to prepare a patch for 3.0 version 
:D It turned out that it is pretty to hard to migrate the unit test to that 
branch because _fanout_ parameter is not yet configurable. Consequently it 
requires to generate a bunch of sstables (to reach _max level size_ for L8) 
which make the test long and clumsy. It took some time to realize that it is 
better to go without having that test in 3.0. And finally I found out that the 
patch for 3.0 is not required.


was (Author: azotcsit):
[~yifanc] [~marcuse]

I'm attaching patches for 3.11, 4.0 and trunk branches. In order to make the 
unit test working in 3.11 branch, I've had to onboard these changes:
 * 
[https://github.com/apache/cassandra/commit/546331037ee8218208b61a26ecbc12ab8dd7eace#diff-d2993d01b021fb5e2ed23171c0bf5f1abb2f13d1d9ef67d089bb2cf8108ff64c]
 * 
[https://github.com/apache/cassandra/commit/54d297a192ca452dab5640f33fd6c22fd31e2f9c#diff-d2993d01b021fb5e2ed23171c0bf5f1abb2f13d1d9ef67d089bb2cf8108ff64c]

I run the {{LeveledCompactionStrategyTest}} on every branch and it worked fine 
for me locally. Please, let me know if encounter any issues with that test on 
CI.

PS:
 Initially I misread the comment and tried to prepare a patch for 3.0 version 
:D It turned out that it is pretty to hard to migrate the unit test to that 
branch because _fanout_ parameter is not yet configurable. Consequently it 
requires to generate a bunch of sstables (to reach _max level size_ for L8) 
which make the test long and clumsy. It took some time to realize that it is 
better to go without having that test in 3.0. And finally I found out that the 
patch for 3.0 is not required.

> LeveledCompactionStrategy compact last level throw an 
> ArrayIndexOutOfBoundsException
> ------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-15669
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15669
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Compaction/LCS
>            Reporter: sunhaihong
>            Assignee: Alexey Zotov
>            Priority: Normal
>             Fix For: 3.11.x, 4.0.x
>
>         Attachments: 15669-3.11.txt, 15669-4.0.txt, 15669-trunk.txt, 
> cfs_compaction_info.png, error_info.png
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Cassandra will throw an ArrayIndexOutOfBoundsException when compact last 
> level.
> My test is as follows:
>  # Create a table with LeveledCompactionStrategy and its params are 
> 'enabled': 'true', 'fanout_size': '2', 'max_threshold': '32', 
> 'min_threshold': '4', 'sstable_size_in_mb': '2'(fanout_size and 
> sstable_size_in_mb are too small just to make it easier to reproduce the 
> problem);
>  # Insert data into the table by stress;
>  # Cassandra throw an ArrayIndexOutOfBoundsException when compact level9 
> sstables(this level score bigger than 1.001)
> ERROR [CompactionExecutor:4] 2020-03-28 08:59:00,990 CassandraDaemon.java:442 
> - Exception in thread Thread[CompactionExecutor:4,1,main]
>  java.lang.ArrayIndexOutOfBoundsException: 9
>  at 
> org.apache.cassandra.db.compaction.LeveledManifest.getLevel(LeveledManifest.java:814)
>  at 
> org.apache.cassandra.db.compaction.LeveledManifest.getCandidatesFor(LeveledManifest.java:746)
>  at 
> org.apache.cassandra.db.compaction.LeveledManifest.getCompactionCandidates(LeveledManifest.java:398)
>  at 
> org.apache.cassandra.db.compaction.LeveledCompactionStrategy.getNextBackgroundTask(LeveledCompactionStrategy.java:131)
>  at 
> org.apache.cassandra.db.compaction.CompactionStrategyHolder.lambda$getBackgroundTaskSuppliers$0(CompactionStrategyHolder.java:109)
>  at 
> org.apache.cassandra.db.compaction.AbstractStrategyHolder$TaskSupplier.getTask(AbstractStrategyHolder.java:66)
>  at 
> org.apache.cassandra.db.compaction.CompactionStrategyManager.getNextBackgroundTask(CompactionStrategyManager.java:214)
>  at 
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionCandidate.run(CompactionManager.java:289)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
>  at java.util.concurrent.FutureTask.run(FutureTask.java)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>  at java.lang.Thread.run(Thread.java:748)
> I tested it on cassandra version 3.11.3 & 4.0-alpha3. The exception all 
> happened.
> once it triggers, level1- leveln compaction no longer works, level0 is still 
> valid
>  



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