Skip to content

Commit 5634d4e

Browse files
committed
Merge branch 'cassandra-6.0' into trunk
2 parents 32826fe + 4930ae0 commit 5634d4e

7 files changed

Lines changed: 13 additions & 25 deletions

File tree

src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,6 @@ public void truncate()
12631263
@Override
12641264
public void collect(PartitionsCollector collector)
12651265
{
1266-
int nodeId = AccordService.unsafeInstance().nodeId().id;
12671266
tracing().forEach(id -> true, (txnId, events) -> {
12681267
events.forEach(e -> {
12691268
if (e.messages().isEmpty())

src/java/org/apache/cassandra/service/accord/AccordService.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ private enum State { INIT, STARTING, STARTED, STOPPED, SHUTTING_DOWN, SHUTDOWN }
309309
// tests can specify a DelegatingService if they want to override
310310
private static IAccordService instance;
311311
private static IAccordService unsafeInstance;
312+
private static volatile Node.Id nodeId;
312313
private static volatile IAccordService requestInstance;
313314
private static volatile IAccordService replyInstance;
314315

@@ -378,6 +379,7 @@ public synchronized static void localStartup(NodeId tcmId)
378379
}
379380
else
380381
{
382+
nodeId = new Node.Id(tcmId.id());
381383
AccordService as = new AccordService(tcmIdToAccord(tcmId));
382384
unsafeInstance = replyInstance = as;
383385
as.localStartup();
@@ -438,6 +440,11 @@ public static IAccordService unsafeInstance()
438440
return i;
439441
}
440442

443+
public static Node.Id nodeId()
444+
{
445+
return nodeId;
446+
}
447+
441448
public static boolean started()
442449
{
443450
if (!DatabaseDescriptor.getAccordTransactionsEnabled())
@@ -513,7 +520,7 @@ public static void applyProtocolModifiers(AccordConfig config)
513520
if (config.send_stable != null)
514521
ProtocolModifiers.Configure.setSendStableMessages(config.send_stable);
515522
if (config.send_minimal != null)
516-
ProtocolModifiers.Configure.setSendMinimalCommits(config.send_minimal);
523+
ProtocolModifiers.Configure.setSendMinimal(config.send_minimal);
517524
}
518525

519526
@Override
@@ -1306,11 +1313,6 @@ public AccordScheduler scheduler()
13061313
return scheduler;
13071314
}
13081315

1309-
public Id nodeId()
1310-
{
1311-
return node.id();
1312-
}
1313-
13141316
@Override
13151317
public long minEpoch()
13161318
{

src/java/org/apache/cassandra/service/accord/IAccordService.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ public AccordCompactionInfos(DurableBefore durableBefore, long minEpoch, AccordC
181181

182182
Agent agent();
183183

184-
Id nodeId();
185-
186184
long minEpoch();
187185

188186
void awaitDone(TableId id, long epoch);
@@ -338,12 +336,6 @@ public Agent agent()
338336
return null;
339337
}
340338

341-
@Override
342-
public Id nodeId()
343-
{
344-
throw new UnsupportedOperationException();
345-
}
346-
347339
@Override
348340
public long minEpoch()
349341
{
@@ -548,12 +540,6 @@ public Agent agent()
548540
return delegate.agent();
549541
}
550542

551-
@Override
552-
public Id nodeId()
553-
{
554-
return delegate.nodeId();
555-
}
556-
557543
@Override
558544
public long minEpoch()
559545
{

src/java/org/apache/cassandra/service/accord/interop/AccordInteropApply.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
import org.apache.cassandra.db.ConsistencyLevel;
5151
import org.apache.cassandra.service.accord.AccordMessageSink.AccordMessageType;
52+
import org.apache.cassandra.service.accord.AccordService;
5253
import org.apache.cassandra.service.accord.serializers.ApplySerializers.ApplySerializer;
5354
import org.apache.cassandra.service.accord.serializers.IVersionedSerializer;
5455
import org.apache.cassandra.service.accord.txn.AccordUpdate;
@@ -71,7 +72,7 @@ public class AccordInteropApply extends Apply implements LocalListeners.ComplexL
7172
@Override
7273
public Apply create(Kind kind, Id to, Topologies participates, TxnId txnId, Ballot ballot, Route<?> route, Txn txn, Timestamp executeAt, Deps deps, Writes writes, Result result, FullRoute<?> fullRoute, ExecuteFlags flags)
7374
{
74-
checkArgument(kind != Kind.Maximal, "Shouldn't need to send a maximal commit with interop support");
75+
checkArgument(kind != Kind.Maximal || to.equals(AccordService.nodeId()), "Shouldn't need to send a maximal commit with interop support");
7576
ConsistencyLevel commitCL = txn.update() instanceof AccordUpdate ? ((AccordUpdate) txn.update()).cassandraCommitCL() : null;
7677
// Any asynchronous apply option should use the regular Apply that doesn't wait for writes to complete
7778
if (commitCL == null || commitCL == ConsistencyLevel.ANY)

src/java/org/apache/cassandra/service/reads/repair/BlockingReadRepair.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ private void repairViaAccordTransaction(DecoratedKey dk, Map<Replica, Mutation>
228228
Keys keys = Keys.of(partitionKey);
229229
// This is going create a new BlockingReadRepair inside an Accord transaction which will go down
230230
// the !isEventuallyConsistent path and apply the repairs through Accord command stores using AccordInteropExecution
231-
UnrecoverableRepairUpdate<E, P> repairUpdate = new UnrecoverableRepairUpdate(AccordService.instance().nodeId(), this, keys, dk, accordMutations, writePlan);
231+
UnrecoverableRepairUpdate<E, P> repairUpdate = new UnrecoverableRepairUpdate(AccordService.nodeId(), this, keys, dk, accordMutations, writePlan);
232232

233233
/*
234234
* The motivation for using a read to apply read repair is that we want to apply the writes in the execute phase

test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ public ClusterSimulation(RandomSource random, long seed, int uniqueNum,
887887
.set("commitlog_compression", new ParameterizedClass(LZ4Compressor.class.getName(), emptyMap()))
888888
.set("commitlog_sync", "batch")
889889
.set("accord.journal.flush_mode", "BATCH")
890-
.set("accord.accurate_micros", "false")
890+
.set("accord.precise_micros", "false")
891891
.set("accord.command_store_shard_count", "4");
892892

893893
if (memtableType.equals("TrieMemtable"))

0 commit comments

Comments
 (0)