apache / apache/incubator-seata

sqlServer的行锁不释放

Open Beginner friendly
#8,033 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### Check Ahead

- [x] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.

- [x] I am willing to try to fix this bug myself.

### Ⅰ. Issue Description

sqlServer根据sourceId进行行锁的关键词拼接,sqlServer需要用到;来进行参数分割,
拼接完成的key没有进行脱敏,取出或替换掉;
后面进行锁释放时又根据;进行拆分导致整体的key被拆分为两个,从而使锁不释放,
示例url:jdbc:sqlserver://127.0.0.1:1433;databaseName=lxk;encrypt=false;trustServerCertificate=true;
构建完成的key=SEATA_ROW_LOCK_jdbc:sqlserver://127.0.0.1:1433:1433;databaseName=_lxk^^^BPM_ACT_RU_TASK^^^123
行锁删除时根据关键词;拆分:
分别删除key: SEATA_ROW_LOCK_jdbc:sqlserver://127.0.0.1:1433:1433 和 databaseName=_lxk^^^BPM_ACT_RU_TASK^^^123
行锁数据残留导致行锁不释放。
需要更改点:
org.apache.seata.core.lock.AbstractLocker#getRowKey
处理完成后,字符串进行;.replace(ROW_LOCK_KEY_SPLIT_CHAR,LOCK_SPLIT)

### Ⅱ. Describe what happened

_No response_

### Ⅲ. Describe what you expected to happen

_No response_

### Ⅳ. How to reproduce it (as minimally and precisely as possible)

_No response_

### Ⅴ. Anything else we need to know?

_No response_

### Ⅵ. Environment

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at org.apache.seata.core.lock.AbstractLocker#getRowKey and inspect how SQL Server JDBC URLs are incorporated into row-lock keys. Reproduce with the provided SQL Server URL, then verify that the key remains a single value during release and that no residual row-lock entry remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.