This is an automated email from the ASF dual-hosted git repository. marcuse pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new 3bb8f88 CASSANDRA-14935 followup, replace leftover todos with comments 3bb8f88 is described below commit 3bb8f88c85d35667a530254015e8b1b52f7a7a0c Author: Marcus Eriksson <marc...@apache.org> AuthorDate: Thu Jan 17 09:16:01 2019 +0100 CASSANDRA-14935 followup, replace leftover todos with comments --- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- src/java/org/apache/cassandra/db/compaction/ActiveCompactions.java | 6 +++++- src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java index adac934..b9809e2 100644 --- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java +++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java @@ -2201,7 +2201,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean : concatWithIndexes(); for (ColumnFamilyStore cfs : selfWithAuxiliaryCfs) - cfs.getCompactionStrategyManager().pause(); // todo: make sure anticompaction pauses! + cfs.getCompactionStrategyManager().pause(); try { // interrupt in-progress compactions diff --git a/src/java/org/apache/cassandra/db/compaction/ActiveCompactions.java b/src/java/org/apache/cassandra/db/compaction/ActiveCompactions.java index b289ef9..bba0601 100644 --- a/src/java/org/apache/cassandra/db/compaction/ActiveCompactions.java +++ b/src/java/org/apache/cassandra/db/compaction/ActiveCompactions.java @@ -48,12 +48,16 @@ public class ActiveCompactions implements ActiveCompactionsTracker CompactionManager.instance.getMetrics().totalCompactionsCompleted.mark(); } + /** + * Iterates over the active compactions and tries to find the CompactionInfo for the given sstable + * + * Number of entries in compactions should be small (< 10) but avoid calling in any time-sensitive context + */ public CompactionInfo getCompactionForSSTable(SSTableReader sstable) { CompactionInfo toReturn = null; for (CompactionInfo.Holder holder : compactions) { - // todo: change compactions datastructure to avoid iterating all active compactions if (holder.getCompactionInfo().getSSTables().contains(sstable)) { if (toReturn != null) diff --git a/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java b/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java index 6040ea8..029ba59 100644 --- a/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java +++ b/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java @@ -188,6 +188,8 @@ public class PendingAntiCompaction // up to a minute, after which point, null will be returned try { + // Note that anticompactions are not disabled when running this. This is safe since runWithCompactionsDisabled + // is synchronized - acquireTuple and predicate can only be run by a single thread (for the given cfs). return cfs.runWithCompactionsDisabled(this::acquireTuple, predicate, false, false); } catch (SSTableAcquisitionException e) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org