[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-10-16 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Reviewer: Roman Puchkovskiy

> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Bug
>Reporter: Alexander Lapin
>Assignee: Alexander Lapin
>Priority: Blocker
>  Labels: ignite-3, transactions
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
> h3. Implementation Notes
> Different options are possible:
>  # We may reject a command that is associated with safeTime < already applied 
> one. Such approach requires
>  ## To resend the command with new safeTime in case of 1pc.
>  ## Adjust local safeTime, and resend command with new safe time in case of 
> 2pc.
>  # Add proper synchronization both on client and server side.
>  # Send pending safeTime instances with each command. More details below:
> Let’s assume that there were two updateCommands cmd1(safeTime: t1) and 
> cmd2(safeTime: t2). Let’s also assume that cmd2 was send prior to cmd2 
> (meaning that it was reordered). In that case, assuming that cmd2 has both t1 
> and t2 within its data bag, it will wait for cmd1 to bring it data in a queue 
> or formally it will wait previous commands to apply themselves.
>  



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


[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-09-20 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Description: 
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}

 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

h3. Implementation Notes

Different options are possible:
 # We may reject a command that is associated with safeTime < already applied 
one. Such approach requires

 ## To resend the command with new safeTime in case of 1pc.

 ## Adjust local safeTime, and resend command with new safe time in case of 2pc.

 # Add proper synchronization both on client and server side.

 # Send pending safeTime instances with each command. More details below:

Let’s assume that there were two updateCommands cmd1(safeTime: t1) and 
cmd2(safeTime: t2). Let’s also assume that cmd2 was send prior to cmd2 (meaning 
that it was reordered). In that case, assuming that cmd2 has both t1 and t2 
within its data bag, it will wait for cmd1 to bring it data in a queue or 
formally it will wait previous commands to apply themselves.

 

  was:
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}
 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

 


> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Bug
>Reporter: Alexander Lapin
>Priority: Blocker
>  Labels: ignite-3, transactions
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
> h3. Implementation Notes
> Different options are possible:
>  # We may reject a command that is associated with safeTime < already applied 
> one. Such approach requires
>  ## To resend the command with new safeTime in case of 1pc.
>  ## Adjust local safeTime, and resend command with new safe time in case of 
> 2pc.
>  # Add proper synchronization both on client and server side.
>  # Send 

[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-08-01 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Description: 
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}
 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

 

  was:
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)

{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}
 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

 


> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Bug
>Reporter: Alexander Lapin
>Priority: Blocker
>  Labels: ignite-3, transactions
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
>  



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


[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-08-01 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Description: 
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)

{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}
 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

 

  was:
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)

{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}

 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to add an assert that will verify that we never ever try to 
update a safeTime with a smaller or equal value.
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

 


> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Bug
>Reporter: Alexander Lapin
>Priority: Blocker
>  Labels: ignite-3, transactions
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
>  



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


[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-08-01 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Issue Type: Bug  (was: Improvement)

> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Bug
>Reporter: Alexander Lapin
>Priority: Blocker
>  Labels: ignite-3, transactions
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to add an assert that will verify that we never ever try to 
> update a safeTime with a smaller or equal value.
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
>  



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


[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-08-01 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Priority: Blocker  (was: Major)

> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Alexander Lapin
>Priority: Blocker
>  Labels: ignite-3, transactions
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to add an assert that will verify that we never ever try to 
> update a safeTime with a smaller or equal value.
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
>  



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


[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-08-01 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Description: 
h3. Motivation

The logic of setting safeTime explicitly prohibits setting a larger time ahead 
of a smaller one. In other words, all data updates within storages should be 
strictly ordered by the safeTime associated with such updates. Currently it's 
not true:
 * We associate update and safe time during update command creation (see 
org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)

{code:java}
UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
 ...
                .safeTimeLong(hybridClock.nowLong());   {code}

 * However, neither applying a given command locally nor sending it to the raft 
isn't linearized with associated safeTime value. In other words, it's possible 
that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply cmd1 prior 
to cmd0 locally.

Simply speaking, we lack some sort of synchronization here.
h3. Definition of Done
 * It's required to add an assert that will verify that we never ever try to 
update a safeTime with a smaller or equal value.
 * It's required to linearize updates application to preserve guarantees of the 
monotonicity of a safeTime's adjustment.

 

> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Alexander Lapin
>Priority: Major
>  Labels: ignite-3, transactions
>
> h3. Motivation
> The logic of setting safeTime explicitly prohibits setting a larger time 
> ahead of a smaller one. In other words, all data updates within storages 
> should be strictly ordered by the safeTime associated with such updates. 
> Currently it's not true:
>  * We associate update and safe time during update command creation (see 
> org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener)
> {code:java}
> UpdateCommandBuilder bldr = MSG_FACTORY.updateCommand()
>  ...
>                 .safeTimeLong(hybridClock.nowLong());   {code}
>  * However, neither applying a given command locally nor sending it to the 
> raft isn't linearized with associated safeTime value. In other words, it's 
> possible that we will assign t0 to the cmd0 and t1 to the cmd1 but will apply 
> cmd1 prior to cmd0 locally.
> Simply speaking, we lack some sort of synchronization here.
> h3. Definition of Done
>  * It's required to add an assert that will verify that we never ever try to 
> update a safeTime with a smaller or equal value.
>  * It's required to linearize updates application to preserve guarantees of 
> the monotonicity of a safeTime's adjustment.
>  



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


[jira] [Updated] (IGNITE-20116) Linearize storage updates with safeTime adjustment rules

2023-08-01 Thread Alexander Lapin (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-20116:
-
Labels: ignite-3 transactions  (was: )

> Linearize storage updates with safeTime adjustment rules
> 
>
> Key: IGNITE-20116
> URL: https://issues.apache.org/jira/browse/IGNITE-20116
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Alexander Lapin
>Priority: Major
>  Labels: ignite-3, transactions
>




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