Ninja for CASSANDRA-19305: Disable EphemeralRead by default to get benchmarks stable

This commit is contained in:
ci worker 2024-03-28 20:03:39 -07:00 committed by David Capwell
parent 7dadc080cb
commit 333c748a91
4 changed files with 11 additions and 3 deletions

View File

@ -69,4 +69,5 @@ public class AccordSpec
* default transactional mode for tables created by this node when no transactional mode has been specified in the DDL * default transactional mode for tables created by this node when no transactional mode has been specified in the DDL
*/ */
public TransactionalMode default_transactional_mode = TransactionalMode.off; public TransactionalMode default_transactional_mode = TransactionalMode.off;
public boolean ephemeralReadEnabled = false;
} }

View File

@ -5810,4 +5810,9 @@ public class DatabaseDescriptor
{ {
conf.paxos_repair_race_wait = paxosRepairRaceWait; conf.paxos_repair_race_wait = paxosRepairRaceWait;
} }
public static boolean getAccordEphemeralReadEnabledEnabled()
{
return conf.accord.ephemeralReadEnabled;
}
} }

View File

@ -332,8 +332,10 @@ public class TransactionStatement implements CQLStatement.CompositeCQLStatement,
List<TxnNamedRead> reads = createNamedReads(options, state, ImmutableMap.of(), keySet::add); List<TxnNamedRead> reads = createNamedReads(options, state, ImmutableMap.of(), keySet::add);
Keys txnKeys = toKeys(keySet); Keys txnKeys = toKeys(keySet);
TxnRead read = createTxnRead(reads, txnKeys, null); TxnRead read = createTxnRead(reads, txnKeys, null);
Txn.Kind kind = txnKeys.size() == 1 && transactionalModeForSingleKey(txnKeys) == TransactionalMode.full Txn.Kind kind = txnKeys.size() == 1
? EphemeralRead : Read; && transactionalModeForSingleKey(txnKeys) == TransactionalMode.full
&& DatabaseDescriptor.getAccordEphemeralReadEnabledEnabled()
? EphemeralRead : Read;
return new Txn.InMemory(kind, txnKeys, read, TxnQuery.ALL, null); return new Txn.InMemory(kind, txnKeys, read, TxnQuery.ALL, null);
} }
else else

View File

@ -2053,7 +2053,7 @@ public class StorageProxy implements StorageProxyMBean
consistencyLevel = transactionalMode.readCLForStrategy(consistencyLevel); consistencyLevel = transactionalMode.readCLForStrategy(consistencyLevel);
TxnRead read = TxnRead.createSerialRead(readCommand, consistencyLevel); TxnRead read = TxnRead.createSerialRead(readCommand, consistencyLevel);
Invariants.checkState(read.keys().size() == 1, "Ephemeral reads are only strict-serializable for single partition reads"); Invariants.checkState(read.keys().size() == 1, "Ephemeral reads are only strict-serializable for single partition reads");
Txn txn = new Txn.InMemory(transactionalMode == TransactionalMode.full ? EphemeralRead : Read, read.keys(), read, TxnQuery.ALL, null); Txn txn = new Txn.InMemory(transactionalMode == TransactionalMode.full && DatabaseDescriptor.getAccordEphemeralReadEnabledEnabled() ? EphemeralRead : Read, read.keys(), read, TxnQuery.ALL, null);
IAccordService accordService = AccordService.instance(); IAccordService accordService = AccordService.instance();
TxnResult txnResult = accordService.coordinate(txn, consistencyLevel, requestTime); TxnResult txnResult = accordService.coordinate(txn, consistencyLevel, requestTime);
if (txnResult.kind() == retry_new_protocol) if (txnResult.kind() == retry_new_protocol)