Skip to content
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

Fixed error code difference occurring due to parallel worker enforced #271

Conversation

Deepesh125
Copy link
Contributor

@Deepesh125 Deepesh125 commented Dec 19, 2023

When any error raised from parallel worker then Postgres by default does not share message_id (part of edata) to leader worker. Babelfish's error mapping framework relies on message_id to map to correct T-SQL error code. But since it is no more available to leader worker, T-SQL error code would not be found and default error code will be used. This will also affect the transactional behaviour of given error.

In order to fix this issue, we need to store if given worker is spawned in the context of Babelfish or not to share error message_id. Hence, this changes made changes in two data structure namely Port and FixedParallelState to store context about Babelfish

Extension changes: babelfish-for-postgresql/babelfish_extensions#2155
Task: BABEL-4539
Signed-off-by: Dipesh Dhameliya [email protected]

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the PostgreSQL license, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…babelfish-for-postgresql#260)

When any error raised from parallel worker then Postgres by default does not share message_id (part of edata) to
leader worker. Babelfish's error mapping framework relies on message_id to map to correct T-SQL error code. But
since it is no more available to leader worker, T-SQL error code would not be found and default error code will be used.
This will also affect the transactional behaviour of given error.

In order to fix this issue, we need to store if given worker is spawned in the context of Babelfish or not to share error
message_id. Hence, this changes made changes in two data structure namely Port and FixedParallelState to store
context about Babelfish

Extension changes: babelfish-for-postgresql/babelfish_extensions#2047
Task: BABEL-4539
Signed-off-by: Dipesh Dhameliya <[email protected]>
@Deepesh125 Deepesh125 merged commit 354bdde into babelfish-for-postgresql:BABEL_2_X_DEV__PG_14_X Dec 19, 2023
1 check passed
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.

2 participants