ascherbakoff commented on code in PR #7244:
URL: https://github.com/apache/ignite-3/pull/7244#discussion_r2630917932
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -1735,6 +1719,24 @@ private void executeApplyingTasks(final
List<LogEntryAndClosure> tasks) {
task.reset();
continue;
}
+
+ // To prevent safe timestamp values from becoming stale, we
must assign them under a valid leader lock.
+ if (task.done instanceof SafeTimeAwareCommandClosure) {
+ SafeTimeAwareCommandClosure clo =
(SafeTimeAwareCommandClosure) task.done;
+ WriteCommand command = clo.command();
+ HybridTimestamp timestamp = command.initiatorTime();
+
+ if (timestamp != null) {
+ if (safeTs == null) {
+ safeTs = clock.update(timestamp);
+ } else if (timestamp.compareTo(safeTs) > 0) {
+ safeTs = clock.update(timestamp);
+ }
+
+ clo.safeTimestamp(safeTs);
+ }
+ }
Review Comment:
🆗
--
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]