Skip to content

[AMORO-3985][AMS] Prevent duplicate table runtime registration - #4453

Open
j1wonpark wants to merge 2 commits into
apache:masterfrom
j1wonpark:fix/runtime-registration-race
Open

j1wonpark wants to merge 2 commits into
apache:masterfrom
j1wonpark:fix/runtime-registration-race

Conversation

@j1wonpark

Copy link
Copy Markdown
Contributor

Why are the changes needed?

REST table creation and background catalog exploration can register the same table runtime concurrently. This can cause a duplicate primary key error in table_runtime, failing table creation and triggering subsequent test_ns already exists errors.

Related to #3985.

Brief change log

  • Serialize runtime registration by table ID using bounded striped locks in the non-master-slave path.
  • Check for an existing runtime under the lock before inserting it and publishing registration events.
  • Add regression tests for late and overlapping registration calls.

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible
  • Add screenshots for manual tests if appropriate
  • Run test locally before making a pull request

Both regression tests fail with duplicate-key errors before the fix and pass afterward. Keeping the existence check but removing the lock still causes the overlapping-registration test to fail.

All 42 selected tests passed, including runtime handler and Iceberg/Mixed catalog tests. Checkstyle and Spotless also passed.

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Signed-off-by: Jiwon Park <jiwonpark@apache.org>
@github-actions github-actions Bot added the module:ams-server Ams server module label Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-server Ams server module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant