cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Jirsa (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-13973) IllegalArgumentException in upgradesstables compaction
Date Mon, 23 Oct 2017 23:23:00 GMT


Jeff Jirsa commented on CASSANDRA-13973:

OK, leaving some quick notes for whoever gets around to handling this (maybe me, not self
assigning because I don't have bandwidth right now, and to be honest I haven't thought about
the right fix yet).

The code here is trying to calculate the serialized size, so it can write the index out as
it rewrites that partition to a data file :

        long size = TypeSizes.sizeofUnsignedVInt(headerLength)
                  + DeletionTime.serializer.serializedSize(deletionTime)
                  + TypeSizes.sizeofUnsignedVInt(columnsIndex.size()); // number of entries
        for (IndexHelper.IndexInfo info : columnsIndex)
            size += idxSerializer.serializedSize(info);
        size += columnsIndex.size() * TypeSizes.sizeof(0);
        return Ints.checkedCast(size);

With 394GB and an index entry every 64k, you're going to write something like {{6169617}}
index markers, and the field there to handle it is a (signed) integer (4 bytes), giving you
a maximum size for all of the index markers of {{2147483648}} , about 348 bytes per marker.
The size of a marker is here: 

                long size = clusteringSerializer.serializedSize(info.firstName)
                          + clusteringSerializer.serializedSize(info.lastName)
                          + TypeSizes.sizeofUnsignedVInt(info.offset)
                          + TypeSizes.sizeofVInt(info.width - WIDTH_BASE)
                          + TypeSizes.sizeof(info.endOpenMarker != null);

                if (info.endOpenMarker != null)
                    size += DeletionTime.serializer.serializedSize(info.endOpenMarker);
                return size;

Note that it has both the first and last clustering within that marker - so for you not to
overflow, assuming no range tombstones which would take up even more space, your clustering
markers would have to average less than ~165 bytes each, which clearly isn't happening, so
we overflow that int and stop.

That's the short version of what's happening. I'm not sure why it's an {{int}} instead of
a {{long}} , and I'm not immediately sure why you're hitting it here with {{upgradesstables}}
when you didn't hit it previously. 

> IllegalArgumentException in upgradesstables compaction
> ------------------------------------------------------
>                 Key: CASSANDRA-13973
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Compaction
>            Reporter: Dan Kinder
> After an upgrade from 2.2.6 to 3.0.15 (sstable version la to mc), when I try to run upgradesstables,
most of them upgrade fine but I see the exception below on several nodes, and it doesn't complete.
> CASSANDRA-12717 looks similar but the stack trace is not the same, so I assumed it is
not identical. The various nodes this happens on all give the same trace.
> Might be notable that this is an analytics cluster with some large partitions, in the
GB size.
> {noformat}
> error: Out of range: 7316844981
> -- StackTrace --
> java.lang.IllegalArgumentException: Out of range: 7316844981
> at
> at org.apache.cassandra.db.RowIndexEntry$IndexedEntry.promotedSize(
> at org.apache.cassandra.db.RowIndexEntry$Serializer.serialize(
> at$IndexWriter.append(
> at
> at
> at
> at org.apache.cassandra.db.compaction.writers.MaxSSTableSizeWriter.realAppend(
> at org.apache.cassandra.db.compaction.writers.CompactionAwareWriter.append(
> at org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(
> at
> at org.apache.cassandra.db.compaction.CompactionTask.executeInternal(
> at org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(
> at org.apache.cassandra.db.compaction.CompactionManager$5.execute(
> at org.apache.cassandra.db.compaction.CompactionManager$
> at
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> at java.util.concurrent.ThreadPoolExecutor$
> at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(
> at
> {noformat}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message