Skip to content

Commit 52a3e80

Browse files
eolivellidjatnieks
authored andcommitted
CNDB-12956: Vector CC Release Issue: Tenant Assignment Failure on Kube AWS 701031671627: The minimum sstable size 1.000GiB cannot be larger than the target size's lower bound 724.077MiB (#1567)
…e AWS 701031671627: The minimum sstable size 1.000GiB cannot be larger than the target size's lower bound 724.077MiB Revert "CNDB-10455: Automatically tune compaction for vector tables (#1265)" This reverts commit 8305834. see CNDB-12956
1 parent 49a57a7 commit 52a3e80

File tree

12 files changed

+25
-454
lines changed

12 files changed

+25
-454
lines changed

src/java/org/apache/cassandra/config/CassandraRelevantProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,10 +875,10 @@ public enum CassandraRelevantProperties
875875
UCS_RESERVATIONS_TYPE_OPTION("unified_compaction.reservations_type_option", Reservations.Type.LEVEL_OR_BELOW.name()),
876876
UCS_RESERVED_THREADS("reserved_threads", "max"),
877877
UCS_SHARED_STORAGE("unified_compaction.shared_storage", "false"),
878-
UCS_SSTABLE_GROWTH("unified_compaction.sstable_growth", "0.333"),
878+
UCS_SSTABLE_GROWTH("unified_compaction.sstable_growth", "0.5"),
879879
UCS_STATIC_SCALING_PARAMETERS("unified_compaction.scaling_parameters", "T4"),
880880
UCS_SURVIVAL_FACTOR("unified_compaction.survival_factor", "1"),
881-
UCS_TARGET_SSTABLE_SIZE("unified_compaction.target_sstable_size", "1GiB"),
881+
UCS_TARGET_SSTABLE_SIZE("unified_compaction.target_sstable_size", "5GiB"),
882882
UCS_VECTOR_BASE_SHARD_COUNT("unified_compaction.vector_base_shard_count", "1"),
883883
UCS_VECTOR_MIN_SSTABLE_SIZE("unified_compaction.vector_min_sstable_size", "1024MiB"),
884884
UCS_VECTOR_RESERVED_THREADS("unified_compaction.vector_reserved_threads", "max"),

src/java/org/apache/cassandra/db/compaction/UnifiedCompactionContainer.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class UnifiedCompactionContainer implements CompactionStrategyContainer
5050
private final CompactionParams metadataParams;
5151
private final UnifiedCompactionStrategy strategy;
5252
private final boolean enableAutoCompaction;
53-
private final boolean hasVector;
5453

5554
AtomicBoolean enabled;
5655

@@ -67,7 +66,6 @@ public class UnifiedCompactionContainer implements CompactionStrategyContainer
6766
this.strategy = new UnifiedCompactionStrategy(factory, backgroundCompactions, params.options());
6867
this.enabled = new AtomicBoolean(enabled);
6968
this.enableAutoCompaction = enableAutoCompaction;
70-
this.hasVector = strategy.getController().hasVectorType();
7169

7270
factory.getCompactionLogger().strategyCreated(this.strategy);
7371

@@ -144,14 +142,6 @@ public CompactionStrategyContainer reload(@Nonnull CompactionStrategyContainer p
144142
return create(previous, factory, compactionParams, reason, enableAutoCompaction);
145143
}
146144

147-
@Override
148-
public boolean shouldReload(CompactionParams params, ReloadReason reason)
149-
{
150-
return reason != CompactionStrategyContainer.ReloadReason.METADATA_CHANGE
151-
|| !params.equals(getMetadataCompactionParams())
152-
|| hasVector != factory.getRealm().metadata().hasVectorType();
153-
}
154-
155145
private static CompactionParams createMetadataParams(@Nullable CompactionStrategyContainer previous,
156146
CompactionParams compactionParams,
157147
ReloadReason reason)

src/java/org/apache/cassandra/db/compaction/UnifiedCompactionStrategy.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,6 @@ the span of the lower-density ones.
463463

464464
UCS accepts these compaction strategy parameters:
465465

