Skip to content

Commit

Permalink
Update docs related to locking
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Oct 30, 2024
1 parent 0e14d1a commit 5cf495e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions information-schema/information-schema-data-lock-waits.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@ CURRENT_HOLDING_TRX_ID: 426790590082449409
```

The above query result shows that the transaction of the ID `426790594290122753` is trying to obtain the pessimistic lock on the key `"7480000000000000355F728000000000000001"` when executing a statement that has digest `"38b03afa5debbdf0326a014dbe5012a62c51957f1982b3093e748460f8b00821"` and is in the form of ``update `t` set `v` = `v` + ? where `id` = ?``, but the lock on this key was held by the transaction of the ID `426790590082449409`.

### See also

- [Troubleshooting lock conflicts](/troubleshoot-lock-conflicts.md)
2 changes: 1 addition & 1 deletion mysql-schema/mysql-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Currently, the `help_topic` is NULL.

## System tables related to metadata locks

* `tidb_mdl_view`: a view of metadata locks. You can use it to view information about the currently blocked DDL statements
* `tidb_mdl_view`: a view of metadata locks. You can use it to view information about the currently blocked DDL statements. See also [Metadata Lock](/metadata-lock.md)
* `tidb_mdl_info`: used internally by TiDB to synchronize metadata locks across nodes

## System tables related to DDL statements
Expand Down
6 changes: 6 additions & 0 deletions troubleshoot-lock-conflicts.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ In the above query, the [`TIDB_DECODE_SQL_DIGESTS`](/functions-and-operators/tid

If the `start_ts` of the current transaction is unknown, you can try to find it out from the information in the `TIDB_TRX` / `CLUSTER_TIDB_TRX` table or in the [`PROCESSLIST` / `CLUSTER_PROCESSLIST`](/information-schema/information-schema-processlist.md) table.

### Metadata locks

When a session is waiting on a schema change this can be because of a metadata lock.

See [Metadata locks](/metadata-lock.md) for more information.

## Troubleshoot optimistic lock conflicts

This section provides the solutions of common lock conflict issues in the optimistic transaction mode.
Expand Down

0 comments on commit 5cf495e

Please sign in to comment.