You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Andres de la Peña (Jira)" <ji...@apache.org> on 2022/07/21 17:05:00 UTC

[jira] [Comment Edited] (CASSANDRA-17575) forceCompactionForTokenRange when using a wrapped range may include sstables not within that range

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

Andres de la Peña edited comment on CASSANDRA-17575 at 7/21/22 5:04 PM:
------------------------------------------------------------------------

{quote}if you change to do (32, 31] you see that compaction included a partition it shouldn't have; we include partition 32 even though the range filters out that partition. This ticket should figure out why we include the wrong partition and attempt to fix it so we stop
{quote}
I think that [{{wrappingRange}}|https://github.com/apache/cassandra/blob/cassandra-4.1/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java#L503-L511] in that test actually is {{(32, 31]}} without changing it. I understand that [the asserted value|https://github.com/apache/cassandra/blob/cassandra-4.1/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java#L520-L521] should be 11 instead of 1, because we don't compact the ten {{[32, 32]}} sstables, but only the the ten {{[31,32]}} and the ten {{[31, 31]}} sstables. So 20 sstables compacted into one single sstable, plus 10 uncompacted sstables, makes 11 sstables. Is that right?

Probably the issue is on [{{CompactionManger#sstablesInBounds}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L991], where it passes token ranges that exclude the start bound to [{{View.sstablesInBounds}}|https://github.com/apache/cassandra/blob/e4e19e33faf9ac7cf27a9779c8083a7f5c5b865a/src/java/org/apache/cassandra/db/lifecycle/View.java#L181-L185], which includes both bounds.

Also, what token range should we use to compact a single token? [Here|https://github.com/apache/cassandra/blob/cassandra-4.1/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java#L446-L447] the tests uses {{(32, 32]}}, although for the comment it seems that the intention in the past was to use {{(31, 32])}}.


was (Author: adelapena):
{quote}if you change to do (32, 31] you see that compaction included a partition it shouldn't have; we include partition 32 even though the range filters out that partition. This ticket should figure out why we include the wrong partition and attempt to fix it so we stop
{quote}
I think that [{{wrappingRange}}|https://github.com/apache/cassandra/blob/cassandra-4.1/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java#L503-L511] in that test actually is {{(32, 31]}} without changing it. I understand that [the asserted value|https://github.com/apache/cassandra/blob/cassandra-4.1/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java#L520-L521] should be 11 instead of 1, because we don't compact the ten {{[32, 32]}} sstables, but only the the ten {{[31,32]}} and the ten {{[31, 31]}} sstables, is that right?

Probably the issue is on [{{CompactionManger#sstablesInBounds}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L991], where it passes token ranges that exclude the start bound to [{{View.sstablesInBounds}}|https://github.com/apache/cassandra/blob/e4e19e33faf9ac7cf27a9779c8083a7f5c5b865a/src/java/org/apache/cassandra/db/lifecycle/View.java#L181-L185], which includes both bounds.

> forceCompactionForTokenRange when using a wrapped range may include sstables not within that range
> --------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17575
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17575
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Compaction
>            Reporter: David Capwell
>            Priority: Normal
>             Fix For: 4.1-beta, 4.1.x
>
>
> This was found in CASSANDRA-17537
> When you compact the range (32, 31] this should include everything BUT 32, but in the test org.apache.cassandra.db.compaction.LeveledCompactionStrategyTest#testTokenRangeCompaction it found that SSTables with the bounds (32, 32) were getting included in the set of SSTables to compact



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

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