Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
* Add the ability to disable bulk loading of SSTables (CASSANDRA-18781)
* Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787)
Merged from 5.0:
* Optionally force IndexStatusManager to use the optimized index status format (CASSANDRA-21132)
* Automatically disable zero-copy streaming for legacy sstables with old bloom filter format (CASSANDRA-21092)
* Fix CQLSSTableWriter serialization of vector of date and time (CASSANDRA-20979)
* Correctly calculate default for FailureDetector max interval (CASSANDRA-21025)
Expand Down
7 changes: 7 additions & 0 deletions src/java/org/apache/cassandra/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,13 @@ public static void setClientMode(boolean clientMode)
public volatile boolean drop_keyspace_enabled = true;
public volatile boolean secondary_indexes_enabled = true;

/**
* If we encounter a Gossip bug where {@link org.apache.cassandra.gms.Gossiper#getMinVersion} is
* unable to accurately report a minimum version for the cluster, optionally force the optimized
* index status format added in CASSANDRA-20058.
*/
public volatile boolean force_optimized_index_status_format = false;

public volatile String default_secondary_index = CassandraIndex.NAME;
public volatile boolean default_secondary_index_enabled = true;

Expand Down
10 changes: 10 additions & 0 deletions src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -5981,6 +5981,16 @@ public static void setPrioritizeSAIOverLegacyIndex(boolean value)
conf.sai_options.prioritize_over_legacy_index = value;
}

public static boolean getForceOptimizedIndexStatusFormat()
{
return conf.force_optimized_index_status_format;
}

public static void setForceOptimizedIndexStatusFormat(boolean value)
{
conf.force_optimized_index_status_format = value;
}

public static RepairRetrySpec getRepairRetrySpec()
{
return conf == null ? new RepairRetrySpec() : conf.repair.retries;
Expand Down
4 changes: 4 additions & 0 deletions src/java/org/apache/cassandra/index/IndexStatusManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.slf4j.LoggerFactory;

import org.apache.cassandra.concurrent.ExecutorPlus;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.ConsistencyLevel;
import org.apache.cassandra.db.Keyspace;
import org.apache.cassandra.exceptions.ReadFailureException;
Expand Down Expand Up @@ -264,6 +265,9 @@ public synchronized void propagateLocalIndexStatus(String keyspace, String index

private static boolean shouldWriteLegacyStatusFormat(CassandraVersion minVersion)
{
if (DatabaseDescriptor.getForceOptimizedIndexStatusFormat())
return false;

return minVersion == null || (minVersion.major == 5 && minVersion.minor == 0 && minVersion.patch < 3);
}

Expand Down
12 changes: 12 additions & 0 deletions src/java/org/apache/cassandra/service/StorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5718,6 +5718,18 @@ public void setPrioritizeSAIOverLegacyIndex(boolean value)
DatabaseDescriptor.setPrioritizeSAIOverLegacyIndex(value);
}

@Override
public boolean getForceOptimizedIndexStatusFormat()
{
return DatabaseDescriptor.getForceOptimizedIndexStatusFormat();
}

@Override
public void setForceOptimizedIndexStatusFormat(boolean value)
{
DatabaseDescriptor.setForceOptimizedIndexStatusFormat(value);
}

@Override
public void setPaxosRepairRaceWait(boolean paxosRepairRaceWait)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,9 @@ public void enableAuditLog(String loggerName, String includedKeyspaces, String e
boolean getPrioritizeSAIOverLegacyIndex();
void setPrioritizeSAIOverLegacyIndex(boolean value);

boolean getForceOptimizedIndexStatusFormat();
void setForceOptimizedIndexStatusFormat(boolean value);

void setPaxosRepairRaceWait(boolean paxosRepairCoordinatorWait);

boolean getPaxosRepairRaceWait();
Expand Down