You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "aweisberg (via GitHub)" <gi...@apache.org> on 2025/04/23 17:49:06 UTC
[PR] Add testing of consensus live migration to simulator [cassandra-accord]
aweisberg opened a new pull request, #187:
URL: https://github.com/apache/cassandra-accord/pull/187
Patch by Ariel Weisberg; Reviewed by ??? for CASSANDRA-20587
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2121820124
##########
accord-core/src/main/java/accord/coordinate/ExecuteTxn.java:
##########
@@ -236,8 +236,9 @@ protected void onDone(Success success, Throwable failure)
executeAt = new TimestampWithUniqueHlc(executeAt, uniqueHlc);
}
- Writes writes = txnId.is(Txn.Kind.Write) ? txn.execute(txnId, executeAt, data) : null;
+ // Always compute Result before Write
Review Comment:
I meant in the code comment for posterity, but thanks I did also want to know 🙂
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2100317683
##########
accord-core/src/main/java/accord/local/CommandStores.java:
##########
@@ -625,6 +625,10 @@ public AsyncChain<Void> forEach(Consumer<SafeCommandStore> forEach)
Snapshot snapshot = current;
for (ShardHolder shard : snapshot.shards)
list.add(shard.store.build(empty(), forEach));
+
+ if (list.isEmpty())
Review Comment:
I wonder if we should remove the variants of `AsyncChains.reduce` that don't accept `identity` and use this version here. It's a bit brittle, the lack of properly handling no inputs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2100277256
##########
accord-core/src/main/java/accord/coordinate/ExecuteTxn.java:
##########
@@ -236,8 +236,9 @@ protected void onDone(Success success, Throwable failure)
executeAt = new TimestampWithUniqueHlc(executeAt, uniqueHlc);
}
- Writes writes = txnId.is(Txn.Kind.Write) ? txn.execute(txnId, executeAt, data) : null;
+ // Always compute Result before Write
Review Comment:
Explain why?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2100330290
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -687,6 +687,12 @@ public TxnId nextTxnId(Txn.Kind rw, Domain domain, Cardinality cardinality)
return nextTxnId(rw, domain, cardinality, defaultMediumPath().bit());
}
+ public TxnId nextTxnId(Txn.Kind rw, Domain domain, Cardinality cardinality, long minHlc)
+ {
+ Timestamp minTimestamp = Timestamp.fromValues(topology.epoch(), minHlc, 0, id());
Review Comment:
might be cleaner to invoke `newTxnId` directly with the epoch and uniqueNow(minHlc)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2124883704
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -894,6 +900,13 @@ public <R> CoordinationAdapter<R> coordinationAdapter(TxnId txnId, Kind kind)
return coordinationAdapters.get(txnId, kind);
}
+ public void updateMinHlc(long minHlc)
+ {
+ commandStores().forEach(safeStore -> {
Review Comment:
I checked and this we are updating the min HLC from Paxos state tracker as part of updating ranges for epoch as well as before starting each operation in the Accord integration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg merged PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2121811546
##########
accord-core/src/main/java/accord/coordinate/ExecuteTxn.java:
##########
@@ -236,8 +236,9 @@ protected void onDone(Success success, Throwable failure)
executeAt = new TimestampWithUniqueHlc(executeAt, uniqueHlc);
}
- Writes writes = txnId.is(Txn.Kind.Write) ? txn.execute(txnId, executeAt, data) : null;
+ // Always compute Result before Write
Review Comment:
It makes it easier for the integration to do things like evaluate part of the result and logic related to what will happen. The order was switched and that caused the integration to apply transactions when the condition failed. I fixed it so that the integration will tolerate either order, but since this is an easy bug to re-introduce and there isn't a huge cost in saying that `Result` and `Write` will be evaluated in a specific order that it would be better to do that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2100323888
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -894,6 +900,13 @@ public <R> CoordinationAdapter<R> coordinationAdapter(TxnId txnId, Kind kind)
return coordinationAdapters.get(txnId, kind);
}
+ public void updateMinHlc(long minHlc)
+ {
+ commandStores().forEach(safeStore -> {
Review Comment:
do we care that this won't affect new command stores that are added later?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2124883704
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -894,6 +900,13 @@ public <R> CoordinationAdapter<R> coordinationAdapter(TxnId txnId, Kind kind)
return coordinationAdapters.get(txnId, kind);
}
+ public void updateMinHlc(long minHlc)
+ {
+ commandStores().forEach(safeStore -> {
Review Comment:
I checked and it is updating the min HLC from Paxos state tracker as part of updating ranges for epoch in the Accord integration so newly constructed command stores always get it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2121834622
##########
accord-core/src/main/java/accord/local/CommandStores.java:
##########
@@ -625,6 +625,10 @@ public AsyncChain<Void> forEach(Consumer<SafeCommandStore> forEach)
Snapshot snapshot = current;
for (ShardHolder shard : snapshot.shards)
list.add(shard.store.build(empty(), forEach));
+
+ if (list.isEmpty())
Review Comment:
I think that makes sense to an extent, but it does require that the reducer accept `null` and handle it by returning the non-null parameter? Or for everything to have a non-null identity that can be handled correctly. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2100335435
##########
accord-core/src/main/java/accord/local/SafeCommandStore.java:
##########
@@ -303,6 +305,11 @@ public void updateMaxConflicts(Command prev, Command updated)
commandStore().updateMaxConflicts(prev, updated);
}
+ public long maxHLCForSeekables(Routables<?> keysOrRanges)
Review Comment:
simply `maxHlc`? You're accepting `Routables` not `Seekables` and including the type isn't probably necessary anyway. Mostly we have lower cased the `lc` in `Hlc` so far in the codebase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2121975121
##########
accord-core/src/main/java/accord/local/SafeCommandStore.java:
##########
@@ -303,6 +305,11 @@ public void updateMaxConflicts(Command prev, Command updated)
commandStore().updateMaxConflicts(prev, updated);
}
+ public long maxHLCForSeekables(Routables<?> keysOrRanges)
Review Comment:
Unused, removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "aweisberg (via GitHub)" <gi...@apache.org>.
aweisberg commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2121966216
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -894,6 +900,13 @@ public <R> CoordinationAdapter<R> coordinationAdapter(TxnId txnId, Kind kind)
return coordinationAdapters.get(txnId, kind);
}
+ public void updateMinHlc(long minHlc)
+ {
+ commandStores().forEach(safeStore -> {
Review Comment:
Looking into this now, but yes it is a problem if new ones are constructed without getting the min HLC from somewhere.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add testing of consensus live migration to simulator [cassandra-accord]
Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #187:
URL: https://github.com/apache/cassandra-accord/pull/187#discussion_r2100333045
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -687,6 +687,12 @@ public TxnId nextTxnId(Txn.Kind rw, Domain domain, Cardinality cardinality)
return nextTxnId(rw, domain, cardinality, defaultMediumPath().bit());
}
+ public TxnId nextTxnId(Txn.Kind rw, Domain domain, Cardinality cardinality, long minHlc)
+ {
+ Timestamp minTimestamp = Timestamp.fromValues(topology.epoch(), minHlc, 0, id());
Review Comment:
might also be more consistent to accept minHlc as first parameter to match Timestamp min variant below? Or could perhaps introduce a nextTxnId(minEpoch, minHlc, ... to accept both of these variants
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org