mirror of https://github.com/apache/cassandra
Merge c2095041cd into a3ec88632d
This commit is contained in:
commit
51ddba5514
|
|
@ -6,6 +6,7 @@
|
|||
* Allow nodetool garbagecollect to take a user defined list of SSTables (CASSANDRA-16767)
|
||||
* Add a guardrail for misprepared statements (CASSANDRA-21139)
|
||||
Merged from 6.0:
|
||||
* Reduce allocations in DefaultQueryOptions (CASSANDRA-21467)
|
||||
* Reduce number of scheduledTasks on metric id release in ThreadLocalMetrics (CASSANDRA-21475)
|
||||
* Cache various Enum.values() used in deserialization to avoid per-read array allocation (CASSANDRA-21528)
|
||||
* Fix Accord transaction error message when altering a table (CASSANDRA-20580)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ import org.apache.cassandra.config.Config.DiskAccessMode;
|
|||
import org.apache.cassandra.config.Config.PaxosOnLinearizabilityViolation;
|
||||
import org.apache.cassandra.config.Config.PaxosStatePurging;
|
||||
import org.apache.cassandra.config.DurationSpec.IntMillisecondsBound;
|
||||
import org.apache.cassandra.cql3.QueryOptions;
|
||||
import org.apache.cassandra.db.ConsistencyLevel;
|
||||
import org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager;
|
||||
import org.apache.cassandra.db.commitlog.CommitLog;
|
||||
|
|
@ -273,6 +274,8 @@ public class DatabaseDescriptor
|
|||
|
||||
public static volatile boolean allowUnlimitedConcurrentValidations = ALLOW_UNLIMITED_CONCURRENT_VALIDATIONS.getBoolean();
|
||||
|
||||
private static volatile QueryOptions.DefaultReadThresholds defaultReadThresholds;
|
||||
|
||||
/**
|
||||
* RetryStrategy which provides exponential backoff with full jitter, for use by both CMS and non-CMS members
|
||||
* when submitting a Commit request. The range and increments of the backoff times are defined by
|
||||
|
|
@ -332,6 +335,7 @@ public class DatabaseDescriptor
|
|||
private static void clear()
|
||||
{
|
||||
sstableFormats = null;
|
||||
defaultReadThresholds = null;
|
||||
clearMBean("org.apache.cassandra.db:type=DynamicEndpointSnitch");
|
||||
clearMBean("org.apache.cassandra.db:type=EndpointSnitchInfo");
|
||||
clearMBean("org.apache.cassandra.db:type=LocationInfo");
|
||||
|
|
@ -5571,6 +5575,14 @@ public class DatabaseDescriptor
|
|||
return conf.invalid_legacy_protocol_magic_no_spam_enabled;
|
||||
}
|
||||
|
||||
public static QueryOptions.DefaultReadThresholds getDefaultReadThresholds()
|
||||
{
|
||||
if (defaultReadThresholds == null)
|
||||
defaultReadThresholds = new QueryOptions.DefaultReadThresholds(getCoordinatorReadSizeWarnThreshold(),
|
||||
getCoordinatorReadSizeFailThreshold());
|
||||
return defaultReadThresholds;
|
||||
}
|
||||
|
||||
public static boolean getReadThresholdsEnabled()
|
||||
{
|
||||
return conf.read_thresholds_enabled;
|
||||
|
|
@ -5595,6 +5607,7 @@ public class DatabaseDescriptor
|
|||
{
|
||||
logger.info("updating coordinator_read_size_warn_threshold to {}", value);
|
||||
conf.coordinator_read_size_warn_threshold = value;
|
||||
defaultReadThresholds = null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
@ -5607,6 +5620,7 @@ public class DatabaseDescriptor
|
|||
{
|
||||
logger.info("updating coordinator_read_size_fail_threshold to {}", value);
|
||||
conf.coordinator_read_size_fail_threshold = value;
|
||||
defaultReadThresholds = null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ public abstract class QueryOptions implements RealTimeFunctionContext
|
|||
// if daemon initialization hasn't happened yet (very common in tests) then ignore
|
||||
if (!DatabaseDescriptor.isDaemonInitialized() || !DatabaseDescriptor.getReadThresholdsEnabled())
|
||||
return DisabledReadThresholds.INSTANCE;
|
||||
return new DefaultReadThresholds(DatabaseDescriptor.getCoordinatorReadSizeWarnThreshold(), DatabaseDescriptor.getCoordinatorReadSizeFailThreshold());
|
||||
return DatabaseDescriptor.getDefaultReadThresholds();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -349,7 +349,7 @@ public abstract class QueryOptions implements RealTimeFunctionContext
|
|||
}
|
||||
}
|
||||
|
||||
private static class DefaultReadThresholds implements ReadThresholds
|
||||
public static class DefaultReadThresholds implements ReadThresholds
|
||||
{
|
||||
private final long warnThresholdBytes;
|
||||
private final long abortThresholdBytes;
|
||||
|
|
|
|||
|
|
@ -198,6 +198,8 @@ public class DatabaseDescriptorRefTest
|
|||
"org.apache.cassandra.config.YamlConfigurationLoader$CustomConstructor",
|
||||
"org.apache.cassandra.config.YamlConfigurationLoader$PropertiesChecker",
|
||||
"org.apache.cassandra.config.YamlConfigurationLoader$PropertiesChecker$1",
|
||||
"org.apache.cassandra.cql3.QueryOptions$DefaultReadThresholds",
|
||||
"org.apache.cassandra.cql3.QueryOptions$ReadThresholds",
|
||||
"org.apache.cassandra.db.ConsistencyLevel",
|
||||
"org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager",
|
||||
"org.apache.cassandra.db.commitlog.CommitLog",
|
||||
|
|
|
|||
Loading…
Reference in New Issue