Description:
According to the official documentation, row locks acquired after a savepoint will be held until the end of the transaction.but the following scenario will not hold the row lock.
How to repeat:
drop table t1;
create table t1(id int PRIMARY KEY, name varchar(255));
insert into t1 values (1,'A'),(2,'B');
T1:
begin;
T2:
begin;
T1:
SAVEPOINT savepoint1;
update t1 set name = 'AA' where id = 1;
ROLLBACK TO SAVEPOINT savepoint1;
T2:
update t1 set name = 'BB' where id = 1; -- Successful execution, with no blocking
Note:
if T1 before SAVEPOINT savepoint1; excute some sql,like select * from t1;
T2 will experience expected block.