-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(dao): support diff transaction #13586
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_latest_version
function need to be made transactional safe as well by returning MAX(version)
, as in case of transaction rollback, the pg_get_serial_sequence('clustering_sync_version', 'version')
function will return a version number that does not exist, and cause issues in the DP.
This reverts commit c97f868.
I think we already rollbacked the insert operation of "clustering_sync_version" ( And the function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chronolaw I do not believe this is safe, as sequences can not be rolled back due to concurrent transaction could be happening while this transaction is active. So in this case, we should apply max
on the version
field, not the sequence.
See: https://stackoverflow.com/questions/2095917/sequences-not-affected-by-transactions
Done. |
* txn in strategy * register_dao_hooks * fix txn funcs * comments * hook dao:xxx:fail * dao:delete:fail * get_latest_version * Revert "get_latest_version" This reverts commit c97f868. * select max
* txn in strategy * register_dao_hooks * fix txn funcs * comments * hook dao:xxx:fail * dao:delete:fail * get_latest_version * Revert "get_latest_version" This reverts commit c97f868. * select max
* txn in strategy * register_dao_hooks * fix txn funcs * comments * hook dao:xxx:fail * dao:delete:fail * get_latest_version * Revert "get_latest_version" This reverts commit c97f868. * select max
* txn in strategy * register_dao_hooks * fix txn funcs * comments * hook dao:xxx:fail * dao:delete:fail * get_latest_version * Revert "get_latest_version" This reverts commit c97f868. * select max
Summary
KAG-3258
Target PR: #13157
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix #[issue number]