8000 Concurrency control and utilities for (key) constraints of a table by Rob2U · Pull Request #2699 · hyrise/hyrise · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Concurrency control and utilities for (key) constraints of a table #2699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Rob2U
Copy link
Contributor
@Rob2U Rob2U commented May 5, 2025

This PR adds locking to the constraints stored for a table. Specifically a _constraint_mutex is added to a table. To acquire this mutex acquire_constraints_modify_mutex can be used.

To avoid redundant validation or invalidation of key constraints that are already known to be valid or invalid, two new timestamp attributes are introduced: _last_validated_on and _last_invalidated_on. These store the CommitID of the most recent validation or invalidation.

With this data, we can determine whether a TableKeyConstraint is still confidently valid or invalid by comparing the stored CommitIDs with those of the table’s chunks. This logic is implemented in two new methods: is_constraint_confidently_valid and is_constraint_confidently_invalid, located in constraint_utils.cpp.

As these methods are not yet used in the UCCDiscoveryPlugin, we can only add tests in the following locations:

  • src/test/lib/concurrency/stress_test.cpp
  • src/test/lib/storage/constraints/constraint_utils_test.cpp

@Rob2U Rob2U marked this pull request as draft May 5, 2025 13:09
@Rob2U Rob2U changed the title Add concurrency control and utilities for (key) constraints of a table Concurrency control and utilities for (key) constraints of a table May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0