Optimize Named Locks by Removing __all_dbms_lock_allocated Persistence - #1338
Open
Mai-icy wants to merge 12 commits into
Open
Optimize Named Locks by Removing __all_dbms_lock_allocated Persistence#1338Mai-icy wants to merge 12 commits into
Mai-icy wants to merge 12 commits into
Conversation
Mai-icy
marked this pull request as ready for review
August 28, 2026 10:02
Mai-icy
force-pushed
the
migrate/gitlab-mr-1089-task-2026072800117800650
branch
from
August 31, 2026 02:32
8bd90d4 to
a63953f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Moves MySQL named locks from inner-table persistence to a server-local in-memory manager.
Changes:
- Adds in-memory acquisition, release, timeout, deadlock, and cleanup handling.
- Exposes named locks through the virtual object-lock view.
- Removes obsolete persistence schema and helpers.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
unittest/storage/transaction/tablelock/test_named_lock_manager.cpp |
Tests manager behavior. |
tools/deploy/mysql_test/test_suite/inner_table/r/mysql/show_sys_tables_in_sys.result |
Updates expected schemas. |
src/storage/tablelock/ob_table_lock_service.h |
Owns the manager. |
src/storage/tablelock/ob_table_lock_service.cpp |
Manages its lifecycle. |
src/storage/tablelock/ob_table_lock_live_detector.h |
Splits cleanup APIs. |
src/storage/tablelock/ob_table_lock_live_detector.cpp |
Updates cleanup implementation. |
src/storage/tablelock/ob_session_table_lock.cpp |
Adds in-memory lock operations. |
src/storage/tablelock/ob_named_lock_manager.h |
Defines the manager. |
src/storage/tablelock/ob_named_lock_manager.cpp |
Implements locking and deadlock detection. |
src/storage/storage_source_inventory.bzl |
Registers the source. |
src/storage/storage_header_inventory.bzl |
Registers the header. |
src/sql/tablelock/ob_lock_func_executor.h |
Removes persistence helpers. |
src/sql/tablelock/ob_lock_func_executor.cpp |
Routes SQL functions in memory. |
src/sql/tablelock/ob_lock_executor.h |
Removes obsolete APIs. |
src/sql/tablelock/ob_lock_executor.cpp |
Removes inner-table lookups. |
src/sql/session/ob_sql_session_info.cpp |
Cleans locks on disconnect. |
src/share/inner_table/ob_inner_table_schema_def.py |
Removes the table and adds obj_name. |
src/observer/virtual_table/ob_all_virtual_obj_lock.h |
Adds snapshot state. |
src/observer/virtual_table/ob_all_virtual_obj_lock.cpp |
Emits named-lock rows. |
src/observer/mysql/obmp_reset_connection.cpp |
Cleans locks on reset. |
src/data_plane/api/data_plane/tablelock/ob_session_table_lock.h |
Updates the data-plane API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Mai-icy
force-pushed
the
migrate/gitlab-mr-1089-task-2026072800117800650
branch
3 times, most recently
from
August 31, 2026 08:04
234cda0 to
2248b03
Compare
wangyunlai-seekdb
left a comment
Contributor
There was a problem hiding this comment.
Three Major findings remain at the current PR head: connection reset can retain table locks, mixed named/table wait cycles escape deadlock detection, and the new test suite is not wired into a runnable target.
Mai-icy
force-pushed
the
migrate/gitlab-mr-1089-task-2026072800117800650
branch
from
September 3, 2026 08:54
3a3fe43 to
7d8849f
Compare
hnwyllmm
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task Description
Migrate oceanbase/oceanbase-lite!1089 to SeekDB.
The change removes persistence through
__all_dbms_lock_allocatedand keeps MySQL named-lock state in memory.Solution Description
Passed Regressions
git diff --check upstream/master...HEADThe original MR updated mysqltest coverage. Five legacy mysqltest files no longer exist on the current GitHub
master, so their changes were not reintroduced:tools/deploy/mysql_test/r/mysql/simple_ddl.resulttools/deploy/mysql_test/test_suite/table_lock/r/mysql/lock_func_basic.resulttools/deploy/mysql_test/test_suite/table_lock/t/lock_func_basic.testtools/deploy/mysql_test/test_suite/view/r/mysql/cdb_objects.ce.resulttools/deploy/mysql_test/test_suite/view/r/mysql/cdb_objects.resultUpdates to the two test-result files still present in SeekDB were migrated.
Upgrade Compatibility
This changes named-lock state from inner-table persistence to in-memory runtime state. Upgrade and restart behavior should be reviewed before merge.
Other Information
task/20260728001178006501d7f1b4bf05a287147da020de12049dfd249176foceanbase/seekdb:master; authorship and commit messages were preserved.Release Note
Manage MySQL named locks in memory, expose them through the virtual object-lock view, and remove obsolete
__all_dbms_lock_allocatedpersistence helpers.