[
https://issues.apache.org/jira/browse/CASSANDRA-12979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802971#comment-15802971
]
Nate McCall commented on CASSANDRA-12979:
-----------------------------------------
Some nits:
- (super minor) Looks like an extra line break before this comment {{// Note
that we have removed files that are still marked as compacting.}} on the trunk
patch
- let's do WARN for the message about no space remaining so it's on the same
output as the initial warning message
Otherwise, LGTM (particularly since [~s_delima] is running it in production
already :)
> checkAvailableDiskSpace doesn't update expectedWriteSize when reducing thread
> scope
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-12979
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12979
> Project: Cassandra
> Issue Type: Bug
> Reporter: Jon Haddad
> Assignee: Jon Haddad
> Labels: compaction
> Fix For: 2.2.9, 3.0.11, 4.0, 3.x
>
> Attachments:
> 2.2-Fixed-checkAvailableDiskSpace-to-properly-recalculat.patch,
> 30-Fixed-checkAvailableDiskSpace-to-properly-recalculat.patch,
> trunk-Fixed-checkAvailableDiskSpace-to-properly-recalculat.patch
>
>
> If a compaction occurs that looks like it'll take up more space than
> remaining disk available, the compaction manager attempts to reduce the scope
> of the compaction by calling {{reduceScopeForLimitedSpace()}} repeatedly.
> Unfortunately, the while loop passes the {{estimatedWriteSize}} calculated
> from the original call to {{hasAvailableDiskSpace}}, so the comparisons that
> are done will always be against the size of the original compaction, rather
> than the reduced scope one.
> Full method below:
> {code}
> protected void checkAvailableDiskSpace(long estimatedSSTables, long
> expectedWriteSize)
> {
> if(!cfs.isCompactionDiskSpaceCheckEnabled() && compactionType ==
> OperationType.COMPACTION)
> {
> logger.info("Compaction space check is disabled");
> return;
> }
> while (!getDirectories().hasAvailableDiskSpace(estimatedSSTables,
> expectedWriteSize))
> {
> if (!reduceScopeForLimitedSpace())
> throw new RuntimeException(String.format("Not enough space
> for compaction, estimated sstables = %d, expected write size = %d",
> estimatedSSTables, expectedWriteSize));
>
> }
> }
> {code}
> I'm proposing to recalculate the {{estimatedSSTables}} and
> {{expectedWriteSize}} after each iteration of {{reduceScopeForLimitedSpace}}.
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)