apache / apache/incubator-seata

@GlobalLock的优化小需求

Open
#4,772 4 comments 0 reactions 1 assignee Claimed by @doubleDimple View on GitHub
task: help-wanted
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

## Why you need it?
关于@GlobalLock注解,client1.4.2。

**场景**:防止由于开发人员未遵循seata规范导致的线上出现数据类问题,加大上线安全率(防止挨骂),打算对已经涉及分布式事务表(即所有RM层的接口)加上@GlobalLock注解。

**测试**:
1、debug发现RM层加上@GlobalLock也会做前后镜像,且前后镜像都对如update set语句非条件字段也做了镜像。
2、没有在逻辑开始前加上select ... for update,执行update语句后,@GlobalLock检查到全局锁存在后会立刻抛出异常; 而对于多事务用了@GlobalTransactional注解,都会等待其参数设定的时间。

**需求**:
1、对于这种场景,希望优化@GlobalLock的“无谓”镜像。
2、希望能像@GlobalTransactional其作用,使在update语句上的@GlobalLock不加select ... for update,能够重试检查全局锁。
不愿加select ... for update 原因是对系统代码侵入较强。所以希望能多另一个新注解解决这个问题。

因场景经验不足,如诉求不合理,望指出,非常感谢。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.