sanpwc commented on code in PR #2820:
URL: https://github.com/apache/ignite-3/pull/2820#discussion_r1391149721
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/PartitionListener.java:
##########
@@ -148,7 +159,17 @@ public void onWrite(Iterator<CommandClosure<WriteCommand>>
iterator) {
iterator.forEachRemaining((CommandClosure<? extends WriteCommand> clo)
-> {
Command command = clo.command();
- // LOG.info("CMD {}", command.getClass().getName());
+ if (command instanceof SafeTimePropagatingCommand) {
+ SafeTimePropagatingCommand cmd = (SafeTimePropagatingCommand)
command;
+ long proposedSafeTime = cmd.safeTime().longValue();
+
+ if (proposedSafeTime > maxObservableSafeTimeVerifier) {
+ maxObservableSafeTimeVerifier = proposedSafeTime;
+ } else {
+ assert false : "Safe time reordering detected [current=" +
maxObservableSafeTimeVerifier
+ + ", proposed=" + proposedSafeTime + "]";
+ }
Review Comment:
> it would be better to remove it altogether.
I don't think so. Given assertion will ease tests failures analysis. In case
of unexpected data we will see whether there was a reordering or not.
> assert roposedSafeTime <= maxObservableSafeTimeVerifier : "Safe time
reordering detected [current=" + maxObservableSafeTimeVerifier + ", proposed="
+ proposedSafeTime + "].";
maxObservableSafeTimeVerifier = proposedSafeTime;
Agreed. Fixed. Except the part that proposed should be greater than
maxObservableSafeTimeVerifier
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]