Vladislav Pyatkov created IGNITE-19990:
------------------------------------------

             Summary: Replication command timestamps
                 Key: IGNITE-19990
                 URL: https://issues.apache.org/jira/browse/IGNITE-19990
             Project: Ignite
          Issue Type: Improvement
            Reporter: Vladislav Pyatkov


*Motivation*
Replication command send and success timestamps are supposed to be cached in 
the primary replica. These timestamps are used to choose which method the safe 
time propagetion is supposed.

*Implementation notes*
* When the node becomes a primary replica for any partition, it initiates 
{{sendTimestamp = null}} and {{successTimestmp=0}}.
* Store the latest timestamp of sending commands in {{sendTimestamp}}.
* Store the latest timestamp of successfully executed commands in 
{{successTimestmp}}.
* The updet of both timestamps is supposed to be atomic:
{code}
public boolean setIfGreater(AtomicLong sentTime, long ts) {
  return sentTime.updateAndGet(x -> x < ts ? ts : x) == ts;
}
{code}

*Disinition of done*
If a primary replica has not applied any operations, {{sendTimestamp}} is 
{{null}}. Otherwise, in an arbitrary moment, {{sendTimestamp}} has to be 
greater than or equivalent to {{successTimestmp}} or it is {{null}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to