db: introduce support for commit hooks - #201
Merged
Merged
Conversation
|
joamaki
approved these changes
Sep 11, 2026
Introduce a new [statedb.New] option that allows to register commit hooks that get invoked every time that a transaction is committed, before releasing the associated locks. The hooks are strictly read only, and cannot abort the transaction. Additionally provide the possibility of registering the hooks through [statedb.Cell]. One possible use-case for the hooks is to validate properties of the entries of specific tables, for testing purposes. However, they may also unlock other use-cases, including the possibility of synchronously dumping the state to disk, and so on. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
giorio94
force-pushed
the
pr/giorio94/commit-hooks
branch
from
September 11, 2026 12:31
3c17823 to
1907d9b
Compare
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.
Introduce a new [statedb.New] option that allows to register commit hooks that get invoked every time that a transaction is committed, before releasing the associated locks. The hooks are strictly read only, and cannot abort the transaction. Additionally provide the possibility of registering the hooks through [statedb.Cell].
One possible use-case for the hooks is to validate properties of the entries of specific tables, for testing purposes. However, they may also unlock other use-cases, including the possibility of synchronously dumping the state to disk, and so on.