Maxwell-Guo commented on code in PR #2321:
URL: https://github.com/apache/cassandra/pull/2321#discussion_r1193445161
##########
conf/cassandra.yaml:
##########
@@ -1541,7 +1541,8 @@ batch_size_fail_threshold: 50KiB
# Log WARN on any batches not of type LOGGED than span across more partitions
than this limit
unlogged_batch_across_partitions_warn_threshold: 10
-# Log a warning when compacting partitions larger than this value
+# Log a warning when compacting partitions larger than this value.
+# As of Cassandra 5.0, this property is deprecated in favour of
partition_size_warn_threshold.
Review Comment:
can change to "5.0 and later versions ", I think this will be more rigorous
##########
src/java/org/apache/cassandra/io/sstable/format/SortedTableWriter.java:
##########
@@ -324,6 +325,19 @@ protected FileHandle openDataFile(long lengthOverride,
StatsMetadata statsMetada
return dataFile;
}
+ private void guardPartitionSize(DecoratedKey key, long rowSize)
+ {
+ if (Guardrails.partitionSize.triggersOn(rowSize, null))
+ {
+ String what = String.format("%s.%s:%s on sstable %s",
Review Comment:
our experience is we prefer metadata.keyspace + metadata.name +
metadata().partitionKeyType.getString(key.getKey()) +
getFilename() to contact these strings than String.format.
as String.format will cost more time ,But it seems cassandra just use
String.format all time.So this comment can be ignored.
##########
conf/cassandra.yaml:
##########
@@ -1804,6 +1805,15 @@ drop_compact_storage_enabled: false
# write_consistency_levels_warned: []
# write_consistency_levels_disallowed: []
#
+# Guardrail to warn or fail when writing partitions larger than threshold.
+# The guardrail is only checked when writing sstables (flush, compaction,
streaming, etc.), and exceeding the fail
+# threshold on that moment will only log an error message, without
interrupting the operation.
+# This operates on a per-sstable basis, so it won't detect a large partition
if it is spread across multiple sstables.
+# The warning threshold replaces the deprecated config property
compaction_large_partition_warning_threshold.
+# The two thresholds default to null to disable.
Review Comment:
My question is : should we regardless of the stream situation? Because the
stream data is generated by flush and compaction or logging is enough ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]