Merge branch 'cassandra-3.0' into cassandra-3.11

This commit is contained in:
Aleksey Yeshchenko 2018-04-18 11:31:51 +01:00
commit 35823fcefd
3 changed files with 42 additions and 2 deletions

View File

@ -10,6 +10,8 @@
* RateBasedBackPressure unnecessarily invokes a lock on the Guava RateLimiter (CASSANDRA-14163)
* Fix wildcard GROUP BY queries (CASSANDRA-14209)
Merged from 3.0:
* Deprecate background repair and probablistic read_repair_chance table options
(CASSANDRA-13910)
* Add missed CQL keywords to documentation (CASSANDRA-14359)
* Fix unbounded validation compactions on repair / revert CASSANDRA-13797 (CASSANDRA-14332)
* Avoid deadlock when running nodetool refresh before node is fully up (CASSANDRA-14310)

View File

@ -52,6 +52,12 @@ Upgrading
- Changes to bloom_filter_fp_chance will no longer take effect on existing sstables when the node is restarted. Only
compactions/upgradesstables regenerates bloom filters and Summaries sstable components. See CASSANDRA-11163
Deprecation
-----------
- Background read repair has been deprecated. dclocal_read_repair_chance and
read_repair_chance table options have been deprecated, and will be removed entirely in 4.0.
See CASSANDRA-13910 for details.
3.11.2
======

View File

@ -27,6 +27,7 @@ import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.exceptions.SyntaxException;
import org.apache.cassandra.schema.*;
import org.apache.cassandra.schema.TableParams.Option;
import org.apache.cassandra.service.ClientWarn;
import static java.lang.String.format;
@ -36,6 +37,8 @@ public final class TableAttributes extends PropertyDefinitions
private static final Set<String> validKeywords;
private static final Set<String> obsoleteKeywords;
private static boolean loggedReadRepairChanceDeprecationWarnings;
static
{
ImmutableSet.Builder<String> validBuilder = ImmutableSet.builder();
@ -105,7 +108,17 @@ public final class TableAttributes extends PropertyDefinitions
}
if (hasOption(Option.DCLOCAL_READ_REPAIR_CHANCE))
builder.dcLocalReadRepairChance(getDouble(Option.DCLOCAL_READ_REPAIR_CHANCE));
{
double chance = getDouble(Option.DCLOCAL_READ_REPAIR_CHANCE);
if (chance != 0.0)
{
ClientWarn.instance.warn("dclocal_read_repair_chance table option has been deprecated and will be removed in version 4.0");
maybeLogReadRepairChanceDeprecationWarning();
}
builder.dcLocalReadRepairChance(chance);
}
if (hasOption(Option.DEFAULT_TIME_TO_LIVE))
builder.defaultTimeToLive(getInt(Option.DEFAULT_TIME_TO_LIVE));
@ -123,7 +136,17 @@ public final class TableAttributes extends PropertyDefinitions
builder.minIndexInterval(getInt(Option.MIN_INDEX_INTERVAL));
if (hasOption(Option.READ_REPAIR_CHANCE))
builder.readRepairChance(getDouble(Option.READ_REPAIR_CHANCE));
{
double chance = getDouble(Option.READ_REPAIR_CHANCE);
if (chance != 0.0)
{
ClientWarn.instance.warn("read_repair_chance table option has been deprecated and will be removed in version 4.0");
maybeLogReadRepairChanceDeprecationWarning();
}
builder.readRepairChance(chance);
}
if (hasOption(Option.SPECULATIVE_RETRY))
builder.speculativeRetry(SpeculativeRetryParam.fromString(getString(Option.SPECULATIVE_RETRY)));
@ -137,6 +160,15 @@ public final class TableAttributes extends PropertyDefinitions
return builder.build();
}
private void maybeLogReadRepairChanceDeprecationWarning()
{
if (!loggedReadRepairChanceDeprecationWarnings)
{
logger.warn("dclocal_read_repair_chance and read_repair_chance table options have been deprecated and will be removed in version 4.0");
loggedReadRepairChanceDeprecationWarnings = true;
}
}
private Double getDeprecatedCrcCheckChance(Map<String, String> compressionOpts)
{
String value = compressionOpts.get(Option.CRC_CHECK_CHANCE.toString().toLowerCase());