466-
* `override_ucs_config_for_vector_tables` Allows different configurations for vector and non-vector tables. When set
467-
to `true`, if a table has a column of `VectorType`, the "vector" parameters will be used instead of the regular
468-
parameters. For example, `vector_min_sstable_size` will be used, and `min_sstable_size` will be ignored.
469-
The default value is `false` which disables this feature.
470466
* `scaling_parameters` A list of per-level scaling parameters, specified as L*f*, T*f*, N, or an integer value
471467
specifying $w$ directly. If more levels are present than the length of this list, the last value is used for all
472468
higher levels. Often this will be a single parameter, specifying the behaviour for all levels of the
@@ -481,8 +477,6 @@ UCS accepts these compaction strategy parameters:
481477
compaction to be promoted to the next level) and a fan factor of 2. This can also be specified as T2 or L2.
482478
The default value is T4, matching the default STCS behaviour with threshold 4. To select an equivalent of LCS
483479
with its default fan factor 10, use L10.
484-
* `vector_scaling_parameters` A list of per-level scaling parameters used for vector tables when `override_ucs_config_for_vector_tables=true`.
485-
The default value is -8 or L10.
486480
* `target_sstable_size` The target sstable size $t$, specified as a human-friendly size in bytes (e.g. 100 MiB =
487481
$100\cdot 2^{20}$ B or (10 MB = 10,000,000 B)). The strategy will split data in shards that aim to produce sstables
488482
of size between $t / \sqrt 2$ and $t \cdot \sqrt 2$.
@@ -491,14 +485,10 @@ UCS accepts these compaction strategy parameters:
491485
Increase this if the memory pressure from the number of sstables in the system becomes too high. Also see
492486
`sstable_growth` below.
493487
The default value is 1 GiB.
494-
* `vector_target_sstable_size` The target sstable size used for vector tables when `override_ucs_config_for_vector_tables=true`.
495-
The default value is 5GiB.
496488
* `base_shard_count` The minimum number of shards $b$, used for levels with the smallest density. This gives the
497489
minimum compaction concurrency for the lowest levels. A low number would result in larger L0 sstables but may limit
498490
the overall maximum write throughput (as every piece of data has to go through L0). The base shard count only applies after `min_sstable_size` is reached.
499491
The default value is 4 for all tables.
500-
* `vector_base_shard_count` The base shard count used for vector tables when `override_ucs_config_for_vector_tables=true`.
501-
The default value is 1.
502492
* `sstable_growth` The sstable growth component $\lambda$, applied as a factor in the shard exponent calculation.
503493
This is a number between 0 and 1 that controls what part of the density growth should apply to individual sstable
504494
size and what part should increase the number of shards. Using a value of 1 has the effect of fixing the shard
@@ -513,23 +503,17 @@ UCS accepts these compaction strategy parameters:
513503
two can be further tweaked by increasing $\lambda$ to get fewer but bigger sstables on the top level, and decreasing
514504
it to favour a higher count of smaller sstables.
515505
The default value is 0.333 meaning the sstable size grows with the square root of the growth of the shard count.
516-
* `vector_sstable_growth` The sstable growth component used for vector tables when `override_ucs_config_for_vector_tables=true`.
517-
The default value is 1 which means the shard count will be fixed to the base value.
518506
* `min_sstable_size` The minimum sstable size $m$, applicable when the base shard count will result is sstables
519507
that are considered too small. If set, the strategy will split the space into fewer than the base count shards, to
520508
make the estimated sstables size at least as large as this value. A value of 0 disables this feature. A value of `auto` sets the minimum sstable size to the size
521509
of sstables resulting from flushes. The default value is 100MiB.
522-
* `vector_min_sstable_size` The minimum sstable size used for vector tables when `override_ucs_config_for_vector_tables=true`.
523-
The default value is 1024MiB.
524510
* `reserved_threads` Specifies the number of threads to reserve per level. Any remaining threads will take
525511
work according to the prioritization mechanism (i.e. higher overlap first). Higher reservations mean better
526512
responsiveness of the compaction strategy to new work, or smoother performance, at the expense of reducing the
527513
overall utilization of compaction threads. Higher values work best with high `concurrent_compactors` values.
528514
The default value is `max`, which spreads all threads as close to evenly between levels as possible. It is recommended
529515
to keep this option and the next at their defaults, which should offer a good balance between responsiveness and
530516
thread utilization.
531-
* `vector_reserved_threads` Specifies the number of threads to reserve per level for vector tables when `override_ucs_config_for_vector_tables=true`.
532-
The default value is `max`.
533517
* `reservations_type` Specifies whether reservations can be used by lower levels. If set to `per_level`, the
534518
reservations are only used by the specific level. If set to `level_or_below`, the reservations can be used by this
535519
level as well as any one below it.

src/java/org/apache/cassandra/db/compaction/unified/AdaptiveController.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public AdaptiveController(MonotonicClock clock,
122122
Reservations.Type reservationsType,
123123
Overlaps.InclusionMethod overlapInclusionMethod,
124124
boolean parallelizeOutputShards,
125-
boolean hasVectorType,
126125
int intervalSec,
127126
int minScalingParameter,
128127
int maxScalingParameter,
@@ -150,8 +149,7 @@ public AdaptiveController(MonotonicClock clock,
150149
reservedThreadsPerLevel,
151150
reservationsType,
152151
overlapInclusionMethod,
153-
parallelizeOutputShards,
154-
hasVectorType);
152+
parallelizeOutputShards);
155153

156154
this.scalingParameters = scalingParameters;
157155
this.previousScalingParameters = previousScalingParameters;
@@ -180,9 +178,8 @@ static Controller fromOptions(Environment env,
180178
double sstableGrowthModifier,
181179
int reservedThreadsPerLevel,
182180
Reservations.Type reservationsType,
183-
Overlaps.InclusionMethod overlapInclusionMethod,
184181
boolean parallelizeOutputShards,
185-
boolean hasVectorType,
182+
Overlaps.InclusionMethod overlapInclusionMethod,
186183
String keyspaceName,
187184
String tableName,
188185
Map<String, String> options)
@@ -282,7 +279,6 @@ else if (staticScalingFactors != null)
282279
reservationsType,
283280
overlapInclusionMethod,
284281
parallelizeOutputShards,
285-
hasVectorType,
286282
intervalSec,
287283
minScalingParameter,
288284
maxScalingParameter,
@@ -330,9 +326,6 @@ else if (staticScalingFactors != null)
330326
parseScalingParameters(staticScalingFactors);
331327
else if (staticScalingParameters != null)
332328
parseScalingParameters(staticScalingParameters);
333-
String vectorScalingParameters = options.remove(VECTOR_SCALING_PARAMETERS_OPTION);
334-
if (vectorScalingParameters != null)
335-
throw new ConfigurationException(String.format("%s option is not supported with Adaptive UCS", VECTOR_SCALING_PARAMETERS_OPTION));
336329
s = options.remove(MIN_SCALING_PARAMETER);
337330
if (s != null)
338331
minScalingParameter = Integer.parseInt(s);

0 commit comments

Comments
 (0)